android 代码混淆后找不到Activity 5C

跳转到mainactivity时空指针?

-keepattributes Annotation
-keep class * extends java.lang.annotation.Annotation { ; }
-keepattributes Signature
-keep public class * extends android.app.Fragment
-keep public class * extends android.app.Activity
-keep public class * extends android.app.Application
-keep public class * extends android.app.Service
-keep public class * extends android.content.BroadcastReceiver
-keep public class * extends android.content.ContentProvider
-keep public class * extends android.app.backup.BackupAgentHelper
-keep public class * extends android.preference.Preference
-keep public class * extends android.support.v4.
*
-keep public class * extends android.support.v7.**
-keep public class * extends java.lang.*
-keep public class * extends android.support.v4.app.Fragment


这些都是保留了的 结果报错

java.lang.RuntimeException: Unable to start activity ComponentInfo{com.application.app.Test/com.application.app.MainActivity}: java.lang.NullPointerExceptio请教一下这是什么原因

3个回答

application.xml里面加了mainactivity的指针吗

qq_20258523
qq_20258523 manifest.xml? 加了啊 是混淆之后出现的这个情况
大约 2 年之前 回复

保留我们使用的四大组件,自定义的Application等等这些类不被混淆

因为这些子类都有可能被外部调用

-keep public class * extends android.app.Activity
-keep public class * extends android.app.Appliction
-keep public class * extends android.app.Service
-keep public class * extends android.content.BroadcastReceiver
-keep public class * extends android.content.ContentProvider
-keep public class * extends android.app.backup.BackupAgentHelper
-keep public class * extends android.preference.Preference
-keep public class * extends android.view.View
-keep public class com.android.vending.licensing.ILicensingService
-keep public class com.google.vending.licensing.ILicensingService

qq_20258523
qq_20258523 ????
大约 2 年之前 回复

log贴全啊,是哪边空指针啊

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
立即提问