简体   繁体   English

apptool 使用 AND APKTOOL 反编译

[英]apptool decompile with AND APKTOOL

i want to decompile my recent apk to test is it.我想反编译我最近的 apk 来测试它。

i run the code我运行代码

C:\\Users\\admin\\apktool d OwnApp.apk

but it's getting error with :但出现错误:

Input file (OwnApp.apk) was not found or was not readable.未找到或无法读取输入文件 (OwnApp.apk)。

why am i getting this?为什么我得到这个?

Procedure for decoding .apk files, step-by-step method:解码.apk文件的步骤,分步方法:

Step 1:第1步:

 1). Make a new folder and copy over the .apk file that you want to decode.
 2). Now rename the extension of this .apk file to .zip (e.g. rename from filename.apk to filename.zip) and save it.
 3). Now you can access the classes.dex files, etc. At this stage you are able to see drawables but not xml and java files, so continue.

Step 2:第2步:

 1). Now extract this .zip file in the same folder (or NEW FOLDER).
 2). Download dex2jar and extract it to the same folder (or NEW FOLDER).
 3). Move the classes.dex file into the dex2jar folder.
 4). Now open command prompt and change directory to that folder (or NEW FOLDER). 5). Then write d2j-dex2jar classes.dex (for mac terminal or ubuntu write ./d2j-dex2jar.sh classes.dex) and press enter.
 6). You now have the classes.dex.dex2jar file in the same folder.
 7). Download java decompiler, double click on jd-gui, click on open file, and open classes.dex.dex2jar file from that folder: now you get class files.
 8). Save all of these class files (In jd-gui, click File -> Save All Sources) by src name. At this stage you get the java source but the .xml files are still unreadable, so continue.

Step 3:第 3 步:

 1). Now open another new folder

 2). Put in the .apk file which you want to decode
 3). Download the latest version of apktool AND apktool install window (both can be downloaded from the same link) and place them in the same folder
 4). Open a command window apktool d myApp.apk (where myApp.apk denotes the filename that you want to decode)
 5). now you get a file folder in that folder and can easily read the apk's xml files.

this solutions is extracted from this StactOverflow site Check Here这个解决方案是从这个 StactOverflow 站点中提取的Check Here

you can download all the required libraries from here libraries你可以从这里下载所有需要的

Recompiling apk using apktool for MAC :-使用 apktool for MAC 重新编译 apk :-

Process to DeCompile APK(Android Package):反编译APK的过程(Android包):

  • Open terminal and cd to apk directory打开终端并cd到apk目录
  • type su键入 su
  • apktool d <../../pathToMyAPK> apktool d <../../pathToMyAPK>

Process to ReCompile APK(Android Package):重新编译APK(Android 包)的过程:

  • Open terminal and cd to apk directory打开终端并cd到apk目录
  • type su键入 su
  • apktool b <../../pathToMyAPKFolder> apktool b <../../pathToMyAPKFolder>
  • New apk is generated in pathToMyAPK/dist/NewAPP.apk新的apk在pathToMyAPK/dist/NewAPP.apk中生成

->Now we need to sign the apk to be able to port to device. ->现在我们需要对 apk 进行签名才能移植到设备。

To sign an apk:要签署 apk:

jarsigner -verbose -keystore <path of my-keystore.keystore> <path of apk>  alias_name

对于反编译,不要像 C:\\example:apktool d x.apk 那样通过 CMD 运行 Apktools 只是

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM