zoukankan      html  css  js  c++  java
  • APK反编译后添加日志

    一、反编译

    参考前一篇文章

    二、添加寄存器(locals)

    因为要添加日志,我们一般需要用一个变量来存储TAG,所以需要增加一个寄存器

    如:

    1 # virtual methods
    2 .method public onReceive(Landroid/content/Context;Landroid/content/Intent;)V
    3     .locals 4
    4 
    5     const/16 v3, 0x23
    6 
    7     invoke-virtual {p2}, Landroid/content/Intent;->getAction()Ljava/lang/String;
    8 
    9     move-result-object v1

    这里的第三行代码就是。

    三、添加日志输出代码

    在需要添加日志的地方添加代码如下:

    const-string v4, "TAG"
    
    invoke-static {v4, v1}, Landroid/util/Log;->e(Ljava/lang/String;Ljava/lang/String;)I

    v4是我们自己定义的TAG变量,v1是需要输出的变量

    四、在AndroidManifest.xml文件中打开设试开关

    如:

    <application android:debuggable="true"

    四、编译为debug模式(用debug.keystore签名)

    然后就可以在AS中看到日志了。

  • 相关阅读:
    iframe跨页面调用函数
    $.extend()
    tab标签 插件 by 腾讯 jianminlu
    click事件多次触发 jQuery
    vertical-align
    display:inline-block
    在父页面访问iframe的东西
    2019牛客多校第三场
    2019HDU多校第一场
    2019江苏省赛
  • 原文地址:https://www.cnblogs.com/lurenjiashuo/p/android-apk-decompile-and-add-log.html
Copyright © 2011-2022 走看看