Closed aolphn closed 7 years ago
微信混淆是可以配置白名单,友盟的一些资源是需要加入白名单的,否则是会出错的。 https://github.com/shwenzhang/AndResGuard/blob/master/README.zh-cn.md
嗯,这点我注意到了,但我觉得这里崩溃了的原因是图片本身被压缩导致的。我看了压缩过的资源id和文件路径是对应起来的,这里的资源是app的icon不是友盟直接用的。我在compressFilePattern中使用"[^app_logo]{1,}.png" 替换了"*.png"。我的理解是这样的话就不对app_logo.png图片压缩但是其他png照样压缩,这样配置完APP不会崩溃,但是安装包和直接把“*.png”删除了一样大,所以我觉得好像所有png没有被压缩。
好吧,我凌乱了,我也不知道怎么回事了。"[^app_logo]{1,}.png" 替换了".png"编译出来的apk是42,246,871Bytes,直接用".png"编译出来是40,302,847 bytes。用AS比较一下 ,无差别。但是运行期间使用"*.png"方式处理过的图片友盟分享会崩溃,而"[^app_logo]{1,}.png"这种方式不会崩溃。看来我只能认为AS的比较工具有问题了,用BC比较了一下,差别还是挺大的
对了,问一下,你们那里支持正则表达式吗?我感觉我写的那个规则有问题。
@zhangkehu 没有支持完整的正则,只是有支持单子,多子匹配。
OK
08-22 14:36:41.739 27470-27791/com.view.asim.gov E/CrashReport: stack frame :19, has cause true 08-22 14:36:41.762 27470-27791/com.view.asim.gov E/CrashReport: #++++++++++Record By Bugly++++++++++# 08-22 14:36:41.762 27470-27791/com.view.asim.gov E/CrashReport: # You can use Bugly(http:\\bugly.qq.com) to get more Crash Detail! 08-22 14:36:41.762 27470-27791/com.view.asim.gov E/CrashReport: # PKG NAME: com.view.asim.gov 08-22 14:36:41.762 27470-27791/com.view.asim.gov E/CrashReport: # APP VER: 1.9.13.170811 08-22 14:36:41.762 27470-27791/com.view.asim.gov E/CrashReport: # LAUNCH TIME: 2017-08-22 14:35:46 08-22 14:36:41.762 27470-27791/com.view.asim.gov E/CrashReport: # CRASH TYPE: JAVA_CRASH 08-22 14:36:41.762 27470-27791/com.view.asim.gov E/CrashReport: # CRASH TIME: 2017-08-22 14:36:41 08-22 14:36:41.762 27470-27791/com.view.asim.gov E/CrashReport: # CRASH PROCESS: com.view.asim.gov 08-22 14:36:41.762 27470-27791/com.view.asim.gov E/CrashReport: # CRASH THREAD: umengsocial 08-22 14:36:41.762 27470-27791/com.view.asim.gov E/CrashReport: # REPORT ID: 66e12b93-6d5b-4001-a39a-4a2cad63aa6c 08-22 14:36:41.762 27470-27791/com.view.asim.gov E/CrashReport: # CRASH DEVICE: EVA-AL00 UNROOT 08-22 14:36:41.762 27470-27791/com.view.asim.gov E/CrashReport: # RUNTIME AVAIL RAM:1402748928 ROM:19488866304 SD:19467890688 08-22 14:36:41.762 27470-27791/com.view.asim.gov E/CrashReport: # RUNTIME TOTAL RAM:2915516416 ROM:26933706752 SD:26912735232 08-22 14:36:41.762 27470-27791/com.view.asim.gov E/CrashReport: # CRASH STACK: 08-22 14:36:41.763 27470-27791/com.view.asim.gov E/CrashReport: android.content.res.Resources$NotFoundException: File r/u/aro.png from drawable resource ID #0x7f020073 at android.content.res.ResourcesImpl.openRawResourceFd(ResourcesImpl.java:356) at android.content.res.Resources.openRawResourceFd(Resources.java:1330) at com.umeng.socialize.media.UMImage$ResConvertor.asFile(UMImage.java:546) at com.umeng.socialize.media.UMImage.asFileImage(UMImage.java:218) at com.umeng.socialize.media.QQShareContent.parseImage(QQShareContent.java:154) at com.umeng.socialize.media.QQShareContent.buildImageParams(QQShareContent.java:94) at com.umeng.socialize.media.QQShareContent.buildTextImageParams(QQShareContent.java:110) at com.umeng.socialize.media.QQShareContent.buildParams(QQShareContent.java:60) at com.umeng.socialize.handler.UMQQSsoHandler.defaultShareToQQ(UMQQSsoHandler.java:513) at com.umeng.socialize.handler.UMQQSsoHandler.shareToQQ(UMQQSsoHandler.java:407) at com.umeng.socialize.handler.UMQQSsoHandler.share(UMQQSsoHandler.java:88) at com.umeng.socialize.b.a.a(SocialRouter.java:346) at com.umeng.socialize.i.a(UMShareAPI.java:173) at com.umeng.socialize.i.doInBackground(UMShareAPI.java:168) at com.umeng.socialize.common.QueuedWork$UMAsyncTask$1.run(QueuedWork.java:150) at android.os.Handler.handleCallback(Handler.java:755) at android.os.Handler.dispatchMessage(Handler.java:95) at android.os.Looper.loop(Looper.java:156) at android.os.HandlerThread.run(HandlerThread.java:61) Caused by: java.io.FileNotFoundException: This file can not be opened as a file descriptor; it is probably compressed at android.content.res.AssetManager.openNonAssetFdNative(Native Method) at android.content.res.AssetManager.openNonAssetFd(AssetManager.java:803) at android.content.res.ResourcesImpl.openRawResourceFd(ResourcesImpl.java:354) at android.content.res.Resources.openRawResourceFd(Resources.java:1330) at com.umeng.socialize.media.UMImage$ResConvertor.asFile(UMImage.java:546) at com.umeng.socialize.media.UMImage.asFileImage(UMImage.java:218) at com.umeng.socialize.media.QQShareContent.parseImage(QQShareContent.java:154) at com.umeng.socialize.media.QQShareContent.buildImageParams(QQShareContent.java:94) at com.umeng.socialize.media.QQShareContent.buildTextImageParams(QQShareContent.java:110) at com.umeng.socialize.media.QQShareContent.buildParams(QQShareContent.java:60) at com.umeng.socialize.handler.UMQQSsoHandler.defaultShareToQQ(UMQQSsoHandler.java:513) at com.umeng.socialize.handler.UMQQSsoHandler.shareToQQ(UMQQSsoHandler.java:407) at com.umeng.socialize.handler.UMQQSsoHandler.share(UMQQSsoHandler.java:88) at com.umeng.socialize.b.a.a(SocialRouter.java:346) at com.umeng.socialize.i.a(UMShareAPI.java:173) at com.umeng.socialize.i.doInBackground(UMShareAPI.java:168) at com.umeng.socialize.common.QueuedWork$UMAsyncTask$1.run(QueuedWork.java:150) at android.os.Handler.handleCallback(Handler.java:755) at android.os.Handler.dispatchMessage(Handler.java:95) at android.os.Looper.loop(Looper.java:156) at android.os.HandlerThread.run(HandlerThread.java:61) 08-22 14:36:41.763 27470-27791/com.view.asim.gov E/CrashReport: #++++++++++++++++++++++++++++++++++++++++++#
这个资源貌似是APP的logo,这里友盟分享的时候是通过ApplicationInfo的信息获取APP 的logo的,想请教一下这里为什么会导致崩溃。 顺便问一下,这里的页面说的config.xml在gradle脚本里怎么使用?能不能在Gradle脚本里直接配置白名单不压缩指定的png图片。
这个里面还有其他用法吗?例如可不可以设置过滤的文件?