Attend XDA's Second Annual Developer Conference, XDA:DevCon 2014!
5,802,957 Members 40,179 Now Online
XDA Developers Android and Mobile Development Forum

[Utility][2.0]Auto-Patcher

Tip us?
 
mateorod
Old
(Last edited by mateorod; 5th December 2012 at 07:20 PM.)
#1  
Recognized Developer - OP
Thanks Meter 3,511
Posts: 1,977
Join Date: Nov 2011
Location: New Orleans

 
DONATE TO ME
Default [Utility][2.0]Auto-Patcher

We have moved support away from this thread and into the main thread at Android General. The info in the second post is accurate as of 12/3/12.

Development on the Auto-Patcher continues, I have just stopped adding Nexus 7 specific features as this device's users didn't express any interest.

If I could close the thread, I would. But if something tickles your fancy, come see us at the above link.
Support Beloko Games' source ports of Doom and Quake 1-3, Jedi Knight, etc.

He is hurting from piracy...I need Doom 3 on my phone, you guys. Buy them, ok?
The Following 11 Users Say Thank You to mateorod For This Useful Post: [ Click to Expand ]
 
mateorod
Old
(Last edited by mateorod; 5th December 2012 at 07:11 PM.)
#2  
Recognized Developer - OP
Thanks Meter 3,511
Posts: 1,977
Join Date: Nov 2011
Location: New Orleans

 
DONATE TO ME
The Auto-Patcher 2.4.7
(Bismuth)

by pastime1971 and mateorod.
Trouble with Android 4.2? See here.

Current version and changes: Auto-Patcher 2.4.7 is out

Improvements include:
  • Pdroid for CM7, after a long battle, should finally be working
  • Internal script improvements.

Pdroid and Pdroid2.0 are incompatible and cannot be applied to the same rom!. If you are switching from one Pdroid to another, go to data/system and delete everything with privacy in the name.

The Auto-Patcher


The Auto-Patcher is a smali patching utilty that can be used to port mods, framework changes, themes and more across ROMs and devices by patching files and outputting a flashable zip.

We hope that this tool can help developers get their work to a wider audience and help users easily try programs that may call for skills or time they don't have. In one command, you can have all the power and utility of the mods/programs listed below, with no specialized knowledge.


Supports
  • ClockworkMod and Aroma installers
  • Cyanogen [CM7, CM9, CM10] (cm)
  • AOKP (aokp)
  • AOSP (aosp)
  • ParanoidAndroid (pa)
  • Evervolv (aosp)
  • ...and many others.

We do not support system.img, Odexed roms or Sense, TouchWiz or other OEM-skinned AOSP at this time.

If you have a build environment and build for TW or Sense, consider joining the team. Additionally, Quarx's CyanogenMod roms are not currently supported. A maintainer would be welcomed for that as well.


Supported Platforms

The Auto-Patcher runs on Linux and MacOSX terminals. Project contributors kobik77 and wbedard have helped us add Windows support as well.

Kobik77 has developed a stand-alone GUI for Windows called ApG. The most current version of ApG can be downloaded here. Note: ApG has some trouble with some virus software. It has no elevated permissions and is demonstrably safe. Here are some anti-virus tips from long-time user Grayfoxmg1


The Available Mods


Unless there are hardcoded reasons they conflict, all of the mods below can be combined, so you could get all of the programs and tweaks in one shot. If you use other premade patches or zips, you would have to choose between them.

The Auto-Patcher is the only non-destructive way to get these enhancements, short of building your own ROM and/or applying your own changes to the code.

