proguard

Android性能优化系列

自作多情 提交于 2019-12-13 14:50:52
【推荐】2019 Java 开发者跳槽指南.pdf(吐血整理) >>> (一)APP 启动原理 —— 优化启动黑白屏 (二)布局渲染流程与原理 —— 优化卡顿 (四)垃圾回收算法与垃圾收集器 —— 优化内存抖动 (五)图片压缩 —— 优化图片文件、内存 (六)巨图加载 —— 优化图片内存 (七)电量分析 —— 优化耗电 (八)JobSchedule 的使用以及源码分析 (九) AsyncTask 使用及源码分析 (十)ThreadPoolExecutor 源码分析 —— 线程池 (十一)Handle 源码分析以及手写实现 (十二)Proguard 的使用与配置 —— 代码混淆 (十三)Dex 加解密与多 Dex 加载 (十四)Tinker 热修复原理及手写实现 (十五)Dex 加密之 Application 替换 (十六)Android 进程保活 (十七)WebP 的测试与使用 (十八)Protobuf —— 优化序列化,替换 Json (十九)7-Zip 压缩 (二十)Apk 瘦身 来源: oschina 链接: https://my.oschina.net/boonya/blog/3142623

Do I need to 'keep' Parcelable in proguard rules while obfuscating

南楼画角 提交于 2019-12-13 14:42:04
问题 My Project has few classes that extends Parcelable. Do I need to 'keep' them in proguard rules while obfuscating. What is the general practice for parcelables? 回答1: No, the default android rules include this: -keepclassmembers class * implements android.os.Parcelable { public static final android.os.Parcelable$Creator CREATOR; } These default rules will be applied if you leave the default generated gradle definition in place: proguardFiles getDefaultProguardFile('proguard-android.txt'),

Proguard warnings: can't find referenced class scala.*

霸气de小男生 提交于 2019-12-13 13:34:17
问题 After upgrading to new Android tools, I am getting following warnings from Proguard: Warning: scala.xml.EntityRef: can't find referenced class scala.xml.EntityRef$$anonfun$text$1 Warning: scala.xml.dtd.AttrDecl$: can't find referenced class scala.xml.dtd.AttrDecl$$anonfun$toString$1 Warning: scala.collection.mutable.LinkedListLike: can't find referenced class scala.collection.mutable.LinkedListLike$$anonfun$insert$1 Warning: scala.xml.NamespaceBinding: can't find referenced class scala.xml

New Google developer console crashes stack traces are not accurate anymore

你离开我真会死。 提交于 2019-12-13 12:42:59
问题 Google has recently updated the Google Play Console, and now crashes are automatically reported. Since almost all stack traces I got are not accurate anymore: The stack trace is full of <OR> methods, so I guess full of possible candidates? All the line numbers are 0 Note that I use Proguard (and not Multidex) and I strongly suspect it is the cause of the problem. Example: java.lang.ClassCastException: at <<MyPackage>>.adapters.PackageRecyclerViewAdapter.getItemCount(PackageRecyclerViewAdapter

What causes this error in Proguard: “Method must be overridden in [proguard.optimize.peephole.ClassMerger] if ever called”?

两盒软妹~` 提交于 2019-12-13 08:50:56
问题 I am running Proguard via the Maven Plugin, you can see my configuration here: https://github.com/sanity/tahrir/blob/proguard-debug/pom.xml#L61 You can see the complete output of "mvn -DskipTests assembly:assembly" here: https://gist.github.com/ee1081179496e11916cb Despite quite a bit of searching I cannot find any explanation of what causes this error, nor now I can fix it? 回答1: Your input contains a library class that depends on a program class. ProGuard warns about it and doesn't allow it,

Getting Error:Execution failed for task ':app:transformClassesWithMultidexlistForRelease' with MultiDex and disabling obfuscation

瘦欲@ 提交于 2019-12-13 06:59:36
问题 Hi I am using MultiDex in my app with Proguard. When -dontobfuscate line is present in the proguard rules, I am able to generate minified apk without obfuscation. But when I remove this line, to generate an obfuscated apk, from proguard rules I am getting this error in gradle console . Here's the link to my gradle error Gradle Error. Also I have mentioned it below AGPBI: {"kind":"error","text":"Error converting bytecode to dex:\n Cause: java.lang.RuntimeException: Exception parsing classes",

How do I allocate more memory to Proguard with the Proguard Maven Plugin?

只愿长相守 提交于 2019-12-13 06:14:41
问题 I'm getting OutOfMemoryErrors when trying to use the Proguard Maven Plugin. I have tried allocating more memory to Maven by setting the MAVEN_OPTS environment variable to -Xmx2g but this doesn't make any difference. I assume that proguard must run in a separate process. 回答1: As far as I know proguard-maven-plugin has a separate configuration entry for that: <plugin> <groupId>com.pyx4me</groupId> <artifactId>proguard-maven-plugin</artifactId> <version>2.0.4</version> ... <configuration>

Keep method name from Obfuscator Proguard

本秂侑毒 提交于 2019-12-13 05:52:56
问题 How can I prevent method SendToGroup() from Obfuscator in proguard. Coz, this method name will be call from server side and need to be same name (dynamic method call). It's a push from signalR. public class main { private class inner implement x { @Override public Object dynamic { return new Object { @SuppressWarnings("unused") public void SendToGroup(String message) { androidNotification(message); } }; } } } I have seen this and this but still not work and not understand. Please advice. 回答1:

Android Proguard Syntax Error

假装没事ソ 提交于 2019-12-13 05:50:30
问题 I am trying to obfuscate my code using Proguard using the Android SDK. I'm getting a syntax error on a .pro file. I have tried to update the proguard jar files but nothing helped. I searched SO and found a question but none of the answers helped. I have included the Console log and my proguard.cfg. How do I fix this problem? My console log: [2012-05-11 20:12:09 - WrtsMobile] Proguard returned with error code 1. See console [2012-05-11 20:12:09 - WrtsMobile] Error: @C:\Users\SEBAST~1\AppData

Dexguard vs Android plugin - breaks build process

别等时光非礼了梦想. 提交于 2019-12-13 05:16:30
问题 When i try to use dexguard plugin in place of android plugin ( dexguard plugin extends android ), my gradle build process fails with this error: $ ./gradlew assembleDebug FAILURE: Build failed with an exception. * Where: Build file '/projectRoot/app/build.gradle' line: 1 * What went wrong: A problem occurred evaluating project ':projectRoot:app'. Could not create plugin of type 'g'. The first line build.gradle for my app module is apply plugin: 'dexguard' The build.gradle for my whole project