Skip to content

Commit

Permalink
Updated backend tools
Browse files Browse the repository at this point in the history
  • Loading branch information
GameTheory- committed Mar 11, 2022
1 parent 9c531ef commit 7b718ce
Show file tree
Hide file tree
Showing 16 changed files with 57 additions and 96 deletions.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,4 @@ zipalign/*.jar
tools/tag_list
*.zip
Instructions
apk-utility/
x
35 changes: 0 additions & 35 deletions Changelog.md

This file was deleted.

16 changes: 0 additions & 16 deletions Other_Tools

This file was deleted.

32 changes: 21 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,24 +1,34 @@
## APK Utility v2.3
# Apk Utility v2.4

![image](tools/menu.png)

APK Utility is for decompiling, compiling, zipaligning, and signing apk and jar files. The utility also has the ability to tag your frameworks. This is a very good feature if you want to install frameworks for multiple different devices without having to remove one for the other.
Apk Utility is for decompiling, compiling, zipaligning, and signing android apk and jar files. The utility also has the ability to tag your framework files. This is a very useful feature if you want to install framework files for multiple different devices without having to remove one for the other. Basically a tag is a label to distinguish between multiple devices' framework files.

## Usage
Tested on ubuntu & xubuntu

Tested on ubuntu & manjaro
For 64 bit systems only

1. Make sure to have java 8 installed.
2. Make sure the "apku" file has execute permissions.
1. Make sure to have java 8+ installed on your computer.
2. Make sure the `apku` file is executable.
3. Place all your apk and jar files in the input folder. If zipaligning only, place them in the zipalign folder.
4. Execute the file as follows in a terminal: `./apku`
5. optional - Use the "Add Desktop Shortcut" option for quick access.
5. Optional: Use the "Add Desktop Shortcut" option for quick access.

**To use tags, install your framework files with tags(menu option 2).**

## Framework Files

As you probably know, Android apps utilize code and resources that are found on the Android OS itself. These are known as framework resources and [Apktool](https://ibotpeaches.github.io/Apktool/) relies on these to properly decode and build apks.

Every [Apktool](https://ibotpeaches.github.io/Apktool/) release contains internally the most up to date AOSP framework at the time of the release. This allows you to decode and build most apks without a problem. However, manufacturers add their own framework files in addition to the regular AOSP ones. To use apktool against these manufacturer apks you must first install the manufacturer framework files.

**To install framework files use menu options 1 or 2.**

## Project Page

https://techstop.github.io/apk-utility/

**Resources**
- [apktool](https://ibotpeaches.github.io/Apktool/)
## Resources

**Special Thanks To:**
- Connor Tumbleson
- Ryszard Wiśniewski
- [Apktool](https://ibotpeaches.github.io/Apktool/)
63 changes: 33 additions & 30 deletions apku
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#!/bin/bash

# ===== Variables
VERSION="APK Utility v2.3"
PROJECT_NAME="APK Utility"
PROJECT_NAME="Apk Utility"
VERSION="$PROJECT_NAME v2.4"
DESCRIPTION="An APK & JAR Manipulation Utility"

BASE=$(cd -P -- "$(dirname -- "$0")" && pwd -P)
Expand Down Expand Up @@ -221,7 +221,7 @@ Enter selection: "
fi
done
else
echo -e "${HRED}You do not have any installed tagged frameworks.${NC}"
echo -e "${HRED}You do not have any installed tagged framework files.${NC}"
fi
break
else
Expand Down Expand Up @@ -277,7 +277,7 @@ Enter selection: "
fi
done
else
echo -e "${HRED}You do not have any installed tagged frameworks.${NC}"
echo -e "${HRED}You do not have any installed tagged framework files.${NC}"
fi
break
else
Expand Down Expand Up @@ -309,7 +309,7 @@ Enter selection:"
break
elif (( REPLY > 0 && REPLY <= ${#OPTIONS[@]} )) ; then
clear
"$APKTOOL" b -f "$OPT" -p "$FRAMEWORKS_DIR"
"$APKTOOL" b --use-aapt2 -f "$OPT" -p "$FRAMEWORKS_DIR"
if [ -f "$OPT"/dist/*.apk ] || [ -f "$OPT"/dist/*.jar ]; then
FILE=$(find "$OPT"/dist -type f -name "*.*")
if [ ! -z "$FILE" ]; then
Expand Down Expand Up @@ -355,11 +355,12 @@ CompileSign() {
if ls -d "$DECOMPILED_DIR"/* > /dev/null 2>&1; then
OutputDir
cd "$DECOMPILED_DIR"
echo -e "${GREEN}This option uses the original META-INF and AndroidManifest.xml"
echo "for proper signing. If you made changes to the AndroidManifest.xml"
echo "those changes will be lost. Use option 5 instead to keep those changes."
echo -e "${GREEN}This option uses the original ${HRED}META-INF${NC} ${GREEN}and${NC} ${HRED}AndroidManifest.xml${NC}"
echo -e "${GREEN}for proper signing. If you made changes to the AndroidManifest.xml"
echo "those changes will be lost. Use option 5 instead from the main menu"
echo "to keep those changes."
echo ""
echo -e "Make selection to compile.${NC}"
echo -e "Make selection to compile:${NC}"
PROMPT="
Enter selection:"
OPTIONS=( $(ls -d "$DECOMPILED_DIR"/* | xargs -d '\n' -n 1 basename) )
Expand All @@ -373,7 +374,7 @@ Enter selection:"
break
elif (( REPLY > 0 && REPLY <= ${#OPTIONS[@]} )) ; then
clear
"$APKTOOL" b -f "$OPT" -p "$FRAMEWORKS_DIR"
"$APKTOOL" b --use-aapt2 -f "$OPT" -p "$FRAMEWORKS_DIR"
if [ -d $OPT/dist ]; then
if [ -f $OPT/dist/*.apk ]; then
LS_APK=$("$TOOL_7ZA" l "$INPUT_DIR"/$(basename $OPT).apk)
Expand Down Expand Up @@ -491,9 +492,11 @@ Enter selection:"
break
elif (( REPLY > 0 && REPLY <= ${#OPTIONS[@]} )) ; then
clear
echo -e "${GREEN}Enter a tag with no spaces or special characters."
echo "If your device has multiple frameworks, repeat this"
echo -e "using the same tag. Example tag: ${HRED}${BOLD}HTCm8${NC}"
echo -e "${GREEN}Adding tags(labels) to your framework files allows"
echo "you to work with multiple devices without confusion."
echo "Enter a tag with no spaces or special characters."
echo "If your device has multiple framework files, repeat this"
echo -e "step using the same tag. Example tag: ${HRED}SamsungS22${NC}"
echo ""
read -e -p "Enter a framework tag: " TAG
echo ""
Expand Down Expand Up @@ -725,16 +728,16 @@ until [ "$SELECTION" = "0" ]; do
clear
echo -e "${BLUEBG}${EXPND}${WHITE}${BOLD}$NAME_TXT${NC}"
echo ""
echo " 1 - Decompile"
echo " 2 - Decompile without dex(smali)"
echo " 3 - Decompile with Tag"
echo " 4 - Decompile with Tag without dex(smali)"
echo " 5 - Compile"
echo " 6 - Compile + Sign with original signature"
echo " 7 - Install Framework"
echo " 8 - Install Framework with Tag"
echo " 1 - Install Framework"
echo " 2 - Install Framework + Tag"
echo " 3 - Decompile"
echo " 4 - Decompile without dex files"
echo " 5 - Decompile + Tag"
echo " 6 - Decompile + Tag without dex files"
echo " 7 - Compile"
echo " 8 - Compile + Sign with original signature"
echo " 9 - Zipalign"
echo " 10 - Sign/Change original signature of apk/jar"
echo " 10 - Sign apk or jar with generic signature"
echo " 11 - Manage Tags"
echo " 12 - Check For Update"
echo " 13 - Add Desktop Shortcut"
Expand All @@ -744,14 +747,14 @@ until [ "$SELECTION" = "0" ]; do
read SELECTION
echo ""
case $SELECTION in
1 ) clear ; Decomp ; PRESS_ENTER ;;
2 ) clear ; DecompD ; PRESS_ENTER ;;
3 ) clear ; DecompTag ; PRESS_ENTER ;;
4 ) clear ; DecompTagD ; PRESS_ENTER ;;
5 ) clear ; Compile ; PRESS_ENTER ;;
6 ) clear ; CompileSign ; PRESS_ENTER ;;
7 ) clear ; FrameInst ; PRESS_ENTER ;;
8 ) clear ; FrameInstTag ; PRESS_ENTER ;;
1 ) clear ; FrameInst ; PRESS_ENTER ;;
2 ) clear ; FrameInstTag ; PRESS_ENTER ;;
3 ) clear ; Decomp ; PRESS_ENTER ;;
4 ) clear ; DecompD ; PRESS_ENTER ;;
5 ) clear ; DecompTag ; PRESS_ENTER ;;
6 ) clear ; DecompTagD ; PRESS_ENTER ;;
7 ) clear ; Compile ; PRESS_ENTER ;;
8 ) clear ; CompileSign ; PRESS_ENTER ;;
9 ) clear ; WorkDir ; ZipFile ; PRESS_ENTER ;;
10 ) clear ; SignK ; PRESS_ENTER ;;
11 ) clear ; MANAGE_TAGS ; PRESS_ENTER ;;
Expand Down
6 changes: 3 additions & 3 deletions tools/apktool
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
Expand Down Expand Up @@ -52,7 +52,7 @@ javaOpts=""
# If you want DX to have more memory when executing, uncomment the following
# line and adjust the value accordingly. Use "java -X" for a list of options
# you can pass here.
#
#
javaOpts="-Xmx512M -Dfile.encoding=utf-8"

# Alternatively, this will extract any parameter "-Jxxx" from the command line
Expand All @@ -74,4 +74,4 @@ fi
# add current location to path for aapt
PATH=$PATH:`pwd`;
export PATH;
exec java $javaOpts -jar "$jarpath" "$@"
exec java $javaOpts -jar "$jarpath" "$@"
Binary file modified tools/apktool.jar
Binary file not shown.
Binary file modified tools/lib64/libLLVM_android.so
Binary file not shown.
Binary file modified tools/lib64/libaapt2_jni.so
Binary file not shown.
Binary file modified tools/lib64/libbcc.so
Binary file not shown.
Binary file modified tools/lib64/libbcinfo.so
Binary file not shown.
Binary file modified tools/lib64/libc++.so
Binary file not shown.
Binary file added tools/lib64/libc++.so.1
Binary file not shown.
Binary file modified tools/lib64/libclang_android.so
Binary file not shown.
Binary file modified tools/menu.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tools/zipalign
Binary file not shown.

0 comments on commit 7b718ce

Please sign in to comment.