apktool 打包解包apk的总结
1) 不需要另外下载 baksmali-2.1.2.jar, apktool.jar 好像都包含了。
apktool d zhanqi.xxx.apk -o zhanqi
2) smalidea-0.03.zip 的 Android Studio插件装上之后,就可以调试 1) 生成的 smali 文件了
https://github.com/JesusFreke/smali/wiki/smalidea
- Manually disassemble an application using baksmali into a "src" subdirectory of a new project directory, e.g.
baksmali myapp.apk -o ~/projects/myapp/src
- In IDEA, import a new project, and select the project directory. e.g.
~/projects/myapp
- Use the "Create project from existing sources" option when importing the project
- Once the project has been created, right click on the src directory and select "Mark Directory As->Sources Root"
- Open the project settings and select/create an appropriate JDK
- Install/start the application on the device
- Run ddms, and select the application's process
- In IDEA, Create a new "Remote" debug configuration (Run->Edit Configurations), and change the debug port to 8700
- Run->Debug
- The application should pause if/when the breakpoint is hit, at which point you can single step, add watches, etc.
3)重新打包decomplie出来的smali
D:\proj\android>apktool b zhanqi I: Using Apktool 2.1.1 I: Checking whether sources has changed... I: Smaling smali folder into classes.dex... I: Checking whether resources has changed... I: Building apk file... I: Copying unknown files/dir...
4)重新签名打包的apk 文件
a) 下载sign.jar 和 signapk.jar https://github.com/appium/sign
b) 会生成 .s.apk 文件
D:\proj\android>java -jar sign.jar .\zhanqi\dist\zhanqi_v2_6_8.apk
D:\proj\android>adb install .\zhanqi\dist\zhanqi_v2_6_8.s.apk
5)启动app时就截住断点的方法
.method protected onCreate(Landroid/os/Bundle;)V .locals 4 .prologue .line 66 invoke-static {}, Landroid/os/Debug;->waitForDebugger()V
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 10年+ .NET Coder 心语,封装的思维:从隐藏、稳定开始理解其本质意义
· .NET Core 中如何实现缓存的预热?
· 从 HTTP 原因短语缺失研究 HTTP/2 和 HTTP/3 的设计差异
· AI与.NET技术实操系列:向量存储与相似性搜索在 .NET 中的实现
· 基于Microsoft.Extensions.AI核心库实现RAG应用
· 阿里巴巴 QwQ-32B真的超越了 DeepSeek R-1吗?
· 【译】Visual Studio 中新的强大生产力特性
· 10年+ .NET Coder 心语 ── 封装的思维:从隐藏、稳定开始理解其本质意义
· 【设计模式】告别冗长if-else语句:使用策略模式优化代码结构
· 字符编码:从基础到乱码解决
2013-05-29 没有源代码情况下,对java web application的调试