[Magisk] fOmey:
Smali Patcher

​

WHAT THE HELL IS THIS THING? ::

To sum things up this is an application I developed that pulls the android framework from your device, applies what I (or other users) consider useful patches to the sourced files and then finally generates a magisk module applying the patches system-lessly.

The unique thing about Smali Patcher is it sources the framework files from your device, in an attempt to provide maximum compatibility across the entire android device family.

While I have your attention I wanted to throw out a massive thank you to all the people who have provided support to the project and the thread over the years, you guys are absolute champions. I can't thank you enough and couldn't have done it without you, here's to ya!

PATCHES ::

Mock locations - Hide mock locations status, allowing apps like Pokemon GO to treat them as genuine location updates.

Mock Providers: Allow creation of mock providers without mock permissions.

GNSS updates: Disable all GNSS (GPS) location updates.

Secure flag - Allow screenshots/screensharing in secure apps.

Signature verification (as-is, legacy support only) - Disable signature verification allowing modification/execution of signed system apps.

Signature spoofing (as-is) - Enable signature spoofing app permission.

Recovery reboot - Reboot directly back into recovery from powermenu.

Samsung Knox (as-is, legacy support only) - Bypass Samsung Knox trip protection, only confirmed working for secure folder.

High volume warning - Disable high volume popup dialog.

Any patches marked "as-is" are no longer maintained and only kept in for legacy device support only, not recommended to be used on newer android versions (10/11).. use at your own risk.

GPS SPOOFERS / FUSEDLOCATION / RUBBERBANDING NOTICE ::

FusedLocation API GPS spoofers are NOT compatible with the mock location patch.. your required to use a traditional GPS spoofer! Spoofed location updates will be fed into fusedlocation all the same, meaning you don't need to disable the service.. which means while your not spoofing you still gain the benefit of fusedlocation which is all around more accurate location updates!

REQUIREMENTS ::

PC with at least 3GB+ of RAM.

.NET Framework 4.7.1 or later installed

Java installed

Android device running 6.0 or above.

INSTRUCTIONS (ADB METHOD/AUTOMATED - RECOMMENDED):

COMPATIBLE WITH BOTH ODEX & DEODEXED ROMS! WILL AUTOMATICALLY DEODEX REQUIRED FILES IF NECESSARY.

Backup device.. safety first kids.

Enable USB debugging in developer settings on your device and connect via USB to your PC.

Authorise USB debugging connection on your phone.. example of popup.

Run "SmaliPatcher.exe", First startup will automatically download the latest necessary binary's.

Select your desired patches.

Hit "ADB PATCH" button (yes without browsing for a .jar file).

Once the process has completed, magisk module will be generated in the same directory as "SmaliPatcher.exe" named: "SmaliPatcherModule-X.X.X.X-fOmey@XDA.zip".

Install the generated magisk module either in recovery mode or from the magisk app.

Enable smali patcher module in magisk.

INSTRUCTIONS (ALTERNATIVE METHOD - FOLLOW ONLY IF ADB METHOD FAILS) ::

Backup device.

Enable USB debugging in developer settings on your device and connect via USB to your PC.

Authorise USB debugging connection on your phone.. example of popup.

Run "SmaliPatcher.exe", First startup will download the latest necessary binary's.

Browse to your "/system/framework" directory. Easiest way to obtain these files is from your rom img/zip.

Select your desired patches.

Hit the "PATCH" button.

Once the process has completed, magisk module will be generated in the same directory as "SmaliPatcher.exe".

Install the generated magisk module either in recovery mode or from the magisk app.

Enable smali patcher module in magisk.

YOU ARE STILL REQUIRED TO HAVE A DEVICE CONNECTED TO YOUR PC IF YOU USE THIS METHOD.. THE PATCHER WILL NOT PROGRESS OTHERWISE.

A ADB DEVICE IS REQUIRED TO EXTRACT CDEX FILES.. IF YOU'RE PARANOID/SAVY ENOUGH, YOU CAN USE A ANDROID EMULATOR.

BEFORE REPORTING ANY ISSUES ::

You have tried running the patcher as administrator.

You have accepted the USB debugging connection & ticked "Always allow from this computer".

You have tried running the patcher with phone booted in recovery mode with /system mounted.

UPDATING MODULE INSTRUCTIONS:

Disable/uninstall any active smali patcher modules before generating a new one! If you generate a module with a older version active there's a chance the outdated patches will carry over to the new module.. I do my best efforts to prevent this, but it may still happen. Before reporting issues, make sure you have tried this.

CHANGELOG ::

7.4

Modified patch - GNSS updates: now correctly handles protected methods.

7.3

First pass of android 11 patch updates: mock provider, gnss update & secure flag patch updated.

7.2

Modified patch - Secure flag: revert a change I made, should solve issues on some devices.. hopefully.

7.1

New patch - GNSS updates: Disable all GNSS (GPS) location updates.

Modified patch - Secure flag: tested & working on Samsung devices running android 10.

7.0

New patch - Mock Providers: Allow creation of mock providers without mock permissions.

6.9

Allow devices booted in recovery mode through ADB check.

6.8

Made patches "compatible" with the latest android 11 beta (pixel).. none of which have been tested on android 11.

BACKUP! BACKUP! BACKUP!

6.7

Removed "magisk-module-template" dependency.

6.6

Fixed patch - Magisk reboot: was not being applied when selected.

"Magisk reboot" patch renamed to "Recovery reboot".

6.5

Updated patch - Magisk reboot: now compatible with Samsung One UI 2.0 (android Q).

6.4

New patch - Samsung Knox: Bypass samsung knox trip protection, only confirmed working for secure folder.

6.3

ADB error checking: require a ADB device to be present even while patching "browsed" for framework dumps.

Framework error checking: display an error if no odex, vdex or oats are found.. incomplete framework dump.

Display hints for common mistakes made by users, hopefully reduces the amount of "error" reports by people that don't follow instructions.

6.2

ADB error checking: unauthorized ADB device check.

6.1

Error handling - Verify required files are found during deodex process.

6.0

Fixed index out of bounds crash.

Revert mock location patch to the original.

5.9

Mock location patch updated. Reverted patch back to the original, new patch failed.

Adapted back end functions to support multi-file patches.

Browse for .jar has now been changed to browse for "/system/framework" directory.. no longer requires a deodexed file to be targeted, will deodex necessary files if required.

5.8

Check if patcher is being ran with administrator privileges, otherwise display a warning.

Fixed a possible false positive error during cdex extraction.

5.7

Error handling - verify classes.dex is found during cdex extraction.

Added few more status updates to assist error checking.

5.6

Changed binary download percentage behaviour: avoid users reporting false "stuck on XYZ percent".

Updated mock location patch to support android 10/Q.

Updated reboot behaviour patch to support android 10/Q.

Save/restore selected patches when browsing for a JAR.

5.5

Fixed force close during vdex extraction.

5.4

Modified secure flag patch - need testing & feedback.

Modified java detection to allow more runtime environments.

5.3

Suppress false positive "magisk download failed" errors.

Verify patched APK's have been generated before creating module.

5.2

Modified secure flag patch.

Added paypal donation button.

5.1

Removed signature verification "class not found" error report, false positive on legacy android versions.

5.0

Adapted backend functions to support multi-file patches.

Require at least one patch to be enabled before proceeding.

Fix download percentage status updates.

Popup explorer window to output directory on completion.

Modified signature verification patch (android P).

When browsing for a JAR only display compatible patches (preparation for multi-file patches, services.jar must be named "services.jar" from this point onward for verification purposes.. otherwise no patches will be displayed).

New patch - disable high volume warning popup.. this has annoyed me so much recently! I was only able to test this on android P, if you find the patch does not work on your device please supply a deodexed services.jar so I can investigate further.

4.9

Fixed a crash when applying magisk reboot patch to a already patched target.

Improved magisk reboot patch, removed the potential to not reboot back into magisk.

Redirect output for certain binary functions with working status indicators.

Fix mock location patch that I broke in the most stupid way possible.. if you're updating from 4.8,

make sure you disable/remove any installed smali patcher magisk modules before updating

.

4.8

Display command line window until inbuilt patcher status updates are fixed to prevent user confusion.

4.7

Secure flag patch update (based off 9.0).

Signature verification patch update (based off 9.0).

4.6

Dynamically calculate base directory.

Modify output loop to ensure all output is displayed.

Magisk reboot patch (Galaxy S10 only).

4.5 [UNTESTED - I OWN A S10 WHICH CURRENTLY IS NOT MAGISK COMPATIBLE.. USE AT YOUR OWN RISK]

Force unix config formatting.

4.4 [UNTESTED - I OWN A S10 WHICH CURRENTLY IS NOT MAGISK COMPATIBLE.. USE AT YOUR OWN RISK]

