Skip to content

Commit

Permalink
Merge pull request #46 from enovella/ksufrida
Browse files Browse the repository at this point in the history
Support KernelSU / Apatch & fix broken Frida server launch
  • Loading branch information
ViRb3 authored Jul 17, 2024
2 parents 79d5796 + d869038 commit 4b4cc98
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 10 deletions.
5 changes: 1 addition & 4 deletions base/common/service.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,4 @@ done
sleep 5

# restart on crash
while true; do
frida-server
sleep 1
done
frida-server -D
29 changes: 24 additions & 5 deletions base/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ REPLACE="
print_modname() {
ui_print " "
ui_print " ********************************************"
ui_print " * MagiskFrida *"
ui_print " * Magisk-/KernelSU-Frida *"
ui_print " ********************************************"
ui_print " "
}
Expand All @@ -141,14 +141,33 @@ on_install() {
esac

ui_print "- Detected architecture: $F_ARCH"
ui_print "- Extracting module files"

F_TARGETDIR="$MODPATH/system/bin"
UNZIP="/data/adb/magisk/busybox unzip"
if [ "$BOOTMODE" ] && [ "$KSU" ]; then
ui_print "- Installing from KernelSU app"
ui_print "- KernelSU version: $KSU_KERNEL_VER_CODE (kernel) + $KSU_VER_CODE (ksud)"
UNZIP="/data/adb/ksu/bin/busybox unzip"
elif [ "$BOOTMODE" ] && [ "$APATCH" ]; then
ui_print "- Installing from APatch app"
ui_print "- APatch version: $APATCH_VER_CODE. Magisk version: $MAGISK_VER_CODE"
UNZIP="/data/adb/ap/bin/busybox unzip"
elif [ "$BOOTMODE" ] && [ "$MAGISK_VER_CODE" ]; then
ui_print "- Installing from Magisk app"
ui_print "- Magisk version: $MAGISK_VER_CODE"
UNZIP="/data/adb/magisk/busybox unzip"
else
ui_print "*********************************************************"
ui_print "! Install from recovery is not supported"
ui_print "! Please install from KernelSU or Magisk app"
abort "*********************************************************"
fi

ui_print "- Extracting module files"
F_TARGETDIR="$MODPATH/system/bin"
mkdir -p "$F_TARGETDIR"
$UNZIP -qq -o "$ZIPFILE" "files/frida-server-$F_ARCH" -j -d "$F_TARGETDIR"
chcon -R u:object_r:system_file:s0 "$F_TARGETDIR"
chmod -R 755 "$F_TARGETDIR"

$UNZIP -qq -o "$ZIPFILE" "files/frida-server-$F_ARCH" -j -d "$F_TARGETDIR"
mv "$F_TARGETDIR/frida-server-$F_ARCH" "$F_TARGETDIR/frida-server"
}

Expand Down
2 changes: 1 addition & 1 deletion build.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ def create_module_prop(path: Path, project_tag: str):
name=MagiskFrida
version={project_tag}
versionCode={project_tag.replace(".", "").replace("-", "")}
author=ViRb3
author=ViRb3 & enovella
description=Run frida-server on boot
updateJson=https://github.com/ViRb3/magisk-frida/releases/latest/download/updater.json"""

Expand Down

0 comments on commit 4b4cc98

Please sign in to comment.