FORUMS
Remove All Ads from XDA

[TOOL]Xpatch: Using Xposed modules to modify apps without root device

5 posts
Thanks Meter: 6
 
By Windy_007, Junior Member on 18th April 2019, 06:28 PM
Post Reply Email Thread
Hi, All, Latest I want to modify other apps in unrooted device, so I wrote a tool to do this. I just called it Xpatch.

The basic principle of this tool is very simple. It just modify the target apk, inserting some codes in the Application. These codes's main purpose is loading the xposed modules. So any Xposed modules installed in the device can be loaded by the target app.

Note: It is very safe.

Github repository: Open Github and search Xpatch, or just search my name: WindySha. (Because I'm new here, I have no permission to add links in this thread)

The following is the detailed introduction:

What is Xpatch

Xpatch is a jar tool which is used to repackage the apk file. Then, the new apk can load any Xposed modules installed in the android system.

This is a way to use Xposed modules without root your device.

It is easy way to modify one app using xposed module. And any apps changed by Xpatch can load every modules downloaded in the Xposed Module Repository.

Benefits
1. Use xposed modules without your device;
2. Modify any apps without root your device.

How to use
1. Download the latest jar file from the my github release page.

2. Run this command in the Windows/Mac console:
$ java -jar ../../xpatch.jar ../../source.apk

Then, a new apk named `source-xposed-signed.apk` in the same folder as `source.apk`.

More commands
1. You can specify the output apk path by add `-o` parameter, eg:
$ java -jar ../../xpatch.jar ../../source.apk -o ../../dst.apk

2. Show all the building new apk logs, just add `-l`, eg:
$ java -jar ../../xpatch.jar ../../source.apk -l

3. After the version 1.2, craching app signature verifying is added, if you won't need the function, just add '-c', eg:
$ java -jar ../../xpatch.jar ../../source.apk -c

Todo list
1. Support packaging the xposed modules into the source apk;
2. Support loading so library in the xposed modules;
3. Crach apk protections.

Issues
1. If the apk dex files are protected, dex2jar can not effect on the dexs, then this tool will not work;
2. The hook framework is using whale, this framework is not very stable, some hooks may fail;
3. Do not support Davlik VM;
4. Do not support resource hook;
The Following 4 Users Say Thank You to Windy_007 For This Useful Post: [ View ] Gift Windy_007 Ad-Free
 
 
7th May 2019, 10:34 PM |#2  
Senior Member
Thanks Meter: 143
 
More
I didn't understand how to use it. Can you make a video?

通过我的 Redmi Note 5 上的 Tapatalk发言
9th May 2019, 01:25 AM |#3  
CosmicDan's Avatar
Senior Member
Flag Sydney
Thanks Meter: 7,590
 
Donate to Me
More
Very interesting. So basically it takes an Xposed module, parses the hooks, and modifies the bytecode permanently? Pretty cool.

I am wondering how compatible it is though. It uses Dex2Jar and something called "whale"? Did you ever see DexPatcher? Maybe it would be a battery choice to use it instead.

Also, does it work for framework modification? Or any plans for it?

Cheers!

Sent from my POCOPHONE F1 using Tapatalk
11th May 2019, 07:50 AM |#4  
OP Junior Member
Thanks Meter: 6
 
More
Quote:
Originally Posted by CosmicDan

Very interesting. So basically it takes an Xposed module, parses the hooks, and modifies the bytecode permanently? Pretty cool.

I am wondering how compatible it is though. It uses Dex2Jar and something called "whale"? Did you ever see DexPatcher? Maybe it would be a battery choice to use it instead.

Also, does it work for framework modification? Or any plans for it?

Cheers!

Sent from my POCOPHONE F1 using Tapatalk

Thank you for your comment.
The main principle of xpatch is decompile the apk, and add a method in the application's entrance, xposed modules are loaded in this method.
Then repackaged the modified apk and sign it.

"whale" is used to hook java method under ART.

It is different from DexPatcher.
The difference is :

1. Apk modofied by xpatch can load any xposed modules, including many open source xposed modules in xposed reposotory website.

2. Apk modofied by xpatch do methods hooking at runtime. DexPatcher, on the other hand, modifies everything ahead of runtime and produces a standalone, modified APK.

3. DexPatcher requires repackage and resign apk many times if developers want to modify apk many times, but xpatch only repackage apk once.

4. Xpatch require Art method hook framework, DexPatchert doesn’t depend on any external framework.

But they also share some common feature:

1. Both of them do not need root device.

2. Both of them need repakage the apk and resign it.

Final, xpatch do not support framework modification. Bacause this modification need root device. xpatch is only for unroot device.
The Following User Says Thank You to Windy_007 For This Useful Post: [ View ] Gift Windy_007 Ad-Free
11th May 2019, 07:54 AM |#5  
OP Junior Member
Thanks Meter: 6
 
More
Quote:
Originally Posted by andy_zhang

I didn't understand how to use it. Can you make a video?

通过我的 Redmi Note 5 上的 Tapatalk发言

Download xpatch : https://github.com/WindySha/Xpatch
Download the jar.
Open your terminal, run this command:

$ java -jar ../../xpatch.jar ../../source.apk

Then a new apk is produced in the same folder as source apk.
This apk can load any xposed modules installed in the device.
Hope this can help you.
11th May 2019, 07:57 AM |#6  
OP Junior Member
Thanks Meter: 6
 
More
Xpatch source code: https://github.com/WindySha/Xpatch

Xpatch jar download: https://github.com/WindySha/Xpatch/releases

English Readme doc: https://github.com/WindySha/Xpatch/b...c/README_en.md
21st May 2019, 12:24 AM |#7  
Senior Member
Thanks Meter: 143
 
More
我做了一个,打不开。
22nd May 2019, 12:28 PM |#8  
Senior Member
Thanks Meter: 143
 
More
失败。
Post Reply Subscribe to Thread

Guest Quick Reply (no urls or BBcode)
Message:
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes