前往Shuct.Net首页

Shudepb PB反编译专家长时间以来,为业内同类软件事实上的唯一选择.细节,彰显专业.态度,决定品质.

关于反编译的搜索

android 反编译和代码解读 &laquo; farwmarth farwmarth &#8226;Record the life HomeAbout Memovie-music-book &laquo; 上一篇 |下一篇 &raquo; android 反编译和代码解读 撰写于 2013 年 4 月 23 日 | 分类 :android | 没有评论 update :2013-5-18 反编译工具小米人改之理: http://www.xiaomiren.net/apkmodifier/ 一 apk反编译 将apk文件解压后有两部分文件需要处理,一种是xml文件,另一种一个dex文件(.dex) 1.对xml文件进行包的解析,一般有两种方式:apktool(推荐)和AXMLPrinter2.jar;2.从dex到class公认dex2jar.bat,实现反编译;公认的强者;3.而class到java的方式要更多样化一些,因为只是查看反编译后的代码:jd-gui(推荐),Jodeclipse(Jode的Eclipse插件),JadClipse(Jad的Eclipse插件)。 dex解包1.首先把apk文件改名为.zip,然后解压缩其中的class.dex文件,它就是java文件编译再通过dx工具打包成的。2.把class.dex拷贝到dex2jar.bat所在目录。运行dex2jar.bat class.dex,生成classes.dex.dex2jar.jar。3.运行JD-GUI工具(绿色软件,好用的软件!),打开上面的jar文件,即可看到java源代码。4 file-saveall将java源码保存为zip文件 资源文件解包1 安装apktool,将apk反编译 将smali文件包删除.2 将上一步保存的源码解压,在此建立一个src目录.将源码放入src下,导入到eclipse中.结构如下. 反编译完成.错误会很多..可以选择不同的工具来反编译,然后交叉对比.我一般使用jd-ui和jad-eclipse插件来编译. jad-eclipse配置 二 错误代码还原规则 if…else 语句: 反编译代码 if (paramBoolean) paramTextView.setTextColor(-16727809); while (true) { return; paramTextView.setTextColor(-1315861); } 还原后 if (paramBoolean) { paramTextView.setTextColor(-16727809); } else { paramTextView.setTextColor(-1315861); } 会把if ..esle 反编译成 if …while(true)结构. 反编译代码 if (paramInt1 != 1) break label185; if (this.countChild_1 == null) { this.countChild_1 = new PokerCountChild(this.mContext); this.countChild_1 = new PokerCountChild(this.mContext); this.countChild_1.setPosition((int)(0.83D * BaseGameActivity.screenWidth - this.countChild_1.getWidth()), (int)(0.2D * BaseGameActivity.screenHeight)); this.countChild_1.setCount(paramInt2); addOneChild(this.countChild_1); if (paramInt2 == 0) this.countChild_1.setAlpha(0); } this.countChild_1.setCount(paramInt2); } label185: do return; while (paramInt1 != 2); if (this.countChild_2 == null) { this.countChild_2 = new PokerCountChild(this.mContext); this.countChild_2 = new PokerCountChild(this.mContext); this.countChild_2.setPosition((int)(0.17D * BaseGameActivity.screenWidth), (int)(0.2D * BaseGameActivity.screenHeight)); this.countChild_2.setCount(paramInt2); addOneChild(this.countChild_2); if (paramInt2 == 0) this.countChild_2.setAlpha(0); } this.countChild_2.setCount(paramInt2); 还原 if(i == 1) { if(countChild_1 == null) { countChild_1 = new PokerCountChild(mContext); countChild_1 = new PokerCountChild(mContext); countChild_1.setPosition((int)(0.83D * (double)BaseGameActivity.screenWidth - (double)countChild_1.getWidth()), (int)(0.2D * (double)BaseGameActivity.screenHeight)); countChild_1.setCount(j); addOneChild(countChild_1); if(j == 0) countChild_1.setAlpha(0); } countChild_1.setCount(j); } else if(i == 2) { if(countChild_2 == null) { countChild_2 = new PokerCountChild(mContext); countChild_2 = new PokerCountChild(mContext); countChild_2.setPosition((int)(0.17D * (double)BaseGameActivity.screenWidth), (int)(0.2D * (double)BaseGameActivity.screenHeight)); countChild_2.setCount(j); addOneChild(countChild_2); if(j == 0) countChild_2.setAlpha(0); } countChild_2.setCount(j); return; }会将语句倒序,出现break label结构 反编译代码 jd-gui有时会将whilei语句翻译成if,此处要将if改成while switch语句 反编译代码 switch (this.mBand) { default: case 0: case 1: case 2: } while (true) { return; this.mBand.setText("FM1"); continue; this.mBand.setText("FM2"); continue; this.mBand.setText("AM"); }还原 switch (mBand) { case 0: mBand.setText("FM1"); break; case 1: mBand.setText("FM2"); break; case 2: mBand.setText("AM"); break; default: } switch规则就是一个continue对应一个case.要注意是是要外层的continue才算数,在if里的continue不算 enum枚举 还原 jd-guihttp://www.qiaodiqiu.com/how-to-read-java-confusion-after-the-anti-compiled-code.htmlhttp://blog.csdn.net/xyz_fly/article/details/8014455http://blog.csdn.net/hp_2008/article/details/8626010 jadhttp://blog.csdn.net/z3h/article/details/2515287http://blog.csdn.net/z3h/article/details/2640522 &raquo; 标签: android &laquo; oneweek 4.15 -4.21 android 支付宝 快捷支付 接入 &raquo; 评论 0 发表评论 取消回复 电子邮件地址不会被公开。 必填项已用 * 标注 *名字 *电子邮件 网站 评论 您可以使用这些 HTML 标签和属性: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> friends Aether litefeel stackoverflow 勺子哥 草根成春 categories 选择分类目录 life (22) movie (1) oneweek (4) shoot (1) 瞎折腾 (1) mind (3) other (2) Pattern (1) programm (113) actionscript (23) air (2) starling (2) base (1) c++ (12) cocos2d-x (5) java (12) android (9) libgdx (1) python (6) script (4) bat (4) servers (1) tomcat (1) versionControl (3) git (2) svn (1) wordpress (2) 破解 (3) 算法 (1) system (1) centos (1) tools (6) eclipse (2) flashdevelop (1) sublimetext (1) 一个人的喃喃自语 (7) recent comments草根成春 发表在《libgdx字体渲染选择方案》wujiyu115 发表在《顺丰快递接口》paul 发表在《顺丰快递接口》草根成春 发表在《养了几天喵》wujiyu115 发表在《c++ 第五章 const》 Copyright &copy; 2013 &middot; All Rights Reserved &middot; farwmarth 基于 WordPress 3.5 | 主题 MxS2