proguard

How to suppress 'Maybe this is program method' warnings from ProGuard

女生的网名这么多〃 提交于 2019-11-30 01:24:17
问题 I'm using ProGuard with my Android application and I'm running getting the warnings below in my build log. I've added the appropriate '-keep public class com.foo.OtherClass { public static *; }' statement to my proguard.cfg file, but I still get the warnings. My app runs fine and is dynamically accessing the class correctly. Is it possible to suppress these warnings? [proguard] Note: com.foo.MyClass accesses a method 'getInstance()' dynamically [proguard] Maybe this is program method 'com.foo

Android Proguard skip external jar

柔情痞子 提交于 2019-11-30 01:16:27
I tried to use Proguard in my Android project, i setup Proguard using command line 'android update project /path/to/project' and file proguard.cfg was created in project's root directory. (In my Eclipse with Android 2.3 sdk, when create a new project, proguard.cfg file is not automatically created so i have to add it manually using command line). When i export the project, i got the following errors [2011-02-06 09:02:49 - TestProject] Warning: oauth.signpost.jetty.HttpRequestAdapter: can't find referenced class org.mortbay.jetty.client.HttpExchange [2011-02-06 09:02:49 - TestProject] Warning:

android app proguard混淆配置与常见问题

早过忘川 提交于 2019-11-30 00:47:05
proguard 原理 Java代码编译成二进制class 文件,这个class 文件也可以反编译成源代码 ,除了注释外,原来的code 基本都可以看到。为了防止重要code 被泄露,我们往往需要混淆(Obfuscation code) , 也就是把方法,字段,包和类这些java 元素的名称改成无意义的名称,这样代码结构没有变化,还可以运行,但是想弄懂代码的架构却很难。 proguard 就是这样的混淆工具,它可以分析一组class 的结构,根据用户的配置,然后把这些class 文件的可以混淆java 元素名混淆掉。在分析class 的同时,他还有其他两个功能,删除无效代码(Shrinking 收缩),和代码进行优化 (Optimization Options)。 缺省情况下,proguard 会混淆所有代码,但是下面几种情况是不能改变java 元素的名称,否则就会这样就会导致程序出错。 一, 我们用到反射的地方。 二, 我们代码依赖于系统的接口,比如被系统代码调用的回调方法,这种情况最复杂。 三, 是我们的java 元素名称是在配置文件中配置好的。 所以使用proguard时,我们需要有个配置文件告诉proguard 那些java 元素是不能混淆的。 proguard 配置 最常用的配置选项 -dontwarn 缺省proguard 会检查每一个引用是否正确

ProGuard Introduction

半城伤御伤魂 提交于 2019-11-30 00:46:50
介绍 ProGuard 是一个Java类文件压缩器、优化器、混淆器和预校验器。在压缩步骤会发现并移除无用的类、字段、方法和属性。 在优化步骤会分析和优化Method(方法)的字节码。在混淆步骤会使用短且没有意义的名字来重命名剩余的类、字段和方法。 这些前面的步骤会使代码更小、更高效、更难反向工程。最后的预校验步骤会给这些类添加Java Micro版本需要的预校验信息或为Java 6减少启动时间的预校验信息。 这些步骤每一个都是可选的。例如,ProGuard也可以在一个程序中仅仅用来列出无效代码; 或用于在Java 6中预校验类文件提高效率。 ProGuard 通常读取 input jars (或 wars, ears, zips,或 目录)。然后压缩、优化、混淆和预校验它们。 压缩步骤之后,可以执行多个优化过程。ProGuard把这些处理过的结果生成一个或多个 output jars (或 wars, ears, zips, 或 目录)。 输入可能包含资源文件,他们的名字和内容可以可选地被更新成反射混淆之后的类的名字。 ProGuard 要求input jars中的 library jars (or wars, ears, zips, or directories) 被指明。这些在本质上是你编译代码要用到的库。ProGuard用它们来重构类的依赖,并在必要的时候做适当的处理。

Android Application with android-support-v4.jar added to lib facing error while trying to sign in using proguard in IntelliJ Idea

為{幸葍}努か 提交于 2019-11-29 22:55:31
问题 I am trying to sign my application. Without checking the proguard the Sign in process goes fine. But if I am using the proguard I am getting the following stack trace. I have tried adding: -dontwarn CompatHoneycomb -keep class android.support.v4. { *; } -dontwarn **CompatCreatorHoneycombMR2 -dontwarn **ActivityCompatHoneycomb -dontwarn **MenuCompatHoneycomb lines to progaurd.cfg and also updating the progaurd.cfg by downloading the new version and copy pasting the jars and also have checked

Proguard is saying it can't find any classes

谁都会走 提交于 2019-11-29 19:27:01
问题 I'm using proguard with a spring mvc application and maven. My pom.xml's build section looks like: <build> <finalName>myapp</finalName> <plugins> <plugin> <groupId>com.pyx4me</groupId> <artifactId>proguard-maven-plugin</artifactId> <executions> <execution> <phase>package</phase> <goals> <goal>proguard</goal> </goals> </execution> </executions> <configuration> <obfuscate>true</obfuscate> <!--<options>--> <!--<option>-keep public class</option>--> <!--</options>--> <injar>${project.build

Build error referencing build.xml and proguard file: “null returned: 1”

南笙酒味 提交于 2019-11-29 18:47:07
问题 While building my PhoneGap app (with the Facebook SDK plugin installed), I encountered this error: BUILD FAILED C:\adt-bundle-windows-x86_64-20130522\sdk\tools\ant\build.xml:653: The following error occured while executing this line: C:\adt-bundle-windows-x86_64-20130522\sdk\tools\ant\build.xml:698: null returned: 1 Line 653 is: <do-only-if-manifest-hasCode elseText="hasCode = false. Skipp aidl/renderscript/R.java"> Line 698 is: proguardFile="${out.absolute.dir}/proguard.txt" My solutions so

Error: Can't find common super class of

落花浮王杯 提交于 2019-11-29 18:27:15
问题 I am trying to process with Proguard a MS Windows desktop application (Java 6 SE using the SWT lib provided by Eclipse). And I get the following critical error: Unexpected error while performing partial evaluation: Class = [org/eclipse/swt/widgets/DateTime] Method = [<init>(Lorg/eclipse/swt/widgets/Composite;I)V] Exception = [java.lang.IllegalArgumentException] (Can't find common super class of [java/lang/StringBuffer] and [org/eclipse/swt/internal/win32/TCHAR]) Error: Can't find common super

Proguard Retrace not working with stacktrace runtime info like E/AndroidRuntime(10237):

荒凉一梦 提交于 2019-11-29 17:53:21
问题 I need to remove lines from my proguard.trace file like E/AndroidRuntime(10237): in order for retrace to work. Basically I am looking at log file and need to remove this lines or retrace does not work. Am I missing something or do I need to do this for every stacktrace? Basically its the information before that appears at the beginning of a stacktrace line like E/AndroidRuntime(10237): at com.test.a.b.c(UnnownSource) :134 Here is the whole stacktrace: E/AndroidRuntime(10237): FATAL EXCEPTION:

Android design support library proguard rules

蓝咒 提交于 2019-11-29 17:19:39
问题 Have been trying to find some information about the rules needed for the new design support library to work passing proguard. I couldn't find any information about it. Ended up using these rules: -keep class android.support.design.widget.** { *; } -keep interface android.support.design.widget.** { *; } -dontwarn android.support.design.** These rules seem to work but I'm not really sure if there are better rules or if it works with all the classes inside the design support library 回答1: I meet