The name is paranthesis is the MODS for use on the command-line. See usage below if that confuses you. It isn't hard, really.
  • PDroid (pdroid):
    • The one where we make our bones, PDroid is an advanced privacy app, one that allows you to deny system and user apps permissions they usually need to function. PDroid changes the information passed by permission requests instead of denying it like other apps. That means no FC's or misbehaving apps. PDroid allows you to set custom phone numbers or IMEIs as well. PDroid is only officially supported through GB. The Auto-Patcher makes it an option for ICS and Jellybean ROMs as well.
  • PDroid 2.0 (pd2.0): NEW!
    • CollegeDev's update of the core PDroid app and framework. There is a separate app you will need as well. You can get the app and read about PDroid2.0 and get the .apk here. This mod is only for Android 4.1.2+
  • V6 Supercharger (v6supercharger):
  • Insecure Boot.img (insecure):
    • This should work for just about every ROM, giving you true root shell access, enabling adb push of system files and adb remount commands. It can truly save your bacon if you are the type to play with system files and flashing. Some ROMs come with this feature already, so if this patch fails, it just means you already have one.
  • Secure boot.img (secure):
    • The opposite of the above. There are advantages to both, and what you want depends on what you do. I haven't seen any other way to secure a boot.img, with so many roms now having insecure by default.
  • Swap internal and external storage (external_internal):NEW!
    • This swaps your app storage from an sdcard to internal storage. This allows you to use all apps, even w/o an sdcard!
  • TabletUI (tabletUI):
    • Based on findings by barmullio, this allows users of the "Phablets" UI to switch from the stock phone or phablet layout to Tablet user interface. I personally like the tab interface because it allows me more regular access to the status bar. Lockscreen rotation has been enabled as well. Confirmed working on all devices!.
NEW
Mods for Wifi-only Tablets.
  • 3G Dongle (3gdongle):
    • This allows users of Wifi tabs to use their 3G dongles on their tablets, allowing them to have data on the go. This is a pretty involved mod, and the development is still on-going. We would like to stress that you read up at developer trevd's thread for best practices and troubleshooting. A growing list of confirmed supported dongles can be found there as well.
  • Google Voice (voice):
    • As popularized by bongostl, this allows users to use Google Voice to make outgoing calls. It changes your framework-res to recognize that the tablet is voice capable. This allows you to recieve calls as well and has other call quality advantages over things like GrooveIP.
  • OTG support- Coming SOON.

Usage

Designed to run on Linux, OSX and Windows (using Cygwin)
  • The Auto-Patcher has become completely open-source, and no one has gotten more out of that than our Windows users. kobik77 and wbedard have come aboard and brought Windows support to our formerly *nix-only utility.
  • Kobik has also crafted the first Auto-Patcher GUI! Here is his post with download link and features description (including auto-update from Github!)

Requirements for execution: Java (JDK), cpio, patch

Help
For usage and patch availability, place a rom.zip into this directory and try
Code:
$./auto_patcher <ROMNAME>.zip -h
This will check our various dependancies and provide some useful information. It is not the prettiest thing in the world yet, we're working on it...

To patch a ROM
Code:
./auto_patcher <ROMNAME>.zip <MODS>
example:
Code:
./auto_patcher cm10-encore-fat-tire.zip pdroid,tabletUI
You can have any number of mods applied at the same time, just separate them with a comma and NO SPACES!

The only thing you may need will be a romtype. The patcher will detect and display the ROMTYPE it thinks you have. If the patches fail, just append your ROMTYPE to the end of the command. The only available ROM types are:
  • pa
  • cm
  • aosp
  • aokp
Don't worry if your rom doesn't have a type; most roms in XDA are derivatives of one of the above, and tell you which one in their release threads.
Code:
./auto_patcher pa-2.23-mateorod.zip pdroid pa
98% of the time, that is all you need to know!


If you would like to see some of our more advanced usage, please see the third post.

Debugging
  • There is never any need for any wiping or restoring of a backup! If you encounter any problems, simply reflash the generated restore.zip or your ROM over the install, preserving all data and settings!
  • In the Auto-Patcher directory you will see a logfile that is generated with each run of the program. Please attach the entire logfile in order to get the best support we can offer.

Current and past versions available at our download page on techerrata
Download
You can also clone from our github. See the README because there is actualy a lot extra there.

Contributors
pastime1971
mateorod
kobik77 (ApG developer/cygwin maintainer)
wbedard (cygwin/AOSP pd2.0 maintainer)

Maintainers
FFU5y (Maintains pd2.0 AOKP)
KickNGuitar (OSX testing)
poncik (Evervolv maintainer)

Thanks
eyeballer and kevank with Team Win for web hosting
Svyat
CollegeDev
tonyp
krylon360
inportb
chainfire (for faapt)
zeppelinrox
trevd
rathian, and TheMatrix2000 (for OSX testing)
romracer and greenblue for 4.1.2 fixes
ninno_mx

