Tag: proguard

NameNotFoundException webview

我从Crashlytics收到错误,指出某些设备缺lesscom.google.android.webview。 这怎么可能呢? java.lang.RuntimeException: Unable to start activity ComponentInfo{com.myapp.app/com.myapp.ReaderActivity}: android.view.InflateException: Binary XML file line #29: Error inflating class com.myapp.MyWebView at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2298) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2360) at android.app.ActivityThread.access$800(ActivityThread.java:144) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1278) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:135) at android.app.ActivityThread.main(ActivityThread.java:5221) at java.lang.reflect.Method.invoke(Method.java) at java.lang.reflect.Method.invoke(Method.java:372) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:899) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:694) Caused by: android.view.InflateException: Binary XML file line #29: Error inflating class com.myapp.MyWebView at android.view.LayoutInflater.createView(LayoutInflater.java:633) at […]

如何在Android Studio中使用ProGuard?

这是我在Android Studio中的第一个项目,我的应用程序没有在代码中混淆…我在build.gradle文件中使用这个configuration: 我正在使用“生成”>“生成已签名APK”,并选中“运行进度”。 而且,当我使用Apk_OneClick.v4.2进行testing时,我的代码完全易于阅读: 请帮帮我。 🙁

proguard地狱 – 找不到引用类

所以,我正在尝试发布一些软件,但Proguard让我头疼。 当我尝试导出使用proguard时,我得到很多警告即“无法find引用类” 例如: [2011-08-07 17:44:37 – GAME] Warning: org.simpleframework.xml.stream.StreamReader: can't find referenced class javax.xml.stream.events.XMLEvent [2011-08-07 17:44:37 – GAME] Warning: there were 52 unresolved references to classes or interfaces. [2011-08-07 17:44:37 – GAME] You may need to specify additional library jars (using '-libraryjars'), [2011-08-07 17:44:37 – GAME] or perhaps the '-dontskipnonpubliclibraryclasses' option. [2011-08-07 17:44:37 – GAME] […]

发布之前删除所有debugging日志logging调用:有工具可以做到这一点吗?

根据谷歌,我必须“发布我的Android应用程序之前, 停用任何调用在源代码中的日志方法 ”。 从出版物清单第5部分摘录: 确保在构build要发布的应用程序之前停用日志logging并禁用debugging选项。 您可以通过删除对源文件中的日志方法的调用来停用日志logging。 我的开放源代码项目很大,每次发布时手动都会很痛苦。 此外,删除日志行可能会非常棘手,例如: if(condition) Log.d(LOG_TAG, "Something"); data.load(); data.show(); 如果我注释了Log行,那么这个条件适用于下一行,并且机会是load()不被调用。 这种情况是否足够罕见,我可以认定它不应该存在? 这是在正式的清单上,所以我想很多人定期做这个。 那么,是否有一个工具,可以删除所有的日志行? 最好不要被上面的代码所欺骗。

Android:Proguard的推荐configuration是什么?

我正在开发面向Android的应用程序,并使用Proguard来混淆代码。 目前我正在使用ProGuardconfiguration: -optimizationpasses 5 -dontusemixedcaseclassnames -dontskipnonpubliclibraryclasses -dontpreverify -verbose -optimizations !code/simplification/arithmetic,!field/*,!class/merging/* -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 com.android.vending.licensing.ILicensingService 维护在布局XML上使用的自定义组件名称: -keep public class custom.components.** 删除debugging日志: -assumenosideeffects class android.util.Log { public […]

使用proguard时如何保留/排除特定的包path?

我想从ProGuard中排除一些文件path。 示例com.myapp.customcomponents 我该怎么做? 我讨厌将每个自定义组件文件放在这个目录中。 我已经尝试了以下,但它不起作用: -keep public class com.myapp.customcomponents.*

使用proguard删除日志通话

我正在尝试使用proguard去除所有的日志:我在我的proguard-project.txt文件中input了以下行: -assumenosideeffects class android.util.Log { *; } 而我的project.properties看起来像这样: proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt 尽pipe如此,日志仍然显示在我的应用程序。 我在这里做错了什么?

在ProGuard优化过程中删除未使用的string

当我发布一个Android应用程序时,我将这个ProGuardconfiguration包含在去除debugging日志语句中: -assumenosideeffects class android.util.Log { public static *** d(…); public static *** v(…); } 这个按预期工作 – 我可以从ProGuard日志和Android日志输出中看到诸如Log.d("This is a debug statement");调用Log.d("This is a debug statement"); 被删除。 不过,如果我在这个阶段反编译应用程序,我仍然可以看到所有使用的String字面值,即在这个例子中This is a debug statement 。 有没有办法也删除字节码中不再需要的每个String ?

用Proguard编译给出SimException:“局部variablestypes不匹配”

当我编译我的Android应用程序与Proguard启用时,我得到以下错误: -dex: [echo] Converting compiled files and external libraries into /home/ka/dev/workspace/ImPress/build/classes.dex… [apply] [apply] UNEXPECTED TOP-LEVEL EXCEPTION: [apply] com.android.dx.cf.code.SimException: local variable type mismatch: attempt to set or access a value of type java.io.File using a local variable of type java.lang.Object[]. This is symptomatic of .class transformation tools that ignore local variable information. [apply] at com.android.dx.cf.code.BaseMachine.throwLocalMismatch(BaseMachine.java:550) [apply] […]

在Eclipse中启用ProGuard for Android

ProGuard for Android的新文档说要将一行添加到项目主目录中的default.properties文件中。 不过,在打开这个文件的时候,我读到顶部: # This file is automatically generated by Android Tools. # Do not modify this file — YOUR CHANGES WILL BE ERASED! 我错过了什么吗? 另外,是否有一种方法可以使ProGuard仅用于Eclipse的生产版本(即导出成品时)?