Saturday, March 29, 2014

apk decompiled code back to the positive development of the code with syntax discrepancy read.


posts by szuzsq edited 2013-09-27 12:09:38
Decompilation tools related to three: apktool1.5.2, dex2jar-0.0.9.15, jd-gui.exe

For example enumerated type:

Source code is:

 
package com.example.test;

import android.os.Bundle;
import android.app.Activity;

public class MainActivity extends Activity {
@ Override
protected void onCreate (Bundle savedInstanceState) {
super.onCreate (savedInstanceState);
setContentView (R.layout.activity_main);
}
}

enum TestEnum {
one, two, three, four, five, six, seven, eight, nine, ten;
}


After compilation, the bin / classes.dex decompile:
dex2jar.bat classes.dex
Get classes_dex2jar.jar, the code uses jd-gui.exe open the jar, see decompile after:
 
package com.example.test;

import android.app.Activity;
import android.os.Bundle;

public class MainActivity extends Activity
{
protected void onCreate (Bundle paramBundle)
{
super.onCreate (paramBundle);
setContentView (2130903040);
}
}

enum TestEnum
{
static
{
three = new TestEnum ("three", 2);
four = new TestEnum ("four", 3);
five = new TestEnum ("five", 4);
six = new TestEnum ("six", 5);
seven = new TestEnum ("seven", 6);
eight = new TestEnum ("eight", 7);
nine = new TestEnum ("nine", 8);
ten = new TestEnum ("ten", 9);
TestEnum [] arrayOfTestEnum = new TestEnum [10];
arrayOfTestEnum [0] = one;
arrayOfTestEnum [1] = two;
arrayOfTestEnum [2] = three;
arrayOfTestEnum [3] = four;
arrayOfTestEnum [4] = five;
arrayOfTestEnum [5] = six;
arrayOfTestEnum [6] = seven;
arrayOfTestEnum [7] = eight;
arrayOfTestEnum [8] = nine;
arrayOfTestEnum [9] = ten;
}
}


We pay attention to see the code decompiled back later, with the difference between the source code.
MainActivity class basically no, but TestEnum big difference to this enumeration. Huh ..

/ / / / / / / / / / / / / / / / / / / / / / / / / / / / /
Although very different, but through trial, to know how the original code is a form of ...
However, the following class, you do not really know how it looks like the original code, and find you a look at ...

 
public class BinderProxy {
private IBinder mBinder;
private ServiceConnection mCon = new ServiceConnection () {
public void onServiceConnected (ComponentName paramComponentName, IBinder paramIBinder) {
/ / Problem here, from start to finish, I did not find it access $ 002 to have this function .. ask everyone else ... this is how it is how the original code may look like?????
BinderProxy.access $ 002 (BinderProxy.this, paramIBinder);
}

public void onServiceDisconnected (ComponentName paramComponentName) {
BinderProxy.access $ 002 (BinderProxy.this, null);
}
};
/ / The following omitted some code ............
}


If the above code access $ 002 this function is God horse situation???????
<-! Main posts under Banner (D4) -><-! Posts under the main text (D5) ->
Reply:
The reply was deleted administrator at 2013-09-27 15:46:52

Reply:
No answer it?
Reply:
It is automatically generated by the compiler, class calls for internal or external class method variables.
You can look at this Post .

No comments:

Post a Comment