The Auto-Patcher is a fully open-source utility, and we welcome new contributors.

If you are a developer, themer or script writer who has code-level edits you walk your users through, let us know and we can get together and create a package for you. A message to developers is here, which also touches on our donation policy.
Support Beloko Games' source ports of Doom and Quake 1-3, Jedi Knight, etc.

He is hurting from piracy...I need Doom 3 on my phone, you guys. Buy them, ok?
The Following 6 Users Say Thank You to mateorod For This Useful Post: [ Click to Expand ]
 
mateorod
Old
(Last edited by mateorod; 17th September 2012 at 05:03 AM.)
#3  
Recognized Developer - OP
Thanks Meter 3,511
Posts: 1,977
Join Date: Nov 2011
Location: New Orleans

 
DONATE TO ME
changelog

12.05.00. (v0.1)
# ...........
# 2012.05.12. (v0.2) allows user to specify a different version of patches
# 2012.05.13. (v0.3.0) force "patch -N", remove temp upon failure, generate log output
# 2012.05.13. (v0.3.1) revised the generation of updater-script (SGS2)
# 2012.05.15. added AOSP patches
# 2012.05.15. added crespo-aosp patches, added device-specific patching if patch exists
# 2012.05.15. remove restore.zip upon failure
# 2012.05.15. (v0.4.1) added CM7 (GB) patches
# 2012.05.18. (v0.4.2) added checking for tool commands
# 2012.05.21. (v0.4.3) apply device-specific patche only when it is specified
# 2012.05.26. added task title to log
# 2012.05.31. (v0.4.4) CM9 patches updated, crespo-aosp added
# 2012.06.04. (v0.4.5) added checking tools and rom, added aroma installer support, add patch outputs reroute
# 2012.06.15. CM9 patches updated
# 2012.06.16. (v0.4.6) AOKP patches updated, patch versions restructured
# 2012.06.17. (v0.5.0) patcher script reorganized, removed build.prop
# 2012.06.17. (v0.6.0) auto patcher script for pdroid and v6 patches
# 2012.06.19. (v0.6.1) add patches for CM7.2 Final
# 2012.06.20. (v0.6.2) updated CM 7.2 patches
# 2012.06.23. (v0.6.3) fix symlinks
# 2012.06.26. (v0.6.4) add CM7 nightly patches (0618 or latest). Removed faulty 7.2 patches (0619)
# 2012.06.27. (v0.6.5) added new CM9 patches (20120626)
# 2012.06.27. (v0.6.6) added CM7 nightly patches (20120625) (finally!)
# 2012.07.02. (v0.7.0) Redid AOSP/AOKP; add Windows support (using Cygwin). Thanks kobik77!
# 2012.07.06. (v0.7.1) updated CM9 patches (20120706)
# 2012.07.08. (v0.7.2) updated AOKP (20120707) and CM9 (20120708) pdroid patches
# 2012.07.11. (v1.0.0) reworked script works on Linux, Mac OSX, and Windows (on Cygwin);
# " " added new ICS/JellyBean support for the new V6-Supercharger
# 2012.07.18. (v1.0.1) updated pdroid patches for CM7/CM9 (20120718)
# 2012.08.06 (v1.5.0) updated smali/baksmali binaries to 1.33
# 2012.08.06 Added Pdroid/V6supercharger support for CM10 Jellybean!
# 2012.08.06. (v1.6.0) added aokp-jb patches for pdroid/v6supercharger, script update
# 2012.08.17. (v1.9.5) Added support for pdroid_addon, by CollegeDev.
# Added insecure boot.img mod
# Added support for aosp-jb (This needs testing, and may not be a wide patch due to large variation between AOSP roms.)
# -Please report all experiences!
# Updated all v6supercharger patches w/new edits to ProcessList
# Major script overhaul in preparation for additional mods!
# 2012.08.20. (1.9.6) Conditional support for Official cm10 and aokp-jb builds
# 2012.08.23. (1.9.7) Final/confirmed pdroid support for Official CM10 and AOKP-JB
# 2012.09.04 (1.9.8) Bundled cygwin-compatible tools (original was corrupt).
# For Cygwin, replaced h2b function with simple bash math
# conversion (req'd for compat w/ Cygwin tools).
# 2012.08.26. (2.0.0) Added .apk patching
# Added 3G Dongle support for Nexus 7
# TabletUI support for Nexus 7 (maybe more)
# Google Voice support for Nexus 7
# mods are 3gdongle, tabletUI, voice, or Nexus7 (for all)
# Added provisional file copy menu to widen patching base
# 2012.09.11. (2.0.1) Cygwin support fixes
# 2012.09.11. (2.0.2) Bugfix for 3gdongle (all)
# 2012.09.16. (2.1.0) Significant restructuring of core operations; added edit text file
# Fix for "method-cap" errors in pdroid.
Support Beloko Games' source ports of Doom and Quake 1-3, Jedi Knight, etc.

