我正在使用 proguard 并隐藏我的代码.. 并且 id 似乎工作......“一半”。我只是希望它不被解码,并且可以工作,并且私人不被 jad 看到..
这是我的java代码
package kr.pkgcls;
public class sums {
private int margin;
private int resVal;
public sums(){
margin = 10;
resVal = 0;
}
public sums(int a){
margin = a;
resVal = 0;
}
private void eval_internal(){
margin++;
for(int i = 0; i<margin; i++){
resVal += i;
}
}
public int eval(){
//error!! when use "return eval_internal()", it exposes..
eval_internal();
return resVal;
}
}
这是我的 .pro 数据
#input file
-injars sumslib.jar
#output file
-outjars sumslib2.jar
#lib
-libraryjars <java.home>/lib/rt.jar
#basic ignores
-dontoptimize
-dontshrink
-dontusemixedcaseclassnames
-target 1.6
-verbose
-keep public class kr.pkgcls.**{
public protected *;
}
#-dontskipnonpubliclibraryclasses
#below makes error
#-keepparameternames
#-keepclasseswithmembernames public class *{
# public void sums();
# public void sums(int);
# public int eval();
#}
#-keepclasseswithmembernames class kr.pkgcls.**{
# public **(***);
#}
#keepclasseswithmembernames public class *{
#}
#external file name input
-obfuscationdictionary dic.txt
-classobfuscationdictionary dic.txt
-packageobfuscationdictionary dic.txt
这是我的 jad 输出。
// Decompiled by Jad v1.5.8g. Copyright 2001 Pavel Kouznetsov.
// Jad home page: http://www.kpdus.com/jad.html
// Decompiler options: packimports(3) radix(10) lradix(10)
package kr.pkgcls;
public class sums
{
public sums()
{
i = 10;
l = 0;
}
public sums(int j)
{
i = j;
l = 0;
}
private void i()
{
i++;
for(int j = 0; j < i; j++)
l += j;
}
public int eval()
{
i();
return l;
}
private int i;
private int l;
}
似乎有效,因为私有被修改为另一个方法名称,而其他方法名称则没有,但它已被解码!!!我的 .pro 选项有问题吗?或者..是因为这段代码太简单了吗?
帮帮我吧伙计们;-<