Skip to content

Instantly share code, notes, and snippets.

@topjohnwu
Last active March 9, 2023 19:03
Show Gist options
  • Star 11 You must be signed in to star a gist
  • Fork 6 You must be signed in to fork a gist
  • Save topjohnwu/2a5adf5bde30507dd411715b2a746ba4 to your computer and use it in GitHub Desktop.
Save topjohnwu/2a5adf5bde30507dd411715b2a746ba4 to your computer and use it in GitHub Desktop.
The script for updating all Systemless Xposed Modules
# /usr/bin/env bash
oxver=89 # The original version on official server
xver=89.3 # Our own version
xcode=8930 # Our own version code for Magisk module
progress() {
echo -e "\n\033[44m${1}\033[0m\n"
}
dl_ext() {
if [ ! -f source/$zip ]; then
progress "Downloading $zip"
curl -o source/$zip -L http://dl-xda.xposed.info/framework/sdk${sdk}/${arch}/$zip
fi
progress "Extracting $zip"
unzip -o source/$zip 'system/bin/*' -d $dir
unzip -o source/$zip 'system/lib*' -d $dir
}
patch_bin() {
progress "Patching files"
for app_process in $dir/system/bin/app_process*_xposed; do
mv -vf $app_process ${app_process%_xposed} 2>/dev/null
sed -i 's/\/system\/xposed.prop\x0/\/xposed.prop\x0\x0\x0\x0\x0\x0\x0\x0/g' ${app_process%_xposed} && echo "Patching ${app_process%_xposed}"
done
sed -i "s/version=.*/version=${xver} (Systemless)/g" $dir/system/xposed.prop && echo "Patching $dir/system/xposed.prop"
}
common_patch() {
progress "Universal files for SDK${sdk}"
unzip -oj source/$zip system/framework/XposedBridge.jar -d xposed_${sdk}/common
sed -i "s/version=..../version=${xver}/g; s/Code=.*/Code=${xcode}/g" xposed_${sdk}/module.prop && echo "Patching xposed_${sdk}/module.prop"
}
mkdir source 2>/dev/null
for sdk in {21..25}; do
for arch in arm arm64 x86; do
zip=xposed-v${oxver}-sdk${sdk}-${arch}.zip
dir=xposed_${sdk}/${arch}
dl_ext
patch_bin
done
common_patch
done
@rkantos
Copy link

rkantos commented Dec 13, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment