解码反编译来源$ C $ c。对于Android的 [英] Decoding Decompiled Source Code For Android
问题描述
我试图做一个图标扩展包我最喜欢的Android应用程序之一,我唯一的来源是一些反编译的来源。我不知道应该是什么来代替main.1 LOCAL1 =新Main.1(本)
I am trying to make an icon expansion pack for one of my favorite Android apps and the only source I have is some decompiled source. I am not sure what should be in place of "main.1 local1 = new Main.1(this)"
Gallery localGallery1 = (Gallery)findViewById(R.id.icon_gallery);
IconImageAdapter localIconImageAdapter = new IconImageAdapter(this);
localGallery1.setAdapter(localIconImageAdapter);
Main.1 local1 = new Main.1(this);
localGallery1.setOnItemClickListener(local1);
另外,我不太清楚是什么Main.access $ 0或此$ 0的呼吁。 Eclipse中抛出了他们的错误。
Also, I am not quite sure what the Main.access$0 or this$0 are calling for. Eclipse throws up an error on them.
int i = Main.access$0(this.this$0)[paramInt].intValue();
而且,当我写我自己的code,我用这源作为参考点为煤矿。我只是需要帮助清理垃圾,以更好一点理解。我需要知道什么Main.1 LOCAL1 =新Main.1(本)谈论。除了Main.access $ 0(this.this $ 0)
因为main.1不是针对Java是正确的。
And while I am writing my own code, I am using this source as a reference point for mine. I just need help sorting out garbage to understand it a little better. I need to know what Main.1 local1 = new Main.1(this) is talking about. As well as Main.access$0(this.this$0) Because main.1 isn't correct for Java.
推荐答案
这些神秘的符号,通常对应的匿名内部类。 Java虚拟机不知道他们,只有顶级类,因此Java编译器提供了多种解决方法,使内部类的工作。
These mysterious symbols usually correspond to the anonymous inner classes. The Java VM doesn't know about them, only about top-level classes, so the Java compiler provides several workarounds to make inner classes to work.
据我可以看到 Main.1
是一些匿名的当地实施 AdapterView.OnItemClickListener
的:
As far as I can see Main.1
is some anonymous local implementation of AdapterView.OnItemClickListener
:
OnItemClickListener local1 = new OnItemClickListener() {
// ...
}
本地类有它的外围类的实例隐式引用,这就是为什么你看到来电新Main.1(本)
。 这$ 0对应于反编译code此引用。
Local class has implicit reference to the instance of its enclosing class, that is why you see call to new Main.1(this)
. 'this$0' corresponds to this reference in the decompiled code.
JVM prevents访问其他类的士兵方法,使编译器产生像一些合成包私有方法的类访问$ 1,0
,以便访问封闭的私有方法实例。 性能设计解释对此进行了更详细信息和建议如果你需要从一个内部类访问它们使用包的私有方法。
JVM prevents classes from accessing privates methods of other classes so the compiler generates several synthetic package-private methods like access$0
in order to access private methods of enclosing instance. "Designing for performance" explains this in more details and recommends to use package-private methods if you need to access them from an inner class.
的intValue
可显式调用或被自动拆箱的结果也是如此。
intValue
may be called explicitly or be a result of auto unboxing as well.
有是与合成方法,如泛型和协变返回类型实现的Java语言的许多其他功能。
There are many others features of the Java language that are implemented with synthetic methods like generics and covariant return types.
这篇关于解码反编译来源$ C $ c。对于Android的的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!