He is hurting from piracy...I need Doom 3 on my phone, you guys. Buy them, ok?
The Following 2 Users Say Thank You to mateorod For This Useful Post: [ Click to Expand ]
 
tonyp
Old
(Last edited by tonyp; 9th September 2012 at 08:44 PM.)
#4  
tonyp's Avatar
Recognized Developer / Contributor
Thanks Meter 33,283
Posts: 4,763
Join Date: Feb 2011

 
DONATE TO ME
reserved

Nice to see you and pastimes and your work here as well - and I absolutely love the new Nexus 7 additions as i finally got mine as well


Btw: Are there any news on decompiling the jars and applying these fixes on an android device, without having to use the PC?
It's not important, I'm just interested.
> Paypal Donate link <.
Donations are never expected or required but always appreciated!

LG P990 Complete Baseband Overview Thread
My LG 2x download folder: http://tonyp.basketbuild.com
FREE HQ PORN App


Can you give us an ETA on when you'll start giving out ETAs?
The Following User Says Thank You to tonyp For This Useful Post: [ Click to Expand ]
 
Cetin
Old
#5  
Cetin's Avatar
Senior Member
Thanks Meter 20
Posts: 232
Join Date: Nov 2007
I will try this patcher for getting 3g dongle (ZTE K3565-Z) support.
My config is ParanoidAndroid with franco kernel.
What is my first step?
How do I get my whole rom with kernel into my mac os system? Can I take the nandroid (I dont think so, because I cannot flash zip back again)?
long time xda user
 
mateorod
Old
(Last edited by mateorod; 10th September 2012 at 03:07 AM.)
#6  
Recognized Developer - OP
Thanks Meter 3,511
Posts: 1,977
Join Date: Nov 2011
Location: New Orleans

 
DONATE TO ME
Quote:
Originally Posted by Cetin View Post
I will try this patcher for getting 3g dongle (ZTE K3565-Z) support.
My config is ParanoidAndroid with franco kernel.
What is my first step?
How do I get my whole rom with kernel into my mac os system? Can I take the nandroid (I dont think so, because I cannot flash zip back again)?
Well, that is interesting, actually. There are a bunch of ways that you could get the update.zip on your tablet, but there isn't support for custom kernels yet. You can patch any rom, but if the patch needs to change the boot.img, flashing a new kernel will remove that part of the patch.

I think I know a way to add it though. I will try to add custom kernel integration to the next update.

But you CAN get the 3gdongle working on your rom, just put it through the patcher and transfer it through adb or email or dropbox.

Code:
./auto_patcher paranoidandroid2.2.1.zip 3gdongle
replacing paranoidandroid2.2.1 with the actual name of the zip.

The stock kernel is pretty awesome, bttw. But I think I can add this to the autopatcher. It is needed anyway.

Edit: I must be really tired. You can do this. The kernels are distributed as boot.imgs. Just open up the kernel installer zip, take out the boot.img. Then replace the boot.img in whatever rom you are using.

Then run it through the Auto-Patcher, using any options you like.

You will ONLY need to replace the boot.img of your rom if you are applying the 3gdongle, insecure,secure, or pdroid-aosp-jb modtypes and would like to use a custom kernel that doesn't come bundled with your rom.

