簡體   English   中英

將可調試設置為False時Android App崩潰

[英]Android App crash when setting debuggable to False

當在項目gradle文件中將debuggable設置為False時,MainActivity在運行時關閉,原因不詳。 但是當該應用可調試時,它可以正常工作。 我檢查了logcat,但沒有找到任何幫助。 有人有主意嗎?

logcat的輸出是:

    02-07 11:08:48.157 13586-13586/? E/Zygote: v2
02-07 11:08:48.157 13586-13586/? I/libpersona: KNOX_SDCARD checking this for 10177
02-07 11:08:48.157 13586-13586/? I/libpersona: KNOX_SDCARD not a persona
02-07 11:08:48.167 13586-13586/? W/SELinux: Function: selinux_compare_spd_ram, index[1], priority [2], priority version is VE=SEPF_SECMOBILE_6.0.1_0031
02-07 11:08:48.167 13586-13586/? E/Zygote: accessInfo : 0
02-07 11:08:48.167 13586-13586/? W/SELinux: SELinux: seapp_context_lookup: seinfo=default, level=s0:c512,c768, pkgname=ir.androidsoftware.TelegramNew 
02-07 11:08:48.217 13586-13586/? D/TimaKeyStoreProvider: TimaSignature is unavailable
02-07 11:08:48.217 13586-13586/? D/ActivityThread: Added TimaKeyStore provider
02-07 11:08:48.287 13586-13586/? I/InjectionManager: Inside getClassLibPath + mLibMap{0=, 1=}
02-07 11:08:48.287 13586-13586/? W/ResourcesManager: getTopLevelResources: /data/app/ir.androidsoftware.TelegramNew-1/base.apk / 1.0 running in ir.androidsoftware.TelegramNew rsrc of package ir.androidsoftware.TelegramNew
02-07 11:08:48.287 13586-13586/? D/ResourcesManager: For user 0 new overlays fetched Null
02-07 11:08:48.297 13586-13586/? I/InjectionManager: Inside getClassLibPath caller 
02-07 11:08:48.357 13586-13586/? I/GMPM: App measurement is starting up, version: 8487
02-07 11:08:48.357 13586-13586/? I/GMPM: To enable debug logging run: adb shell setprop log.tag.GMPM VERBOSE
02-07 11:08:48.367 13586-13586/? W/ResourcesManager: getTopLevelResources: /data/app/ir.androidsoftware.TelegramNew-1/base.apk / 1.0 running in ir.androidsoftware.TelegramNew rsrc of package ir.androidsoftware.TelegramNew
02-07 11:08:48.387 13586-13586/? I/GAv4: Google Analytics 8.4.87 is starting up. To enable debug logging on a device run:
02-07 11:08:48.387 13586-13586/? I/GAv4:   adb shell setprop log.tag.GAv4 DEBUG
02-07 11:08:48.387 13586-13586/? I/GAv4:   adb logcat -s GAv4
02-07 11:08:48.447 13586-13586/? D/InjectionManager: InjectionManager
02-07 11:08:48.447 13586-13586/? D/InjectionManager: fillFeatureStoreMap ir.androidsoftware.TelegramNew
02-07 11:08:48.447 13586-13586/? I/InjectionManager: Constructor ir.androidsoftware.TelegramNew, Feature store :{}
02-07 11:08:48.447 13586-13586/? I/InjectionManager: featureStore :{}
02-07 11:08:48.447 13586-13586/? D/RelationGraph: garbageCollect()
02-07 11:08:48.447 13586-13586/? W/ResourcesManager: getTopLevelResources: /data/app/ir.androidsoftware.TelegramNew-1/base.apk / 1.0 running in ir.androidsoftware.TelegramNew rsrc of package ir.androidsoftware.TelegramNew
02-07 11:08:48.447 13586-13586/? D/ContextRelationManager: ContextRelationManager() : FEATURE_ENABLED=true
02-07 11:08:48.757 13586-13586/? D/AbsListView: Get MotionRecognitionManager
02-07 11:08:48.757 13586-13586/? E/MotionRecognitionManager: mSContextService = android.hardware.scontext.ISContextService$Stub$Proxy@affb32a
02-07 11:08:48.757 13586-13586/? E/MotionRecognitionManager: motionService = com.samsung.android.motion.IMotionRecognitionService$Stub$Proxy@3f2451b
02-07 11:08:48.757 13586-13586/? E/MotionRecognitionManager: motionService = com.samsung.android.motion.IMotionRecognitionService$Stub$Proxy@3f2451b
02-07 11:08:48.957 13586-13586/? D/Minikin: FontFamily bestFont == NULL, so return vacant FakedFont
02-07 11:08:48.957 13586-13586/? D/Minikin: FontFamily bestFont == NULL, so return vacant FakedFont
02-07 11:08:48.957 13586-13586/? D/Minikin: FontFamily bestFont == NULL, so return vacant FakedFont
02-07 11:08:49.007 13586-13586/? I/Timeline: Timeline: Activity_launch_request id:ir.androidsoftware.TelegramNew time:245262389
02-07 11:08:49.027 13586-13586/? D/Activity: performCreate Call Injection manager
02-07 11:08:49.047 13586-13586/? D/RelationGraph: garbageCollect()
02-07 11:08:49.047 13586-13586/? D/TelegramNew: mainline 1
02-07 11:08:49.047 13586-13586/? W/ResourcesManager: getTopLevelResources: /data/app/ir.androidsoftware.TelegramNew-1/base.apk / 1.0 running in ir.androidsoftware.TelegramNew rsrc of package ir.androidsoftware.TelegramNew
02-07 11:08:49.097 13586-13586/? D/AbsListView: Get MotionRecognitionManager
02-07 11:08:49.097 13586-13586/? E/MotionRecognitionManager: mSContextService = android.hardware.scontext.ISContextService$Stub$Proxy@3f1b83c
02-07 11:08:49.097 13586-13586/? E/MotionRecognitionManager: motionService = com.samsung.android.motion.IMotionRecognitionService$Stub$Proxy@e75e9c5
02-07 11:08:49.097 13586-13586/? E/MotionRecognitionManager: motionService = com.samsung.android.motion.IMotionRecognitionService$Stub$Proxy@e75e9c5
02-07 11:08:49.097 13586-13586/? I/InjectionManager: dispatchOnViewCreated > Target : ir.androidsoftware.TelegramNew.NavigationDrawerFragment isFragment :true
02-07 11:08:49.117 13586-13586/? D/Activity: performCreate Call Injection manager
02-07 11:08:49.147 13586-13586/? I/InjectionManager: dispatchOnViewCreated > Target : ir.androidsoftware.TelegramNew.FragmentMain isFragment :true
02-07 11:08:49.157 13586-13586/? I/InjectionManager: dispatchOnViewCreated > Target : ir.androidsoftware.TelegramNew.FragmentSeeChannels isFragment :true
02-07 11:08:49.397 13586-13586/? D/TelegramNewLeft: CheckLefts killed()
02-07 11:08:49.397 13586-13586/? D/TelegramNewLeft: CheckLefts Stop()
02-07 11:08:50.577 13586-13624/? I/qtaguid: Tagging socket 60 with tag b59f8cea00000000{3047132394,0} uid -1, pid: 13586, getuid(): 10177
02-07 11:08:58.507 13586-13642/? D/Minikin: FontCollection getFamilyForChar is NULL, so assign fakedFont.font = NULL
02-07 11:08:58.507 13586-13642/? E/Minikin: no font for run starting u+dbba length 2
02-07 11:08:58.507 13586-13642/? D/Minikin: FontCollection getFamilyForChar is NULL, so assign fakedFont.font = NULL
02-07 11:08:58.507 13586-13642/? E/Minikin: no font for run starting u+dbba length 2

我發現了問題。我在mainActivity繼承的BaseActivity中添加了以下代碼:

if(!BuildConfig.DEBUG) {
        Secure.CheckPckNm(this);
        Secure.CheckAppSign(this);
}

如果簽名無效,則CheckAppSign完成mainActivity。 我忘記了該代碼:-)。

您好,我在您的回答中看到您使用的是

 if(!BuildConfig.DEBUG) {     
    Secure.CheckPckNm(this);   
    Secure.CheckAppSign(this); 
  } 

但這沒有用,因為黑客/破解者可以更改BuildConfig類,如果他將Debug值更改為true該代碼未執行,您也應該檢查調試簽名

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM