SkillAgentSearch skills...

APKEditor

Powerful android apk editor - aapt/aapt2 independent

Install / Use

/learn @REAndroid/APKEditor
About this skill

Quality Score

0/100

Supported Platforms

Universal

README

<details><summary> 👈 <code><i> Click arrows to expand/collapse details on this page </i></code></summary></details>

APKEditor

Powerful android apk resources editor

This tool uses ARSCLib to edit any apk resources and has six main features

<details><summary><code>java -jar APKEditor.jar <b>-h</b></code></summary>
$ java -jar APKEditor.jar -h
APKEditor - x.x.x
https://github.com/REAndroid/APKEditor
Android binary resource files editor
Commands:
  d | decode      Decodes android resources binary to readable json/xml/raw.
  b | build       Builds android binary from json/xml/raw.
  m | merge       Merges split apk files from directory or compressed apk files
                  like XAPK, APKM, APKS ...
  x | refactor    Refactors obfuscated resource names
  p | protect     Protects/Obfuscates apk resource files. Using unique
                  obfuscation techniques.
  info            Prints information of apk.
Other options:
  -h | -help      Displays this help and exit
  -v | -version   Displays version information and exit

To get help about each command run with:
<command> -h

</details>

1- Decompile

  • Decompiles resources of apk to human readable json string.
  • Decompiles resources of apk to XML source code (for un-obfuscated apk only). Use -t xml
<details> <summary><code>java -jar APKEditor.jar <b>d</b> -i path/to/your-file.apk</code></summary>
$ java -jar APKEditor.jar d -i test.apk -o test_json
00.000 I: [DECOMPILE] Using: APKEditor version 1.4.3, ARSCLib version 1.3.6
             -t = xml      
      -load-dex = 3        
       -dex-lib = jf       
             -i = test.apk 
             -o = test_json
 _________________________ 
00.006 I: [DECOMPILE] Loading ...
00.101 I: [DECOMPILE] Decompiling to xml ...
00.264 I: [DECOMPILE] Initializing android framework ...
00.264 I: [DECOMPILE] Loading android framework for version: 34
00.304 I: [DECOMPILE] Initialized framework: android-34 (14)
00.320 I: [DECOMPILE] [SANITIZE]: Sanitizing paths ...
00.341 I: [DECOMPILE] Validating resource names ...
00.396 I: [DECOMPILE] All resource names are valid
00.396 I: [DECOMPILE] Decode: archive-info.json
00.398 I: [DECOMPILE] Decode: uncompressed-files.json
00.412 I: [DECOMPILE] Decoding: AndroidManifest.xml
00.450 I: [DECOMPILE] public.xml: com.test.name -> package_1
00.508 I: [DECOMPILE] Res files: resources
02.483 I: [DECOMPILE] Baksmali: classes.dex
05.041 I: [DECOMPILE] Baksmali: classes2.dex
12.643 I: [DECOMPILE] Extracting root files ...
12.766 I: [DECOMPILE] Dumping signatures ...
12.766 I: [DECOMPILE] Saved to: test_json
<details> <summary><code>more info</code></summary>
Decodes android resources binary to readable json/xml/raw.
Usage:
  d [Options, flags]
Options:
  -framework            Path of framework file (can be multiple).
  -framework-version    Preferred framework version number
  -i                    Input path.
  -load-dex             Number of dex files to load at a time.
                        If the apk dex files count greater than this value,
                        then the decoder loads one dex at a time.
                          *Applies only when -dex-lib set to internal.
                          *Default = 3
                          *See<Notes> below.
  -o                    Output path. Optional, if not provided then a new file
                        will be generated on same directory as input
  -remove-annotation    [Baksmali] Type name of annotation to remove from dex
                          e.g: -remove-annotation Lkotlin/Metadata;
                          *Can be multiple.
  -res-dir              Sets resource files root dir name. e.g. for obfuscation
                        to move files from 'res/*' to 'r/*' or vice versa.
  -sig                  Signatures directory path.
  -t                    Decode types:
                        [xml, json, raw, sig]
  -dex-lib              Dex library to use:
                         1) internal : Use internal library, supports dex
                        versions up to 042.
                         2) jf : Use library by JesusFreke/smali, supports dex
                        versions 035 and below.
                          *Default = internal
                          *See <Notes> below.
                        [internal, jf]
  -comment-level        [Baksmali] Sets the comment level.
                         1) off : No comment will be printed.
                         2) basic : Prints basic and resource id comments.
                         3) detail : Including <basic>, Prints class & method
                        relation comments.
                         4) detail2 : Including <detail>, Prints encoded hex
                        strings with literal as comment.
                         5) full : Prints all comments.
                         **Default = detail
                        [off, basic, detail, detail2, full]
