From 7821c02171d77229797e3a57edd0502e942373cc Mon Sep 17 00:00:00 2001 From: Kacper Sagalara Date: Fri, 19 Jun 2026 19:08:11 +0200 Subject: Add missing files. --- utils/bin/fectool/fec | Bin 0 -> 1572304 bytes utils/bin/fectool/ld-linux-x86-64.so.2 | Bin 0 -> 236616 bytes utils/bin/fectool/libc++.so | Bin 0 -> 1306312 bytes utils/bin/fectool/libdl.so.2 | Bin 0 -> 14408 bytes utils/bin/fectool/libgcc_s.so.1 | Bin 0 -> 183024 bytes utils/bin/fectool/libm.so.6 | Bin 0 -> 952616 bytes utils/bin/fectool/libpthread.so.0 | Bin 0 -> 14408 bytes utils/bin/fectool/libresolv.so.2 | Bin 0 -> 68104 bytes utils/bin/fectool/librt.so.1 | Bin 0 -> 14624 bytes utils/jar/apktool.jar | Bin 0 -> 25925346 bytes utils/scripts/add_to_fs.sh | 29 +++++++++++++++++++ utils/scripts/list_packages.sh | 7 +++++ utils/scripts/modify_apk.sh | 50 +++++++++++++++++++++++++++++++++ 13 files changed, 86 insertions(+) create mode 100755 utils/bin/fectool/fec create mode 100644 utils/bin/fectool/ld-linux-x86-64.so.2 create mode 100644 utils/bin/fectool/libc++.so create mode 100644 utils/bin/fectool/libdl.so.2 create mode 100644 utils/bin/fectool/libgcc_s.so.1 create mode 100644 utils/bin/fectool/libm.so.6 create mode 100644 utils/bin/fectool/libpthread.so.0 create mode 100644 utils/bin/fectool/libresolv.so.2 create mode 100644 utils/bin/fectool/librt.so.1 create mode 100644 utils/jar/apktool.jar create mode 100755 utils/scripts/add_to_fs.sh create mode 100755 utils/scripts/list_packages.sh create mode 100755 utils/scripts/modify_apk.sh (limited to 'utils') diff --git a/utils/bin/fectool/fec b/utils/bin/fectool/fec new file mode 100755 index 0000000..b2421eb Binary files /dev/null and b/utils/bin/fectool/fec differ diff --git a/utils/bin/fectool/ld-linux-x86-64.so.2 b/utils/bin/fectool/ld-linux-x86-64.so.2 new file mode 100644 index 0000000..1100d03 Binary files /dev/null and b/utils/bin/fectool/ld-linux-x86-64.so.2 differ diff --git a/utils/bin/fectool/libc++.so b/utils/bin/fectool/libc++.so new file mode 100644 index 0000000..f1fc652 Binary files /dev/null and b/utils/bin/fectool/libc++.so differ diff --git a/utils/bin/fectool/libdl.so.2 b/utils/bin/fectool/libdl.so.2 new file mode 100644 index 0000000..81d5f23 Binary files /dev/null and b/utils/bin/fectool/libdl.so.2 differ diff --git a/utils/bin/fectool/libgcc_s.so.1 b/utils/bin/fectool/libgcc_s.so.1 new file mode 100644 index 0000000..0e7b8a5 Binary files /dev/null and b/utils/bin/fectool/libgcc_s.so.1 differ diff --git a/utils/bin/fectool/libm.so.6 b/utils/bin/fectool/libm.so.6 new file mode 100644 index 0000000..6dc6c8e Binary files /dev/null and b/utils/bin/fectool/libm.so.6 differ diff --git a/utils/bin/fectool/libpthread.so.0 b/utils/bin/fectool/libpthread.so.0 new file mode 100644 index 0000000..145787c Binary files /dev/null and b/utils/bin/fectool/libpthread.so.0 differ diff --git a/utils/bin/fectool/libresolv.so.2 b/utils/bin/fectool/libresolv.so.2 new file mode 100644 index 0000000..5b0aeed Binary files /dev/null and b/utils/bin/fectool/libresolv.so.2 differ diff --git a/utils/bin/fectool/librt.so.1 b/utils/bin/fectool/librt.so.1 new file mode 100644 index 0000000..b4db5d7 Binary files /dev/null and b/utils/bin/fectool/librt.so.1 differ diff --git a/utils/jar/apktool.jar b/utils/jar/apktool.jar new file mode 100644 index 0000000..185c2da Binary files /dev/null and b/utils/jar/apktool.jar differ diff --git a/utils/scripts/add_to_fs.sh b/utils/scripts/add_to_fs.sh new file mode 100755 index 0000000..037c5e6 --- /dev/null +++ b/utils/scripts/add_to_fs.sh @@ -0,0 +1,29 @@ +#!/bin/bash + +if [ "$#" -lt 3 ]; then + echo "Incorrect arguments!" + echo " Using: $0 [FTYPE (d,f,x)] [SELINUX_DOMAIN]" + exit 1 +fi + +PARTITION_NAME=$1 +FILE_INPUT=$2 +FILE_LOCATION=$3 +FTYPE=$4 +SELINUX_DOMAIN=$5 + + +FS_CONFIG_DIR="unpacked/mnt/config/" +PERMISSION=0644 + +if [[ -z ${SELINUX_DOMAIN} ]]; then + SELINUX_DOMAIN="system_file" +fi + +echo "/${PARTITION_NAME}/${FILE_LOCATION}/${FILE_INPUT} u:object_r:$SELINUX_DOMAIN:s0" >> ${FS_CONFIG_DIR}/${PARTITION_NAME}_file_contexts + +# PART_NAME_fs_config +if [[ -d $FILE_INPUT || $FTYPE == 1 ]]; then + PERMISSION=0755 +fi +echo "${PARTITION_NAME}/${FILE_LOCATION}/${FILE_INPUT} 0 0 ${PERMISSION}" >> ${FS_CONFIG_DIR}/${PARTITION_NAME}_fs_config diff --git a/utils/scripts/list_packages.sh b/utils/scripts/list_packages.sh new file mode 100755 index 0000000..78fe462 --- /dev/null +++ b/utils/scripts/list_packages.sh @@ -0,0 +1,7 @@ +#!/bin/bash + +MNT_DIR="unpacked/mnt/" + +for i in $(find $MNT_DIR -name "*.apk"); do + echo -e "$( aapt dump badging $i | awk '/package/{gsub("name=|'"'"'",""); print $2}' ) : $i" +done diff --git a/utils/scripts/modify_apk.sh b/utils/scripts/modify_apk.sh new file mode 100755 index 0000000..e682598 --- /dev/null +++ b/utils/scripts/modify_apk.sh @@ -0,0 +1,50 @@ +#!/bin/bash + +TMP_DIR="/tmp/driedlamu/modify_apk" + +decompile() { + local file="$1" + local file_name="$(basename "$file" .apk)" + local working_dir="$TMP_DIR/$file_name" + + mkdir -p "$working_dir" + + if ! java -Xmx2048m -jar "./utils/jar/apktool.jar" d -q -f "$file" -o "$working_dir/decompile"; then + echo "Error: Failed to decompile $file with apktool" + exit 1 + fi +} + +repack() { + local file="$1" + local file_name="$(basename "$file" .apk)" + local output_location="$2" + local working_dir="$TMP_DIR/$file_name" + local modified_apk="$working_dir/${file_name}_unsigned.apk" + + if ! java -Xmx2048m -jar "./utils/jar/apktool.jar" b -q -f "$working_dir/decompile" -o "$working_dir/${file_name}_unsigned.apk"; then + echo "Error: Failed to recompile $file with apktool" + exit 1 + fi + + apksigcopier copy "$file" "$modified_apk" "${output_location}/${file_name}.apk" +} + +mkdir -p $TMP_DIR + +apk_cli() { + case $1 in + unpack) + decompile "$2" + ;; + repack) + repack "$2" "$3" + ;; + *) + echo "Please specify a valid type of task you wish to do (unpack, repack)." + exit 1 + ;; + esac +} + +apk_cli "$1" "$2" "$3" -- cgit v1.2.3