[兼容性问题] 6.0 设备上调用 Bundle#start 但 BundleActivator#start 没有被调用
发布于 2 年前 作者 bin.shao 580 次浏览 来自 问答

问题描述

宿主安装插件成功后,调用 Bundle#start() 方法,插件的 BundleActivator#start() 方法没有被调用,导致这个方法里的插件初始化方法没有执行,插件不能正确运行。

  • apkplug version: 3.9
  • android version: 6.0.1

logcat 日志

11-01 21:15:12.446 24224-25687/com.wlqq W/System: ClassLoader referenced unknown path: 
11-01 21:15:12.522 24224-24224/com.wlqq W/System.err: java.lang.NoSuchMethodException: generatePackageInfo [class android.content.pm.PackageParser$Package, class [I, int, long, long, class android.util.ArraySet, class android.content.pm.PackageUserState, int]
11-01 21:15:12.525 24224-24224/com.wlqq W/System.err:     at java.lang.Class.getMethod(Class.java:624)
11-01 21:15:12.525 24224-24224/com.wlqq W/System.err:     at java.lang.Class.getDeclaredMethod(Class.java:586)
11-01 21:15:12.525 24224-24224/com.wlqq W/System.err:     at org.tengxin.Z.b(Unknown Source)
11-01 21:15:12.525 24224-24224/com.wlqq W/System.err:     at org.tengxin.eg.s(Unknown Source)
11-01 21:15:12.525 24224-24224/com.wlqq W/System.err:     at org.tengxin.eg.t(Unknown Source)
11-01 21:15:12.525 24224-24224/com.wlqq W/System.err:     at org.tengxin.bs.aO(Unknown Source)
11-01 21:15:12.525 24224-24224/com.wlqq W/System.err:     at org.tengxin.bs.ba(Unknown Source)
11-01 21:15:12.525 24224-24224/com.wlqq W/System.err:     at org.tengxin.bs.aK(Unknown Source)
11-01 21:15:12.525 24224-24224/com.wlqq W/System.err:     at org.tengxin.bD.getBaseContext(Unknown Source)
11-01 21:15:12.525 24224-24224/com.wlqq W/System.err:     at org.tengxin.bD.<init>(Unknown Source)
11-01 21:15:12.525 24224-24224/com.wlqq W/System.err:     at org.tengxin.bs.aY(Unknown Source)
11-01 21:15:12.525 24224-24224/com.wlqq W/System.err:     at org.tengxin.bq.getAndroidContext(Unknown Source)
11-01 21:15:12.525 24224-24224/com.wlqq W/System.err:     at org.tengxin.cl.run(Unknown Source)
11-01 21:15:12.525 24224-24224/com.wlqq W/System.err:     at android.os.Handler.handleCallback(Handler.java:739)
11-01 21:15:12.525 24224-24224/com.wlqq W/System.err:     at android.os.Handler.dispatchMessage(Handler.java:95)
11-01 21:15:12.525 24224-24224/com.wlqq W/System.err:     at android.os.Looper.loop(Looper.java:148)
11-01 21:15:12.525 24224-24224/com.wlqq W/System.err:     at android.app.ActivityThread.main(ActivityThread.java:5466)
11-01 21:15:12.525 24224-24224/com.wlqq W/System.err:     at java.lang.reflect.Method.invoke(Native Method)
11-01 21:15:12.525 24224-24224/com.wlqq W/System.err:     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
11-01 21:15:12.525 24224-24224/com.wlqq W/System.err:     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
11-01 21:15:12.525 24224-24224/com.wlqq E/PackageInfo: ApplicationInfo is null
11-01 21:15:12.526 24224-24224/com.wlqq W/System.err: Unable to read ApplicationInfo
11-01 21:15:12.526 24224-24224/com.wlqq W/System.err: java.lang.NullPointerException: Attempt to read from field 'android.content.pm.ApplicationInfo android.content.pm.PackageInfo.applicationInfo' on a null object reference
11-01 21:15:12.526 24224-24224/com.wlqq W/System.err:     at org.tengxin.eg.t(Unknown Source)
11-01 21:15:12.526 24224-24224/com.wlqq W/System.err:     at org.tengxin.bs.aO(Unknown Source)
11-01 21:15:12.526 24224-24224/com.wlqq W/System.err:     at org.tengxin.bs.ba(Unknown Source)
11-01 21:15:12.526 24224-24224/com.wlqq W/System.err:     at org.tengxin.bs.aK(Unknown Source)
11-01 21:15:12.526 24224-24224/com.wlqq W/System.err:     at org.tengxin.bD.getBaseContext(Unknown Source)
11-01 21:15:12.526 24224-24224/com.wlqq W/System.err:     at org.tengxin.bD.<init>(Unknown Source)
11-01 21:15:12.526 24224-24224/com.wlqq W/System.err:     at org.tengxin.bs.aY(Unknown Source)
11-01 21:15:12.526 24224-24224/com.wlqq W/System.err:     at org.tengxin.bq.getAndroidContext(Unknown Source)
11-01 21:15:12.526 24224-24224/com.wlqq W/System.err:     at org.tengxin.cl.run(Unknown Source)
11-01 21:15:12.526 24224-24224/com.wlqq W/System.err:     at android.os.Handler.handleCallback(Handler.java:739)
11-01 21:15:12.526 24224-24224/com.wlqq W/System.err:     at android.os.Handler.dispatchMessage(Handler.java:95)
11-01 21:15:12.526 24224-24224/com.wlqq W/System.err:     at android.os.Looper.loop(Looper.java:148)
11-01 21:15:12.526 24224-24224/com.wlqq W/System.err:     at android.app.ActivityThread.main(ActivityThread.java:5466)
11-01 21:15:12.526 24224-24224/com.wlqq W/System.err:     at java.lang.reflect.Method.invoke(Native Method)
11-01 21:15:12.526 24224-24224/com.wlqq W/System.err:     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
11-01 21:15:12.526 24224-24224/com.wlqq W/System.err:     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)

日志中有如下 WARNING 信息

java.lang.NoSuchMethodException: generatePackageInfo [class android.content.pm.PackageParser$Package, class [I, int, long, long, class android.util.ArraySet, class android.content.pm.PackageUserState, int]

6.0 系统该方法定义为

public static PackageInfo generatePackageInfo(PackageParser.Package p,
            int gids[], int flags, long firstInstallTime, long lastUpdateTime,
            Set<String> grantedPermissions, PackageUserState state, int userId)

见: http://androidxref.com/6.0.1_r10/xref/frameworks/base/core/java/android/content/pm/PackageParser.java

即参数类型 android.util.ArraySet 变更为 java.util.Set

2 回复

感谢您的反馈,这个BUG我们已经加入到BUG列表中了,正在尽快解决,解决完以后会及时回复您

@apkplug v3.9.2 验证该问题已修复

回到顶部