简体   繁体   中英

Android App crash when setting debuggable to False

MainActivity closed at runtime witout reason when setting debuggable to False in project gradle file. but when the App is debuggable it's work fine. I have checked logcat but nothing found to help me. anyone have an idea ?

the logcat output is:

    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

I found the problem.I have added this code in BaseActivity that mainActivity inherit from it:

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

The CheckAppSign finish mainActivity if signature is invalid. I had forgotten that code :-) .

hi i see in your answer you using this

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

but this is not usefull because hacker/cracker can change BuildConfig class and if he change Debug value to true this code not executed you should check debug signature too

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM