Closed zzhhz closed 1 year ago
最好能提供一个简单的demo
我大概知道什么原因了,两个图片使用的资源映射不一样 ![Uploading 5.png…]() ![Uploading 6.png…]()
是这两张图片
大佬,有什么解决的思路吗?
看下原先apk对应资源文件,资源文件混淆后,打包apk时不能压缩,如果是因为压缩导致的。参考https://github.com/Frezrik/Jiagu/commit/eee9706742d40bbd8bd2849947d0187504e82932 的pack/src/main/java/com/frezrik/jiagu/pack/util/ZipUtil.java自行修改
源文件对应的资源文件没有变化,也没有进行资源文件混淆:使用的配置 release { minifyEnabled false signingConfig signingConfigs.debug proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' }
具体日志如下: -12 10:02:26.641 W/hook_jg (14604): ProviderKey: class android.app.ActivityThread$ProviderClientRecord, ProviderClientRecord: android.app.ActivityThread$ProviderClientRecord@b417896, 替换ContentProvider: com.msunsoft.platform.app.InitProvider@7a23c17 05-12 10:02:26.641 W/hook_jg (14604): mLocalProvidersByName: {com.msunsoft.platform_internet_isomerism/com.msunsoft.platform.app.InitProvider}, com.msunsoft.platform.app.InitProvider 05-12 10:02:26.658 D/StubApp (14604): createPackageContext: com.msunsoft.platform_internet_isomerism, flags: 1 05-12 10:02:26.658 W/NDK_JIAGU(14604): replaceContentProvider 05-12 10:02:26.658 W/hook_jg (14604): android.app.ContextImpl 05-12 10:02:26.658 W/hook_jg (14604): android.app.LoadedApk@591cf7d 05-12 10:02:26.659 W/hook_jg (14604): ProviderKey: class android.app.ActivityThread$ProviderClientRecord, ProviderClientRecord: android.app.ActivityThread$ProviderClientRecord@b417896, 替换ContentProvider: com.msunsoft.platform.app.InitProvider@7a23c17 05-12 10:02:26.659 W/hook_jg (14604): ProviderKey: class android.app.ActivityThread$ProviderClientRecord, ProviderClientRecord: android.app.ActivityThread$ProviderClientRecord@a1b5fe9, 替换ContentProvider: io.rong.imlib.publicservice.base.PublicServiceContentProvider@c17046e 05-12 10:02:26.660 W/hook_jg (14604): mLocalProvidersByName: {com.msunsoft.platform_internet_isomerism/com.msunsoft.platform.app.InitProvider}, com.msunsoft.platform.app.InitProvider 05-12 10:02:26.660 W/hook_jg (14604): mLocalProvidersByName: {com.msunsoft.platform_internet_isomerism/io.rong.imlib.publicservice.base.PublicServiceContentProvider}, io.rong.imlib.publicservice.base.PublicServiceContentProvider 05-12 10:02:26.664 W/init (14644): type=1400 audit(0.0:59523): avc: denied { execute } for name="vendor.mediatek.hardware.zebra@1.0-service" dev="dm-4" ino=157 scontext=u:r:init:s0 tcontext=u:object_r:vendor_file:s0 tclass=file permissive=0 05-12 10:02:26.668 W/PackageManager(14604): Failure retrieving xml 0x7f15000d in package com.msunsoft.platform_internet_isomerism 05-12 10:02:26.668 W/PackageManager(14604): android.content.res.Resources$NotFoundException: File res/gc.xml from xml type xml resource ID #0x7f15000d 05-12 10:02:26.668 W/PackageManager(14604): at android.content.res.ResourcesImpl.loadXmlResourceParser(ResourcesImpl.java:1291) 05-12 10:02:26.668 W/PackageManager(14604): at android.content.res.Resources.loadXmlResourceParser(Resources.java:2426) 05-12 10:02:26.668 W/PackageManager(14604): at android.content.res.Resources.loadXmlResourceParser(Resources.java:2402) 05-12 10:02:26.668 W/PackageManager(14604): at android.content.res.Resources.getXml(Resources.java:1303) 05-12 10:02:26.668 W/PackageManager(14604): at android.app.ApplicationPackageManager.getXml(ApplicationPackageManager.java:2032) 05-12 10:02:26.668 W/PackageManager(14604): at android.content.pm.PackageItemInfo.loadXmlMetaData(PackageItemInfo.java:395) 05-12 10:02:26.668 W/PackageManager(14604): at androidx.core.content.FileProvider.getFileProviderPathsMetaData(FileProvider.java:673) 05-12 10:02:26.668 W/PackageManager(14604): at androidx.core.content.FileProvider.parsePathStrategy(FileProvider.java:695) 05-12 10:02:26.668 W/PackageManager(14604): at androidx.core.content.FileProvider.getPathStrategy(FileProvider.java:645) 05-12 10:02:26.668 W/PackageManager(14604): at androidx.core.content.FileProvider.attachInfo(FileProvider.java:424) 05-12 10:02:26.668 W/PackageManager(14604): at android.app.ActivityThread.installProvider(ActivityThread.java:7283) 05-12 10:02:26.668 W/PackageManager(14604): at android.app.ActivityThread.installContentProviders(ActivityThread.java:6824) 05-12 10:02:26.668 W/PackageManager(14604): at android.app.ActivityThread.handleBindApplication(ActivityThread.java:6741) 05-12 10:02:26.668 W/PackageManager(14604): at android.app.ActivityThread.access$1400(ActivityThread.java:244) 05-12 10:02:26.668 W/PackageManager(14604): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1952) 05-12 10:02:26.668 W/PackageManager(14604): at android.os.Handler.dispatchMessage(Handler.java:106) 05-12 10:02:26.668 W/PackageManager(14604): at android.os.Looper.loop(Looper.java:223) 05-12 10:02:26.668 W/PackageManager(14604): at android.app.ActivityThread.main(ActivityThread.java:7703) 05-12 10:02:26.668 W/PackageManager(14604): at java.lang.reflect.Method.invoke(Native Method) 05-12 10:02:26.668 W/PackageManager(14604): at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:612) 05-12 10:02:26.668 W/PackageManager(14604): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:997) 05-12 10:02:26.668 W/PackageManager(14604): Caused by: java.io.FileNotFoundException: res/gc.xml 05-12 10:02:26.668 W/PackageManager(14604): at android.content.res.AssetManager.nativeOpenXmlAsset(Native Method) 05-12 10:02:26.668 W/PackageManager(14604): at android.content.res.AssetManager.openXmlBlockAsset(AssetManager.java:1096) 05-12 10:02:26.668 W/PackageManager(14604): at android.content.res.ResourcesImpl.loadXmlResourceParser(ResourcesImpl.java:1275) 05-12 10:02:26.668 W/PackageManager(14604): ... 20 more 05-12 10:02:26.669 D/AndroidRuntime(14604): Shutting down VM --------- beginning of crash 05-12 10:02:26.670 E/AndroidRuntime(14604): FATAL EXCEPTION: main 05-12 10:02:26.670 E/AndroidRuntime(14604): Process: com.msunsoft.platform_internet_isomerism, PID: 14604 05-12 10:02:26.670 E/AndroidRuntime(14604): java.lang.RuntimeException: Unable to get provider io.rong.imkit.picture.PictureFileProvider: java.lang.IllegalArgumentException: Missing android.support.FILE_PROVIDER_PATHS meta-data 05-12 10:02:26.670 E/AndroidRuntime(14604): at android.app.ActivityThread.installProvider(ActivityThread.java:7288) 05-12 10:02:26.670 E/AndroidRuntime(14604): at android.app.ActivityThread.installContentProviders(ActivityThread.java:6824) 05-12 10:02:26.670 E/AndroidRuntime(14604): at android.app.ActivityThread.handleBindApplication(ActivityThread.java:6741) 05-12 10:02:26.670 E/AndroidRuntime(14604): at android.app.ActivityThread.access$1400(ActivityThread.java:244) 05-12 10:02:26.670 E/AndroidRuntime(14604): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1952) 05-12 10:02:26.670 E/AndroidRuntime(14604): at android.os.Handler.dispatchMessage(Handler.java:106) 05-12 10:02:26.670 E/AndroidRuntime(14604): at android.os.Looper.loop(Looper.java:223) 05-12 10:02:26.670 E/AndroidRuntime(14604): at android.app.ActivityThread.main(ActivityThread.java:7703) 05-12 10:02:26.670 E/AndroidRuntime(14604): at java.lang.reflect.Method.invoke(Native Method) 05-12 10:02:26.670 E/AndroidRuntime(14604): at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:612) 05-12 10:02:26.670 E/AndroidRuntime(14604): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:997) 05-12 10:02:26.670 E/AndroidRuntime(14604): Caused by: java.lang.IllegalArgumentException: Missing android.support.FILE_PROVIDER_PATHS meta-data 05-12 10:02:26.670 E/AndroidRuntime(14604): at androidx.core.content.FileProvider.getFileProviderPathsMetaData(FileProvider.java:676) 05-12 10:02:26.670 E/AndroidRuntime(14604): at androidx.core.content.FileProvider.parsePathStrategy(FileProvider.java:695) 05-12 10:02:26.670 E/AndroidRuntime(14604): at androidx.core.content.FileProvider.getPathStrategy(FileProvider.java:645) 05-12 10:02:26.670 E/AndroidRuntime(14604): at androidx.core.content.FileProvider.attachInfo(FileProvider.java:424) 05-12 10:02:26.670 E/AndroidRuntime(14604): at android.app.ActivityThread.installProvider(ActivityThread.java:7283) 05-12 10:02:26.670 E/AndroidRuntime(14604): ... 10 more 05-12 10:02:26.680 I/libPowerHal( 551): [perfNotifyAppState] pack:com.msunsoft.platform_internet_isomerism, pid:14604, STATE_DEAD 查找apk里面是有这个文件的,但是加固之后报找不到res/gc.xml,minSdk 21;targetSdk 32;compileSdk 33