记一次成功脱壳修复dex的过程

某票务app,因为有腾讯加固,首先需要脱壳。

1、脱壳,看这里 frida-dexdump 脱壳的正确姿势,得到脱壳的dex文件;

2、用baksmali工具,把 第1步的 dex转换成smali;

2、反编译,用 apktool d ./com.xxx.mobile.apk,反编译,得到加固的apk解压包;

4、替换 smali 文件夹,用 第2步 的 smali 文件夹替换掉 解压包中的 smali;

5、找入口,修复入口;

打开原文件的dex,找到com/wrapper/proxyapplication/WrapperProxyApplication
进去复制入口后到AndroidManifest.xml中替换入口
这是dex中的入口

.field static baseContext:Landroid/content/Context; = null
.field static className:Ljava/lang/String; = "i.app.applicationMain"#这是入口
.field static mLoader:Ljava/lang/ClassLoader; = null
.field static shellApp:Landroid/app/Application; = null
.field static tinkerApp:Ljava/lang/String; = "tinker not support"

 

然后替换到AndroidManifest.xml中替换入口,下面是替换后的

android:theme="@7f090000"
android:label="@7f080000"
android:icon="@7f030000"
android:name="i.app.applicationMain"#这里就是要替换的地方
android:hardwareAccelerated="true"
android:largeHeap="true"
android:supportsRtl="true"
android:resizeableActivity="true">

  

6、第六步,删除腾讯加固的相关文件,一般在assets、lib目录下,文件名如下:

  • tencent_stub
  • tosversion
  • 0OO00l111l1l
  • o0oooOO0ooOo
  • 文件名带有shell的

 

7、用 apktool b com.xxx.mobile 编译apk;

8、用 androidkiller 打开 第7步的 apk,然后用androidkiller编译;

9、安装到模拟器,正常运行,ok。

 

参考(强烈推荐):https://www.52pojie.cn/thread-1453091-1-1.html

 

posted @ 2022-05-06 17:34  IT高薪猎头  阅读(2915)  评论(1编辑  收藏  举报