Flags:
  -dex                  Copy raw dex files / skip smali.
  -dex-markers          Dumps dex markers (applies only when smali mode).
  -dex-profile          Decodes dex profile binary files under assets/dexopt to
                        readable json files.
  -f                    Force delete output path.
  -h | -help | --help   Displays this help and exit.
  -keep-res-path        Keeps original res/* file paths:
                          *Applies only when decoding to xml
                          *All res/* files will be placed on dir <res-files>
                          *The relative paths will be linked to values/*xml
  -no-cache             Do not create dex .cache files.
  -no-dex-debug         Drops all debug info from smali/dex.
  -smali-registers      [Baksmali] Use ".registers" directive instead of the
                        default ".locals".
  -split-json           Splits resources.arsc into multiple parts as per type
                        entries (use this for large files)
  -vrd                  Validate resources dir name
                        (eg. if a drawable resource file path is 'res/abc.png'
                        then it will be moved to 'res/drawable/abc.png)'
Examples:
  1)  [Basic]
  java -jar APKEditor.jar d -i path/input.apk
  2)  [Specify output]
  java -jar APKEditor.jar d -i path/input.apk -o path/output.apk
  3)  [Specify decode type]
  java -jar APKEditor.jar d -t xml -i path/input.apk
  4)  [Specify framework file(s)]
  java -jar APKEditor.jar d -i path/input.apk -framework framework-res.apk
  -framework platforms/android-32/android.jar
  5)  [Decode apk signature block]
  java -jar APKEditor.jar d -t sig -i path/input.apk -sig path/signatures_dir
Notes:
  1)  [internal] Dex builder:
  * Fully supports dex files up to 042.
  * Highest dex file compression.
  * Builds with similar dex-section order as r8/dx.
  * Convenient dex markers editing, see file smali/classes/dex-file.json
  * Additional helpful smali comments: e.g class/method hierarchy.
  * Supports whitespaces on class simple name as introduced on dex 040+
  2)  [-load-dex] To print correct class/method hierarchy, it is necessary to
  load all dex files at once. This may result high memory consumption and
  could fail with "OutOfMemoryError" thus you are required to limit the
  number of dex files to load at a time. You can overcome this problem with
  -Xmx memory arg e.g java -Xmx8g -jar APKEditor.jar ...
</details> </details>

2- Build

Builds back to apk from decompiled json/XML files

<details> <summary><code>java -jar APKEditor.jar <b>b</b> -i path/to/decompiled-directory</code></summary>
$ java -jar APKEditor.jar b -i test_json -o test_edited.apk
00.000 I: [BUILD] Using: APKEditor version 1.4.3, ARSCLib version 1.3.6
            -t = xml            
      -dex-lib = jf             
            -i = test_json      
            -o = test_edited.apk
 ______________________________ 
00.005 I: [BUILD] Scanning XML directory ...
00.024 I: [BUILD] Scanning: test_json
00.168 I: [BUILD] Initializing android framework ...
00.168 I: [BUILD] Loading android framework for version: 34
00.254 I: [BUILD] Initialized framework: android-34 (14)
00.254 I: [BUILD] Set main package id from manifest: @mipmap/ic_launcher
00.256 I: [BUILD] Main package id initialized: id = 0x7f, from: @mipmap/ic_launcher
00.256 I: [BUILD] Encoding attrs ...
00.307 I: [BUILD] Encoding values ...
00.560 I: [BUILD] Scan: package_1/res
00.661 I: [BUILD] Scanned 5718 files: package_1/res
00.852 I: [BUILD] Add manifest: AndroidManifest.xml
00.852 I: [BUILD] Building dex ...
00.960 I: [BUILD] (1/2) Cached: classes.dex
00.973 I: [BUILD] (2/2) Cached: classes2.dex
01.033 I: [BUILD] Scanning root directory ...
01.036 I: [BUILD] Restoring original file paths ...
01.078 I: [BUILD] Loading signatures ...
01.082 I: [BUILD] Sorting files ...
01.104 I: [BUILD] Refreshing resource table ...
01.163 I: [BUILD] TableBlock: packages = 1, size = 3067996 bytes
01.164 I: [BUILD] Applying: extractNativeLibs=false
01.164 I: [BUILD] Writing apk...
01.185 I: [BUILD] Buffering compress changed files ...
06.083 I: [BUILD] Writing files: 6637
06.201 I: [BUILD] Writing signature block ...
06.241 I: [BUILD] Saved to: test_edited.apk
<details> <summary><code>more info</code></summary>
Builds android binary from json/xml/raw.
Options:
  -framework            Path of framework file (can be multiple).
  -framework-version    Preferred framework version number
  -i                    Input path.
  -o                    Output path. Optional, if not provided then a new file
                        will be generated on same directory as input
  -res-dir              Sets resource files root dir name. e.g. for obfuscation
                        to move files from 'res/*' to 'r/*' or vice versa.
  -sig                  Signatures directory path.
  -t                    Build types, By default build types determined by

Related Skills

View on GitHub
GitHub Stars2.0k
CategoryDevelopment
Updated3h ago
Forks366

Languages

Java

Security Score

100/100

Audited on Mar 31, 2026

No findings