I will add some version of this to the autopatcher's next update though, so it is easy to do from the command-line/GUI.
Support Beloko Games' source ports of Doom and Quake 1-3, Jedi Knight, etc.

He is hurting from piracy...I need Doom 3 on my phone, you guys. Buy them, ok?
 
mateorod
Old
(Last edited by mateorod; 10th September 2012 at 07:18 AM.)
#7  
Recognized Developer - OP
Thanks Meter 3,511
Posts: 1,977
Join Date: Nov 2011
Location: New Orleans

 
DONATE TO ME
Quote:
Originally Posted by Cetin View Post
I will try this patcher for getting 3g dongle (ZTE K3565-Z) support.
My config is ParanoidAndroid with franco kernel.
What is my first step?
How do I get my whole rom with kernel into my mac os system? Can I take the nandroid (I dont think so, because I cannot flash zip back again)?
If you need more info than that, you can ask and I will be more specific, I just reread your post and realized maybe I wasn't thorough enough...

Update Because this seemed so vital to the Nexus 7 community (because we have everyone and their mother with a custom kernel here...) I went and looked through the installers.

It looks most people: faux,_motley, clemsyn et.al. use the AnyKernel updater. Those updaters use some of the same binaries we do to preserve ramdisk edits. They don't want to overwrite mods of this sort any more than we want them to.

A couple devs, franco and some new one from today, Thoravuuk or somethin', just package a boot.img. In those cases you will need to place the custom boot.img (and title it boot.img) in the ROM you would like to patch with the Auto-Patcher.

In all cases, there is existing methods to preserve all support and features with nothing more than winzip or any other archive manager. Drag and drop.

So we will see how we end up handling this in the Auto-Patcher in the future. There are a bunch of methods to distributing kernels which make it tricky, but the more responsible Android devs already are prepared for the fact that you may have modified your ramdisk and want to keep it that way. Using Koush's AnyKernel is a great way to accomplish that.

For franco you will habe to briefly drag and drop for now.
Support Beloko Games' source ports of Doom and Quake 1-3, Jedi Knight, etc.

He is hurting from piracy...I need Doom 3 on my phone, you guys. Buy them, ok?
 
mateorod
Old
#8  
Recognized Developer - OP
Thanks Meter 3,511
Posts: 1,977
Join Date: Nov 2011
Location: New Orleans

 
DONATE TO ME
Quote:
Originally Posted by tonyp View Post
reserved
Just saw this part, tonyp. I hope this means you might have something planned for us...
Support Beloko Games' source ports of Doom and Quake 1-3, Jedi Knight, etc.

He is hurting from piracy...I need Doom 3 on my phone, you guys. Buy them, ok?
 
Cetin
Old
#9  
Cetin's Avatar
Senior Member
Thanks Meter 20
Posts: 232
Join Date: Nov 2007
Hey man, thanks for your big support!
I will try like you said.
As I understand correctly the boot.img keeps untouched by your patch. So I can patch my Rom flash the zip and use any custom kernel by flashing it with fastboot flash boot command?!

NEXUS 7
long time xda user
 
Cetin
Old
(Last edited by Cetin; 10th September 2012 at 03:12 PM.)
#10  
Cetin's Avatar
Senior Member
Thanks Meter 20
Posts: 232
Join Date: Nov 2007
I tried patching but there´s is a problem:


How to choose the right file and which one is it?

Code:
### applying boot.img patch ###
... applying init.dongle.rc patch ...
... applying init.rc patch ...
The text leading up to this was:
--------------------------
|diff -Npru ramdisk/init.rc 3g-ramdisk/init.rc
|--- ramdisk/init.rc	2012-08-27 00:25:58.749201521 -0500
|+++ 3g-ramdisk/init.rc	2012-08-27 00:24:51.012865613 -0500
--------------------------
File to patch: 3g-ramdisk
3g-ramdisk: No such file or directory
Skip this patch? [y] n
File to patch: 3g-ramdisk/init.rc
3g-ramdisk/init.rc: No such file or directory
Skip this patch? [y] n
File to patch: init.dongle.rc
1 out of 1 hunk FAILED -- saving rejects to file init.dongle.rc.rej
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!! error: failed patching init.rc
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
long time xda user

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes