前往Shuct.Net首页

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

关于反编译的搜索

对AndroidApp反编译后的代码的解析 - ScorpioNeal的专栏 - 博客频道 - CSDN.NET ScorpioNeal的专栏 ScorpioNeal@Hust 目录视图 摘要视图 订阅 新年新气象------CSDN2014新版导航就要跟大家见面了 2014年1月微软MVP当选名单揭晓! 消灭0回答,赢下载分 “我的2013”年度征文活动火爆进行中! 专访何海涛:“不正经”程序员的进阶之路 对AndroidApp反编译后的代码的解析 分类: Android App 2012-07-26 09:45 1451人阅读 评论(0) 收藏 举报 stringsmslistclassnull 由于反编译后的代码有些还是比较难以看懂, 所以在这做了一个总结, 把遇到的情景总结一下, 欢迎补充与修正 1。 反编译后大多数的函数名和函数参数的类型都是对的, 可以直接拷贝, Res文件夹下的资源可以直接拷贝 2。 String as[] = mContext.getResources().getStringArray(2131165191); 转换为16进制7F070007 查找R文件 public static final class array { public static final int add_rule_list_array=0x7f070007; public static final int auto_sms_respond_to_contacts=0x7f070003; public static final int auto_sms_respond_to_contacts_desc=0x7f070004; public static final int auto_sms_respond_to_event=0x7f070002; public static final int frequency_array=0x7f070009; public static final int override_actions_list_array=0x7f070008; public static final int screen_timeout_entries=0x7f070000; public static final int screen_timeout_values=0x7f070001; public static final int voice_announce_items=0x7f070006; public static final int volume_levels=0x7f070005; } 替换为String as[] = mContext.getResources().getStringArray(R.array.add_rule_list_array); 3. 对于这种 private class _cls4 implements android.content.DialogInterface.OnClickListener{ public void onClick(DialogInterface dialoginterface, int i) { dialoginterface.dismiss(); LandingPageActivity landingpageactivity = LandingPageActivity.this; String s = displayListItems[i]; String as[] = listItems; int j = landingpageactivity.getListPosition(s, as); mAddRuleButton.setClickable(true); handleAddRuleDialogSelection(j); } final LandingPageActivity this$0; final String val$displayListItems[]; final String val$listItems[]; _cls4() { this$0 = LandingPageActivity.this; displayListItems = as; listItems = as1; super(); } } 搜索可以看到这个出现在这句话中 _cls4 _lcls4 = new _cls4(); android.app.AlertDialog.Builder builder3 = builder.setItems(displayListItems, _lcls4); 所以很容易想到转换后正常的语句是builder.setItems(displayListItems, new android.content.DialogInterface.OnClickListener(){ ... }); 4. boolean flag = requestWindowFeature(1); 对于这种定义了, 但是后文没有使用的,全部可以直接删除掉变为requestWindowFeature(1); 同时很容易也可以知道里面的参数是Window.FEATURE_NO_TITLE, 通过源码可以验证 public static final int FEATURE_NO_TITLE = 1; 5. 反编译后的文件经常会出现这样的代码 KeyValues keyvalues = new KeyValues(null); clickedRowInfo = keyvalues; KeyValues keyvalues1 = clickedRowInfo; long l = bundle.getLong("_id"); keyvalues1._id = l; KeyValues keyvalues2 = clickedRowInfo; String s = bundle.getString("Name"); keyvalues2.name = s; KeyValues keyvalues3 = clickedRowInfo; String s1 = bundle.getString("Key"); keyvalues3.key = s1; KeyValues keyvalues4 = clickedRowInfo; int i = bundle.getInt("Act"); keyvalues4.active = i; KeyValues keyvalues5 = clickedRowInfo; int j = bundle.getInt("Ena"); keyvalues5.enabled = j; KeyValues keyvalues6 = clickedRowInfo; int k = bundle.getInt("Manual"); keyvalues6.ruleType = k; return; 这种代码很容易的可以看出来可以直接转换为 KeyValues keyValues = new KeyValues(); clickedRowInfo._id = bundle.getLong("_id"); clickedRowInfo.name = bundle.getString("Name"); clickedRowInfo.key = bundle.getString("Key"); clickedRowInfo.active = bundle.getInt("Act"); clickedRowInfo.enabled = bundle.getInt("Ena"); clickedRowInfo.ruleType = bundle.getInt("Manual"); ----------------------------------------------------------------edited @ 201207271557---------------------------------------------------------------------- 6。 进一步看第三点 private class _cls3 implements android.content.DialogInterface.OnClickListener { public void onClick(DialogInterface dialoginterface, int i) { dialoginterface.cancel(); LandingPageActivity landingpageactivity = LandingPageActivity.this; Context context = mContext; String s = mContext.getString(2131427353); ProgressDialog progressdialog = ProgressDialog.show(context, "", s, true); ProgressDialog progressdialog1 = landingpageactivity.mDeleteRuleProgressDialog = progressdialog; Context context1 = mContext; long l = clickedRowInfo._id; if(RulePersistence.isRuleActive(context1, l)) { boolean flag = mIsRuleMarkedForDeletion = 1; Context context2 = mContext; Intent intent = new Intent(context2, com/motorola/contextual/smartrules/service/SmartRulesService); String s1 = Constants.MM_RULE_KEY; String s2 = clickedRowInfo.key; Intent intent1 = intent.putExtra(s1, s2); String s3 = Constants.MM_RULE_STATUS; Intent intent2 = intent.putExtra(s3, "false"); android.content.ComponentName componentname = mContext.startService(intent); return; } else { boolean flag1 = mIsRuleMarkedForDeletion = 0; Context context3 = mContext; long l1 = clickedRowInfo._id; String s4 = clickedRowInfo.name; String s5 = clickedRowInfo.key; int j = RulePersistence.deleteRule(context3, l1, s4, s5, true); RulePersistence.startConditionBuilderService(mContext); return; } } final LandingPageActivity this$0; _cls3() { this$0 = LandingPageActivity.this; super(); } } private class _cls2 implements android.content.DialogInterface.OnClickListener { public void onClick(DialogInterface dialoginterface, int i) { dialoginterface.cancel(); } final LandingPageActivity this$0; _cls2() { this$0 = LandingPageActivity.this; super(); } } 容易得知_cls2是点击取消按钮的操作, 根据经验很容易得知一般点击取消按钮里面的代码只会有dialog.calel(); 所以可以知道 final LandingPageActivity this$0; _cls2() { this$0 = LandingPageActivity.this; super(); } 这段代码是可以直接去掉的,是反编译过程中产生的中间代码, 同理可以把点击positiveButton的代码中对应的这一块也去掉 7. 遇到setTitleColor(-65536) 可以随便设置一个颜色比如设为Color.Black 然后可以看到black的值是 Constant Value: -16777216 (0xff000000) 而White的值是-1 所以很容易就可以知道源代码是setTitleColor(Color.White) 8. 对于类似如下代码 private static final int ZERO = 0; private static final int ONE = 1; private static final int TWO = 2; private static final int THREE = -1; 反编译后 private static final int ONE = 1; private static final int THREE = 255; private static final int TWO = 2; private static final int ZERO;=======================================Added @ 2012-08-16 21:34==================== 9 对于switch语句,反编译前 @Override public boolean onTouchEvent(MotionEvent event) { switch (event.getAction()) { case MotionEvent.ACTION_POINTER_1_DOWN: System.out.println("Action_Pointer_1_down"); break; case MotionEvent.ACTION_POINTER_2_DOWN: System.out.println("ACTION_POINTER_2_DOWN"); break; case MotionEvent.ACTION_POINTER_1_UP: System.out.println("ACTION_POINTER_1_UP"); break; case MotionEvent.ACTION_POINTER_2_UP: System.out.println("ACTION_POINTER_2_UP"); break; default: System.out.println("default"); break; } return super.onTouchEvent(event); } 反编译后 public boolean onTouchEvent(MotionEvent motionevent) { motionevent.getAction(); JVM INSTR lookupswitch 4: default 48 // 5: 62 // 6: 84 // 261: 73 // 262: 95; goto _L1 _L2 _L3 _L4 _L5 _L1: System.out.println("default"); _L7: return super.onTouchEvent(motionevent); _L2: System.out.println("Action_Pointer_1_down"); continue; /* Loop/switch isn't completed */ _L4: System.out.println("ACTION_POINTER_2_DOWN"); continue; /* Loop/switch isn't completed */ _L3: System.out.println("ACTION_POINTER_1_UP"); continue; /* Loop/switch isn't completed */ _L5: System.out.println("ACTION_POINTER_2_UP"); if(true) goto _L7; else goto _L6 _L6: } 同时 public static final int ACTION_POINTER_1_DOWN = 5; public static final int ACTION_POINTER_2_DOWN = 261; public static final int ACTION_POINTER_UP = 6; public static final int ACTION_POINTER_2_UP = 262; 更多 上一篇:尽人事,听天命。 下一篇:ADB server didn't ACK 解决方法 顶 0 踩 0 查看评论 * 以上用户言论只代表其个人观点,不代表CSDN网站的观点或立场 核心技术类目 全部主题 Java VPN Android iOS ERP IE10 Eclipse CRM JavaScript Ubuntu NFC WAP jQuery 数据库 BI HTML5 Spring Apache Hadoop .NET API HTML SDK IIS Fedora XML LBS Unity Splashtop UML components Windows Mobile Rails QEMU KDE Cassandra CloudStack FTC coremail OPhone CouchBase 云计算 iOS6 Rackspace Web App SpringSide Maemo Compuware 大数据 aptech Perl Tornado Ruby Hibernate ThinkPHP Spark HBase Pure Solr Angular Cloud Foundry Redis Scala Django Bootstrap 个人资料 ScorpioNeal 访问:32945次 积分:680分 排名:千里之外 原创:31篇 转载:18篇 译文:0篇 评论:11条 文章搜索 文章分类 Android App(16) Android Game(0) Java(4) Thinking(6) Others(17) Html5(2) C(4) Ubuntu(1) Web(2) 文章存档 2013年02月(1)2012年12月(7)2012年11月(1)2012年09月(1)2012年08月(2)2012年07月(5)2012年06月(1)2012年05月(7)2012年04月(4)2012年03月(5)2012年02月(5)2012年01月(7)2011年12月(3) 阅读排行 [INSTALL_PARSE_FAILED_NO_CERTIFICATES]解决方法(7802) HttpClient 检测上传进度(1503) 对AndroidApp反编译后的代码的解析(1451) ubuntu 11.10添加桌面快捷方式(1423) 使用Facebook开放平台可能遇到的问题(1385) 配置cygwin的环境变量时出现的问题(1292) 技术贴~~强力推荐,哈哈(1260) Sublime + ZenCoding 快速编写HTML(1201) 如何禁用Android中Manage application中的Clear Data(1172) 一个老程序员的十年回顾(1152) 评论排行 Android 代码 安装SD卡内的APK(3) [INSTALL_PARSE_FAILED_NO_CERTIFICATES]解决方法(2) 一个老程序员的十年回顾(2) Opencv2.4.0 + VS2010 + win32位配置指南(1) Java反射(1) HttpClient 检测上传进度(1) 如何禁用Android中Manage application中的Clear Data(1) 程序与生活:忘记目标你才能达到目标(0) Eclipse小插件推荐(0) Sublime Text 2 – 性感无比的代码编辑器!程序员必备神器!跨平台支持Win/Mac/Linux(0) 推荐文章 最新评论 [INSTALL_PARSE_FAILED_NO_CERTIFICATES]解决方法 qws28122: 同样在linux下也是这个问题。 [INSTALL_PARSE_FAILED_NO_CERTIFICATES]解决方法 hyp712: 哥们,强帖留名!果断解决! 如何禁用Android中Manage application中的Clear Data q13073451412: 有点意思~~ Java反射 binbin001133: 谢谢讲解,有点懂了 一个老程序员的十年回顾 zmyz2010: 叼。。。颇有感触 Android 代码 安装SD卡内的APK myhui123: 那个apk的路径没有啊 Android 代码 安装SD卡内的APK ScorpioNeal: 你既然都可以获得一个列表,就意味着你可以获得列表中的每一个apk的路径了, 是把...@myhui1... Android 代码 安装SD卡内的APK myhui123: 这种方法是可以,只能安装指定位置的apk,如果想实现在列表中随便点击一个apk就能安装, 应该怎么处... HttpClient 检测上传进度 : 请问,我按照你的方法做了 可是现在上传文件调用的是public void write(int on... Opencv2.4.0 + VS2010 + win32位配置指南 zhengzhihust: 我已经成功的配置了,谢谢楼主!