ChairmanC / dex2jar

Automatically exported from code.google.com/p/dex2jar
0 stars 0 forks source link

Error when use d2j-dex2.jar #160

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. get framework.odex from system/framework/ on the emulator (by DMMS) android 
API 17
2. java -jar baksmali-1.4.1.jar -a 17 -d odexs/ -x framework.odex  (odexs 
folder with .odex dependences) This cmd create a folder named "out" with .smali 
code.
3. java -jar smali-1.4.1.jar out (for pass to .dex from .smali)
4- Obtain out.dex file 
5- I need pass out.dex to out-dex2jar.jar and I apply the next command:
6- d2j-dex2.jar.bat out.dex

What is the expected output? What do you see instead?
I expect out-dex2jar.jar without errors, 

Obtained :

dex2jar out.dex -> out-dex2jar.jar
Error:Landroid/net/VpnService;.protect(I)Z->null
Detail Error Information in File out-error.zip
Please report this file to http://code.google.com/p/dex2jar/issues/entry if 
possible.

And the log are:

java.lang.NullPointerException
    at com.googlecode.dex2jar.ir.ts.BaseLiveAnalyze.use(BaseLiveAnalyze.java:115)
    at com.googlecode.dex2jar.ir.ts.BaseLiveAnalyze$1.exec(BaseLiveAnalyze.java:168)
    at com.googlecode.dex2jar.ir.ts.BaseLiveAnalyze$1.exec(BaseLiveAnalyze.java:154)
    at com.googlecode.dex2jar.ir.ts.Cfg.Forward(Cfg.java:271)
    at com.googlecode.dex2jar.ir.ts.BaseLiveAnalyze.analyze0(BaseLiveAnalyze.java:154)
    at com.googlecode.dex2jar.ir.ts.BaseLiveAnalyze.analyze(BaseLiveAnalyze.java:74)
    at com.googlecode.dex2jar.ir.ts.ZeroTransformer.transform(ZeroTransformer.java:157)
    at com.googlecode.dex2jar.v3.V3MethodAdapter.visitEnd(V3MethodAdapter.java:220)
    at com.googlecode.dex2jar.v3.V3ClassAdapter$2.visitEnd(V3ClassAdapter.java:317)
    at com.googlecode.dex2jar.reader.DexFileReader.acceptMethod(DexFileReader.java:696)
    at com.googlecode.dex2jar.reader.DexFileReader.acceptClass(DexFileReader.java:446)
    at com.googlecode.dex2jar.reader.DexFileReader.accept(DexFileReader.java:328)
    at com.googlecode.dex2jar.v3.Dex2jar.doTranslate(Dex2jar.java:84)
    at com.googlecode.dex2jar.v3.Dex2jar.to(Dex2jar.java:239)
    at com.googlecode.dex2jar.v3.Dex2jar.to(Dex2jar.java:230)
    at com.googlecode.dex2jar.tools.Dex2jarCmd.doCommandLine(Dex2jarCmd.java:107)
    at com.googlecode.dex2jar.tools.BaseCmd.doMain(BaseCmd.java:168)
    at com.googlecode.dex2jar.tools.Dex2jarCmd.main(Dex2jarCmd.java:34)

DexMethodVisitor mv=cv.visitMethod(ACC_PUBLIC, new 
Method("Landroid/net/VpnService;","protect",new String[]{ "I"},"Z"));
DexCodeVisitor code = mv.visitCode();
code.visitArguments(6,new int[]{ 4,5});
DexLabel L0=new DexLabel();
DexLabel L1=new DexLabel();
DexLabel L2=new DexLabel();
code.visitTryCatch(L0,L1,L2,"Ljava/lang/Exception;");
DexLabel L3=new DexLabel();
code.visitTryCatch(L0,L1,L3,null);
DexLabel L4=new DexLabel();
DexLabel L5=new DexLabel();
DexLabel L6=new DexLabel();
code.visitTryCatch(L4,L5,L6,"Ljava/lang/Exception;");
DexLabel L7=new DexLabel();
DexLabel L8=new DexLabel();
DexLabel L9=new DexLabel();
code.visitTryCatch(L7,L8,L9,"Ljava/lang/Exception;");
code.visitConstStmt(OP_CONST,0, Integer.valueOf(0),TYPE_SINGLE); // int: 
0x00000000  float:0,000000
code.visitLabel(L0);
code.visitMethodStmt(OP_INVOKE_STATIC,new int[]{ 5},new 
Method("Landroid/os/ParcelFileDescriptor;","fromFd",new String[]{ 
"I"},"Landroid/os/ParcelFileDescriptor;"));
code.visitMoveStmt(OP_MOVE_RESULT,0,TYPE_OBJECT);
code.visitMethodStmt(OP_INVOKE_STATIC,new int[]{ },new 
Method("Landroid/net/VpnService;","getService",new String[]{ 
},"Landroid/net/IConnectivityManager;"));
code.visitMoveStmt(OP_MOVE_RESULT,2,TYPE_OBJECT);
code.visitMethodStmt(OP_INVOKE_INTERFACE,new int[]{ 2,0},new 
Method("Landroid/net/IConnectivityManager;","protectVpn",new String[]{ 
"Landroid/os/ParcelFileDescriptor;"},"Z"));
code.visitLabel(L1);
code.visitMoveStmt(OP_MOVE_RESULT,2,TYPE_SINGLE);
code.visitLabel(L4);
code.visitMethodStmt(OP_INVOKE_VIRTUAL,new int[]{ 0},new 
Method("Landroid/os/ParcelFileDescriptor;","close",new String[]{ },"V"));
DexLabel L10=new DexLabel();
code.visitLabel(L10);
code.visitReturnStmt(OP_RETURN,2,TYPE_SINGLE);
code.visitLabel(L2);
code.visitMoveStmt(OP_MOVE_EXCEPTION,1,TYPE_OBJECT);
code.visitConstStmt(OP_CONST,2, Integer.valueOf(0),TYPE_SINGLE); // int: 
0x00000000  float:0,000000
code.visitMethodStmt(OP_INVOKE_VIRTUAL,new int[]{ 0},new 
Method("Landroid/os/ParcelFileDescriptor;","close",new String[]{ },"V"));
code.visitLabel(L5);
code.visitJumpStmt(OP_GOTO,L10);
code.visitLabel(L6);
code.visitMoveStmt(OP_MOVE_EXCEPTION,3,TYPE_OBJECT);
code.visitJumpStmt(OP_GOTO,L10);
code.visitLabel(L3);
code.visitMoveStmt(OP_MOVE_EXCEPTION,2,TYPE_OBJECT);
code.visitLabel(L7);
code.visitMethodStmt(OP_INVOKE_VIRTUAL,new int[]{ 0},new 
Method("Landroid/os/ParcelFileDescriptor;","close",new String[]{ },"V"));
code.visitLabel(L8);
code.visitReturnStmt(OP_THROW,2,TYPE_OBJECT);
code.visitLabel(L9);
code.visitMoveStmt(OP_MOVE_EXCEPTION,3,TYPE_OBJECT);
code.visitJumpStmt(OP_GOTO,L8);
code.visitEnd();
mv.visitEnd();

What version of the product are you using? On what operating system?
dex2jar-0.0.9.12

Please upload the file which cause the issue if possible.

Please provide any additional information below.

I try on windows 8 and Ubuntu 12.04, with the same result

Original issue reported on code.google.com by costap...@gmail.com on 11 Jan 2013 at 3:21