Custom patches for various Android stuff, mostly for penangf, powered by dexpatcher.
Current features:
- Platform Signature spoofing -- Allows system packages with the
SPOOF_PLATFORM_SIGNATUREpermission to spoof their signature to the platform key (used for patched system apps) - (Updated) Signature Spoofing for apps -- Allows all apps that have the
FAKE_PACKAGE_SIGNATUREpermission to spoof their signature to the one definied in their metadata. Updated to support latest changes for SigningInfo needed by microG and new apps.
INSTALL
Get the latest version of the magisk module from the release tab, and flash it through magisk manager. The magisk module will only apply the signature spoofing patch.
MANUALLY BUILD
Run the build_module.sh script to build the module. You will need to have javac, zip and d2j-jar2dex in your PATH.
Get the files you need from your ROM (for now only patches for services.jar are available), and dexpatcher 1.8.0-beta1 and put all in the same directory.
Then run the following commands with the correct API (in this case, API 34 is used)
mkdir generated_dex
# This will only apply the signature spoof patch. For full haruka patches, use haruka_0.2.dex
java -jar dexpatcher-1.8.0-beta1.jar --multi-dex-threaded --api-level 34 --verbose --debug --output generated_dex services.jar haruka_core.dex haruka_34.dex
After dexpatcher generated the new patched dexes, open services.jar with an archive program (such as 7zip or WinRar), remove all old .dex files from it and put the newly generated one inside.
Or use the patch_services.sh script like this
# If not present, create a directory called build and put haruka dex file in there as "haruka.dex"
./patch_services.sh path/to/stock_services.jarAnd you'll find the patched services.jar inside the build directory.
Now, choose which steps you need to do based on what you'll need the patch for:
- Copy services.jar to /system/framework (replace if the old one is still present)
- Run the following commands
chown 0:0 services.jar
chmod 0644 services.jar
setfattr -n security.selinux -v u:object_r:system_file:s0 services.jar- Copy the patched services.jar to a working android device in the shared storage (e.g. Documents) and run the following command from ADB (Root is not needed)
# This is needed to generate optimized dexes files, or the device will bootloop
dex2oat64 --dex-file=services.jar --instruction-set=arm64 --oat-file=services.odex- Pull the generated files (make sure they're not 0 bytes in size) into your PC
- Copy them to /system/framework/oat/arm64/
- Run the following commands
chown 0:0 services.vdex
chmod 0644 services.vdex
setfattr -n security.selinux -v u:object_r:system_file:s0 services.vdex
chown 0:0 services.odex
chmod 0644 services.odex
setfattr -n security.selinux -v u:object_r:system_file:s0 services.odex- Enjoy!
- First of all, make sure your device is rooted
- With adb, push services.jar to shared storage (e.g. Documents)
- Run
dex2oat64 --dex-file=services.jar --instruction-set=arm64 --oat-file=services.odex- Replace services.jar in /system/framework with the patched one, and the newly generated optimized dexes file to /system/framework/oat/arm64
- Run the following commands on all copied files:
# Replace X with the extension of the file
chown 0:0 services.X
chmod 0644 services.X
chcon "u:object_r:system_file:s0" services.X- Reboot to recovery and clear cache (Optional, but recommended)
- Reboot to system
- Enjoy!
Haruka source code and patches are licensed under the Apache 2.0 license. See LICENSE.
The app sources (under app) and magisk module (under module) are licensed under the GPLv3 license. See their respective directories for the license.