繁体   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