我在调试通过apktool提取的应用程序时遇到困难:How to view debug messages on Android? 我试图放置可调试标志并重建apk,但无济于事-当我在Android上运行应用程序时,无法查看日志。只能在有根电话或通过USB调试才能读取日志。我现在只有一部手机,我想知道是否可以使用稍有不同的Log类实现来重建应用程序,以便将日志输出到文件中,以便我可以读取它。请指出如何通过编辑smali文件(我认为是)来完成此操作。
编辑:我正在考虑编写类似于https://stackoverflow.com/a/4915218/10957553的内容,并包含它而不是android.util.Log。但是,就我而言,一系列的动作是什么?我想编译代码并将其放在apktool包含它的位置?另外在apktool应用程序反编译中我还需要更改什么?
Edit2:啊哈。图书馆的路径就在这里吗?使用是写在smali文件中。因此,我必须获取将日志写入文件的库,然后将其放置在某处,并用我的库的路径替换所有出现的android / util / Log。请给我一点指导。在哪里可以找到这样的图书馆并在哪里存储?
smali/com/google/android/gms/ads/identifier/AdvertisingIdClient.smali:495: invoke-static {v1, v2, v0}, Landroid/util/Log;->i(Ljava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;)I
smali/com/google/android/gms/ads/identifier/AdvertisingIdClient.smali:651: invoke-static {v1, v2, v0}, Landroid/util/Log;->i(Ljava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;)I
smali/com/anda/otgdisk/y.smali:140: invoke-static {v4, v0}, Landroid/util/Log;->v(Ljava/lang/String;Ljava/lang/String;)I
smali/com/anda/otgdisk/al.smali:61: invoke-static {v2, v0}, Landroid/util/Log;->v(Ljava/lang/String;Ljava/lang/String;)I
smali/com/anda/otgdisk/u.smali:114: invoke-static {v0, v1}, Landroid/util/Log;->v(Ljava/lang/String;Ljava/lang/String;)I
smali/com/anda/otgdisk/aj.smali:38: invoke-static {v0, v1}, Landroid/util/Log;->v(Ljava/lang/String;Ljava/lang/String;)I
smali/com/anda/otgdisk/aj.smali:155: invoke-static {v4, v5}, Landroid/util/Log;->v(Ljava/lang/String;Ljava/lang/String;)I
smali/com/anda/otgdisk/t.smali:1095: invoke-static {v0, v1}, Landroid/util/Log;->d(Ljava/lang/String;Ljava/lang/String;)I
smali/com/anda/otgdisk/t.smali:1129: invoke-static {v0, v1}, Landroid/util/Log;->e(Ljava/lang/String;Ljava/lang/String;)I
smali/com/anda/otgdisk/t.smali:1456: invoke-static {v0, v4}, Landroid/util/Log;->v(Ljava/lang/String;Ljava/lang/String;)I
smali/com/anda/otgdisk/t.smali:2058: invoke-static {v2, v3}, Landroid/util/Log;->v(Ljava/lang/String;Ljava/lang/String;)I
smali/com/anda/otgdisk/t.smali:2208: invoke-static {v3, v5}, Landroid/util/Log;->v(Ljava/lang/String;Ljava/lang/String;)I
smali/com/anda/otgdisk/t.smali:2579: invoke-static {v2, v3}, Landroid/util/Log;->v(Ljava/lang/String;Ljava/lang/String;)I
smali/com/anda/otgdisk/t.smali:2727: invoke-static {v4, v5}, Landroid/util/Log;->v(Ljava/lang/String;Ljava/lang/String;)I
smali/com/anda/otgdisk/t.smali:3438: invoke-static {v2, v1}, Landroid/util/Log;->v(Ljava/lang/String;Ljava/lang/String;)I
smali/com/anda/otgdisk/t.smali:3460: invoke-static {v1, v2}, Landroid/util/Log;->v(Ljava/lang/String;Ljava/lang/String;)I
smali/com/anda/otgdisk/an.smali:586: invoke-static {v0, v1}, Landroid/util/Log;->v(Ljava/lang/String;Ljava/lang/String;)I
smali/com/anda/otgdisk/z.smali:458: invoke-static {v0, v3}, Landroid/util/Log;->v(Ljava/lang/String;Ljava/lang/String;)I
smali/com/anda/otgdisk/aq.smali:454: invoke-static {v0, v1}, Landroid/util/Log;->d(Ljava/lang/String;Ljava/lang/String;)I
smali/com/anda/otgdisk/aq.smali:854: invoke-static {v0, v1}, Landroid/util/Log;->d(Ljava/lang/String;Ljava/lang/String;)I