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 下載、安裝和使用

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/
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章