Magisk "installation failed" fix.. (I shouldn't have been lazy and read all the module documentation.. probably could of avoided this).

4.3 [UNTESTED - I OWN A S10 WHICH CURRENTLY IS NOT MAGISK COMPATIBLE.. USE AT YOUR OWN RISK]

Magisk v19.0 compatible (magisk template download failed fix).

4.2 [TESTING]

Potential slowdown fix?

4.1

Allow the patcher to run without having any patches selected for testing purposes.

Force a single classes.dex to be generated when applying signature spoofing patch.. (potential slowdown fix?)

Remove irrelevant debug output.

4.0

Modified ADB error checking function to fix false error reports.

3.9 ::

ADB error checking: verify a single ADB device is connected before proceeding.

Added few more status updates to assist error checking.

Updated magisk template & URL.

3.8 [TESTING] ::

Potential slowdown fix?

3.7 ::

Modified java detection.

3.6 ::

Added some more error checking.

3.5 ::

Verify Java is installed & detected before proceeding.

3.4 ::

Amend legacy dummy file to generated magisk module config.sh.

3.3 ::

Create dummy file in magisk module (legacy devices).

3.2 ::

Fixed a issue calculating file paths on legacy devices.

3.1 ::

Added "/system/system" path to dumping functions.

Added output filter to avoid user confusion when spitting out harmless errors.

3.0 ::

Updated dependencies.

Reworked some core functions to attempt to fix unknown caused crash for certain users.

2.9 ::

Reworked some functions, made them dynamically detect file names to avoid potential issues.

2.8 ::

Verify dexpatcher patches are found, otherwise re-download.

Change patch button text to indicate patching mode.

Error handling - verify classes.dex is found before recompiling.

Error handling - verify services.jar is found before recompiling.

Error handling - verify input files are not dummy's.

Conditional dead end bug fix while patching multi-class jar's.

2.7 ::

Re-added signature spoofing patch.

Added dexpatcher as a dependency.

2.6 ::

Added support for Android P.

Modified binary download function to prevent crashes.

2.5 ::

Added support for multi-classes.dex.

2.4 ::

Improved binary download function - verify binary size, will attempt to re-download if necessary.

Improved binary URL grabber function - should now fetch correct address.

2.3 ::

Improved de/odex detection function - should now allow generating a module with no mods selected (debugging purposes)

Improved error checking & reports.

2.2 ::

Android 8.0-8.1 compatibility.

2.1 ::

Corrected missing variables in config.sh for magisk module (lollipop bootloop fix) - full credit to @Eng.Raman

2.0 ::

Prevent false "detected api" message.

Play's nice with android lollipop - full credit to @Eng.Raman

1.9 ::

Potential fix for random crash aka. dumping framework freeze/crash.

1.8 ::

Handle "permission denied" error when pulling build.prop.

1.7 ::

Improved framework base directory detection.

1.6 ::

Framework base directory detection.

1.5 ::

Improved error checking - added more debug info which hopefully will make diagnosing bugs a little easier.

Proper API detection using rom build.prop.

Improved a search function used for locating framework files.

1.4 ::

Improved error checking - verify's services.odex size detecting if module already active.

Potential fix for "magisk download failed" that certain user's are experiencing.

1.3 (BETA) ::

Added in ADB libary which allows us to now pull/push files to the device.

Added in smali & baksmali which allows us to now deodex.

One click function to pull all the required files from the device, deodex (if necessary), patch and finally generate a magisk module! (I plan to code in a function that pushes the module to the device upon completion in the future - fully automated baby woohoo)

If you would like to use the adb method of patching, make sure you have "USB debugging" enabled in developer options otherwise it simply won't work.. you obviously need to plug in your phone to the PC and authorize the USB connection on your device.

1.2 ::

Updated to Magisk v15.

Improved error checking & reports.

1.1 ::

Removed signature spoofing for the time being - causing bootloop for some users, need to rework the patch when I have time.

1.0 ::

Improved patching function: should now be compatible with even more unique service.jar's.

Improved patching function: now reports errors for each independent patch, should make diagnosing patch errors a little easier.

Fixed some debug code I left from previous release which may have prevented patch process from completing. (whoops.. sorry about that!)

0.9 ::

Added new patch: signature spoofing.

0.8 ::

Improved patching function.

0.7 ::

Merged projects together - Mock locations, secure flag & signature verification.

Assembly version used as module version and in generated module zip name.

Fixed minor bug when selecting a JAR named something other than "services.jar".

0.6 ::

Error handling for failed downloads of magisk module template.

Updated to Magisk v14.0.

0.4 / 0.5 ::

Potential spaces in file path error fix - unsure as I have been unable to reproduce this issue, so it's been very difficult to fix.

0.3 ::

Increased default Java memory heap size - fixes "out of memory" error on lowend PC's.

0.2 ::

Simplified patching process.

Fixed reboot issue with certain GPS spoofers.

Verify's target JAR is deodexed before proceeding with patch.

0.1 ::

Initial release

Cheers,

Honorable mention to @Eng.Raman & @A30NI_Y, who has been kind enough to patch service.jar's for tons of users who lack the knowledge to deodex (despite my best efforts of writing out clear instructions!)... the smali patcher user base thanks you for your service!

PRECAUTIONS / TERMS OF USE ::

You must backup your device prior to flashing the module, I am not responsible or providing support to recover any devices stuck in bootloops.. if for what ever reason you find yourself in this situation, simply uninstall magisk and reinstall.. doing this will reset your installed modules.

PLEASE READ FAQ IN POST 2 & SEARCH THE THREAD BEFORE ASKING QUESTIONS, CHANCES ARE THEY HAVE BEEN ANSWERED ALREADY AND YOU CAN FIND YOUR ANSWER IMMEDIATELY.

Rather then making mirrors of the download link, please redirect traffic to this thread to ensure they are always using the latest version! Oh hi reddit.

DOWNLOAD MIRRORS

Google drive