menu LittleJake's Blog
color_lens
avatar
Jake Liu
Never Settle
creative commons by-nc-sa
hit
Category
keyboard_arrow_down

© 2024 LittleJake's Blog.

萌ICP备20223020号

记录一次简单的apk逆向

前言

最近在垃圾店捡到了几个手写板,需要挂🐟卖钱。无奈,应用的功能需要强制登陆后才能绑定手写板,故由此记录。

以前没操作过逆向apk修改代码的,仅仅是有部分exe逆向以及制作内存修改器的经验。

本次出场的app没有进行加固,是不幸中的万幸。

原绑定界面

操作

  1. 登录https://apktool.org/下载apktool,需要提前安装JRE

  2. 运行解包apktool_2.9.3.jar d xxx.apk,得到apk内数据文件

decode

  1. 由于本次逆向较为简单,直接打开Visual Code Studio进行搜索smali代码,追到Login代码片段:
 .method public static isLogin()Z
    .locals 1

    .line 1
    invoke-static {}, Lcom/xxx/login/api/LoginHelper;->getToken()Ljava/lang/String;

    .line 2
    .line 3
    .line 4
    move-result-object v0

    .line 5
    invoke-static {v0}, Landroid/text/TextUtils;->isEmpty(Ljava/lang/CharSequence;)Z

    .line 6
    .line 7
    .line 8
    move-result v0

    .line 9
    xor-int/lit8 v0, v0, 0x1

    .line 10
    .line 11
    return v0
 .end method

根据猜测,判断xor-int/lit8 v0, v0, 0x1极有可能是判断登录的Boolean,通过异或的方式返回1则为登录。

片段修改为xor-int/lit8 v0, v0, 0x0即可。

mod

  1. 使用apktool重新打包apk:apktool_2.9.3.jar b xxx -o xxx_mod.apk

  2. 在手机上使用MT管理器对apk包进行签名。(因为测试,所以随便找个工具签名)

unsign

sign

  1. 测试成功。

s

s

后记

这次也就无脑的碰巧搞定逆向,做个简单的记录方便以后记得这个东西,哈哈🤣。

Buy me a beer
Jake Liu
Never Settle

Title: 记录一次简单的apk逆向

Author: Jake Liu

Origin:

Creative Commons License

This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International (CC BY-NC-SA 4.0) For any re-post you must give appropriate credit.

文章遵循CC许可 署名-非商业性使用-相同方式共享 4.0 国际 (CC BY-NC-SA 4.0) 转载请注明出处

Tag:apktool, mt管理器, apk, 逆向

评论区

Add a new comment.

Theme