win10最新版apktool 反编译

apktool_2.6.0.jar 改成apktool.jar 和apktool.bat放在同一个文件夹,并将此文件夹加入系统变量Path(D:\SoftWare\apktool)

apktool.bat:

@echo off
setlocal
set BASENAME=apktool_
chcp 65001 2>nul >nul

set java_exe=java.exe

if defined JAVA_HOME (
set java_exe="%JAVA_HOME%\bin\java.exe"
)

rem Find the highest version .jar available in the same directory as the script
setlocal EnableDelayedExpansion
pushd "%~dp0"
if exist apktool.jar (
    set BASENAME=apktool
    goto skipversioned
)
set max=0
for /f "tokens=1* delims=-_.0" %%A in ('dir /b /a-d %BASENAME%*.jar') do if %%~B gtr !max! set max=%%~nB
:skipversioned
popd
setlocal DisableDelayedExpansion

rem Find out if the commandline is a parameterless .jar or directory, for fast unpack/repack
if "%~1"=="" goto load
if not "%~2"=="" goto load
set ATTR=%~a1
if "%ATTR:~0,1%"=="d" (
    rem Directory, rebuild
    set fastCommand=b
)
if "%ATTR:~0,1%"=="-" if "%~x1"==".apk" (
    rem APK file, unpack
    set fastCommand=d
)

:load
%java_exe% -jar -Duser.language=en -Dfile.encoding=UTF8 "%~dp0%BASENAME%%max%.jar" %fastCommand% %*

rem Pause when ran non interactively
for /f "tokens=2" %%# in ("%cmdcmdline%") do if /i "%%#" equ "/c" pause

  

 

C:\Users\Administrator>apktool d D:\SoftWare\apktool\xb.apk -o D:\SoftWare\apktool\baz2
I: Using Apktool 2.6.0 on xb.apk
I: Loading resource table...
I: Decoding AndroidManifest.xml with resources...
I: Loading resource table from file: C:\Users\Administrator\AppData\Local\apktool\framework\1.apk
I: Regular manifest package...
I: Decoding file-resources...
I: Decoding values */* XMLs...
I: Baksmaling classes.dex...
I: Copying assets and libs...
I: Copying unknown files...
I: Copying original files...
I: Copying META-INF/services directory

C:\Users\Administrator>

  

 

 
https://ibotpeaches.github.io/Apktool/install/
https://ibotpeaches.github.io/Apktool/#

  

  

 

 

Apktool 下载、安装和使用

win10最新版apktool 反编译 给我一支白沙 0.1152019.11.09 23:39:21字数 329阅读 5,800

Apktool

简介

  1. 用于反编译Android apk,可以将应用中的资源提取出来,也可以在修改资源文件后重新打包。
  2. smali 调试

环境要求

  1. 安装java 1.8 以上
  2. 命令行运行 java -version 返回版本大于1.8
  3. 如果没有,请安装java 1.8

下载与安装

  1. 下载apktool_x.x.x.jar到本地 官网下载或者 镜像下载

  2. 重命名下载的apktool_x.x.x.jar,改名为apktool.jar

  3. 下载脚本并配置

    1. Windows
      1. 下载Windows 包装程序脚本(右键单击,将链接另存为apktool.bat)
      2. 两个文件放在同一目录,然后将该目录添加到您的环境变量系统PATH变量中
    2. Linux
      1. 下载Linux 包装器脚本(右键单击,将链接另存为apktool)
      2. 将两个文件(apktool.jar&apktool)移动到/usr/local/bin
      3. 确保两个文件都可执行(chmod +x)
    3. Mac OS
      1. 下载Mac 包装器脚本(右键单击,将链接另存为apktool)
      2. 将两个文件(apktool.jar&apktool)移动到/usr/local/bin
      3. 确保两个文件都可执行(chmod +x)
  4. 命令行中输入 apktool 验证

使用

  • 反编译

使用 d 或者 decode 命令

$ apktool d bar.apk
$ apktool decode bar.apk
// 效果一样 反编译 bar.apk 并将其解压到 bar 目录

$ apktool d bar.apk o baz 
反编译 bar.apk 并将其解压到 baz 目录

  • 重新打包

使用 b 或 build

$ apktool b bar -o new_bar.apk
// 将 bar 目录的资源打包成 new_bar.apk

重新打包生成的 apk 需要签名才能安装

参考

Apktool

 

https://www.jianshu.com/p/919a966843c4

 

##############################################################################################################

 

Install Instructions

Quick Check

  1. Is at least Java 1.8 installed?
  2. Does executing java -version on command line / command prompt return 1.8 or greater?
  3. If not, please install Java 8+ and make it the default. (Java 7 will also work at this time)

Installation for Apktool

  • Windows:
    1. Download Windows wrapper script (Right click, Save Link As apktool.bat)
    2. Download apktool-2 (find newest here)
    3. Rename downloaded jar to apktool.jar
    4. Move both files (apktool.jar & apktool.bat) to your Windows directory (Usually C://Windows)
    5. If you do not have access to C://Windows, you may place the two files anywhere then add that directory to your Environment Variables System PATH variable.
    6. Try running apktool via command prompt
  • Linux:
    1. Download Linux wrapper script (Right click, Save Link As apktool)
    2. Download apktool-2 (find newest here)
    3. Rename downloaded jar to apktool.jar
    4. Move both files (apktool.jar & apktool) to /usr/local/bin (root needed)
    5. Make sure both files are executable (chmod +x)
    6. Try running apktool via cli
  • macOS:
    1. Download Mac wrapper script (Right click, Save Link As apktool)
    2. Download apktool-2 (find newest here)
    3. Rename downloaded jar to apktool.jar
    4. Move both files (apktool.jar & apktool) to /usr/local/bin (root needed)
    5. Make sure both files are executable (chmod +x)
    6. Try running apktool via cli

    Or you can install apktool via Homebrew:

    1. Install Homebrew as described in this page
    2. Execute command brew install apktool in terminal (no root needed). The latest version will be installed in /usr/local/Cellar/apktool/[version]/ and linked to /usr/local/bin/apktool.
    3. Try running apktool via cli

Note - Wrapper scripts are not needed, but helpful so you don’t have to type java -jar apktool.jar over and over.

 

https://ibotpeaches.github.io/Apktool/install/
上一篇:[Python]NEXT方法


下一篇:[iOS开发]知乎日报第一周总结