# Working Pdroid Patches [currently AOKP(toro+maguro), Stock AOSP, cm9]



## Joesyr (Feb 7, 2012)

I'm using this thread to share working pdroid patches I've got for various Galaxy Nexus roms. This was made using the patcher being developed here (patcher is in the 4th post). The patcher is currently linux-only, but will also work with cygwin in windows. I'm posting the finished flashable zip here as a convenience to anyone who can't use it themselves. Please note that I am not one of the people actively developing this patcher, just a willing tester who happens to own a toro Gnex.

If you don't know what Pdroid is, this is the thread for it on xda. Basically, it lets you deny permissions to apps on a per-permission basis, without risking apps crashing. Same basic idea as LBE privacy guard, but in my opinion executed better. Plus, open source is always a plus. Even though the patcher there won't work for us yet, check the official thread. You'll need to download the app from the market and follow the same instructions, just using the zips I'll post here (or make your own).

I'll include a revert.zip for anything I post here, but please note that I take no responsibility for anything that happens to your phone. Make backups before flashing things. Try TWRP if you haven't, it's faster at backup/restore than CWR and does a bunch of other neat stuff like compressed backups and queued zip flashing. Also, in case of things breaking, please note that these revert zips are (1) only going to work if you are running the same rom used to create the zip and (2) just a slimmed down version of the rom's zip. What this means is that if you flash a pdroid zip and you need to revert, the surest thing to do is just re-flash your rom without wiping anything.

I'll try to update this thread as I get more patches working. Here's where my own experiments stand:
Link to my dropbox folder with files, notes below
Working patches:
-AOKP b39 (toro):
-AOKP b39 (maguro):
-Stock AOSP(+root, busybox): Patched build: 2012/06/03
-CM9 Nightly: Patched build: 2012/06/19
-Paranoid Android v1.4a:
--Note: Not sure if these will automatically fail with later nightlies or only when something relevant is updated in the rom. Feel free to try, just reflash your rom if it bootloops.

Not working (yet):
-Liquidsmooth 1.5rc4
-Slim ICS 4.0

Unless otherwise noted, these are all for the toro (verizon) Galaxy Nexus. It's pretty quick and easy for me to make new patches so feel free to request something. But please be aware that sometimes it's a few days between when I can devote any time to this and don't be offended if I don't reply to you right away.

Just to reiterate, all you need to do for this is download the "Pdroid Patch Zip" file for your rom, flash it in recovery, and download Pdroid from Google Play.

Finally, be aware that the first boot after flashing can take a very long time, without any indication like the "Android is Upgrading..." screen. Don't assume it's bootlooping! Seriously, put the phone down and do something else for a bit. Anything in the tested section I've either personally flashed on my phone or someone else reported as working. If you're sure you're getting a bootloop on a clean install, my only advice is to do a full revert to stock and re-unlock/root/etc and see if it works then. Though rare, it is possible for something to be corrupt that persists across the usual "clean install" routine.


----------



## cdkg (Jul 1, 2011)

Holy Santa Claus Shit!!! 
I like LBE but this is soo much better!

Sent from my Galaxy Nexus using Tapatalk 2


----------



## cordell (Sep 8, 2011)

Interested in this, but running either Liquid or Slim roms. Since Liquid seems to loop maybe when I have time I will try it for Slim. Thanks for the info!


----------



## Joesyr (Feb 7, 2012)

cordell said:


> Interested in this, but running either Liquid or Slim roms. Since Liquid seems to loop maybe when I have time I will try it for Slim. Thanks for the info!


I actually gave slim a quick run through the patcher last night because it seemed like a good candidate for the AOSP patch, but I think the nonstandard packaging of the rom may have thrown it (patcher didn't work). I'm pretty sure all the files that need patching are in the Base zip, which is interesting, but I might dig into it a little more today, too. Seems like a good learning opportunity.
Edit: Actually, the way that I thought it would have gone was true; only build.prop is in Slim's "essentials" packages. I got a patch that claims to be working just by copying it to the base zip and using that aosp patcher. Will upload it to my dropbox in a bit and update the OP.


----------



## Joesyr (Feb 7, 2012)

Quick update, I put up a maguro for AOKP, and I also updated the OP quite a bit since I last posted. Finally got around to testing the patches I made; getting better at reading the patching process as well to tell when a patch will work before flashing it, too.

At far as updates go, I don't really intend to follow the cm9 nightlies as I don't run them myself. I'll probably continue to try new versions of AOKP and paranoid android as they come out. I'll continue to try the roms that don't patch yet with new versions of the patcher as they are released.


----------



## cdkg (Jul 1, 2011)

Your the man! Please keep up the awesome work. I'm surprised that this isn't getting more recognition/attention

Sent from my Galaxy Nexus using Tapatalk 2


----------



## Syndicate0017 (Jan 21, 2012)

This is excellent!

Sent from my Galaxy Nexus using Tapatalk 2


----------



## Joesyr (Feb 7, 2012)

Updated Paranoid android to v.9b, tested as working.


----------



## cdkg (Jul 1, 2011)

Great job! Love being able to set the rules for the apps on my phone

Sent from my Galaxy Nexus using Tapatalk 2


----------



## cdkg (Jul 1, 2011)

Any chance we can see an update for pdroid so it can be used on aokp b37?


----------



## Joesyr (Feb 7, 2012)

cdkg said:


> Any chance we can see an update for pdroid so it can be used on aokp b37?


Updated AOKP patch to b37, I'll throw up a maguro one in a little bit too.

In other news, I might rewrite the OP at some point to reflect where all of this stands, since the revert zips are nice to have but technically redundant on just reflashing a rom, and I'm fairly confident that I can read the logs to know whether a patch is working or failed without testing.

Also I plan to try jellybelly's nearly-stock AOSP rom soon mostly as a test for the AOSP patcher. That will either be in a few minutes or in a few days, that's pretty much how my availability to tinker with this works these days.


----------



## robjective (Jan 1, 2012)

Just to save someone else the trouble, the CM9 nightly patch for 5-18-2012 does not work for 5-27 or 5-29. You will be stuck on the boot animation. Pull the battery, then hold volume up and down while you hold power, then use volume up and down to get to recovery option. I don't know if the revert fixes it because I just reflashed the whole ROM on top.

@ Joesyr, do you mind updating the CM9 patch? I tried to do it myself, but the Linux patcher for ICS is not cooperating for me on Ubuntu Live CD or Cygwin. I even tried some other technique using Botbrew, but that didn't work for me either.

Thanks


----------



## cdkg (Jul 1, 2011)

Thanks for posting your findings for CM9 I was just about to attempt an install on 2012529.

Sent from my Galaxy Nexus using Tapatalk 2


----------



## Joesyr (Feb 7, 2012)

Hey, sorry I've been spotty replying to people here and in PMs, been very busy this last week.

So, I've found that the current cm9 patch isn't working with the latest cm9 builds and needs to be updated. But in case this hasn't been clear, I'm not one of the developers of this project, just a volunteer tester posting my results. The relevance of this is that while I enjoy taking this apart and trying to figure out how it works, I'm not at the level where I can effectively address errors in the patcher itself. Maybe someday soon but not yet. That said, I still actively follow its development, so if a new patch is released it's on my agenda to try not-yet-working roms with it.


----------



## fcisco13 (Jul 26, 2011)

Thank you for this, working nice on aokp37

G NEXUS


----------



## Joesyr (Feb 7, 2012)

Edit whoops, hit quote instead of edit on the OP. Just adding in note on the cm9 patch being incompatible with latest nightlies. Hopefully it'll be updated soon, but follow the xda thread in the OP if you want to know when.


----------



## Joesyr (Feb 7, 2012)

Rewrote some parts of the OP again, and changed the setup to just link to my dropbox folder so I don't have to fiddle with links every time I update files. Phew, much easier to manage.

Oh also cm9 nightlies should be working again! I'll flash the latest nightly tonight to test if I get a chance but otherwise I expect this build to be working so let me know if you test it!


----------



## cdkg (Jul 1, 2011)

Flashing right now! You work is sooo appreciated!

Sent from my Galaxy Nexus using Tapatalk 2


----------



## cdkg (Jul 1, 2011)

AOKP B38: Patch works great 

CM9 20120603: Bootloops









Sent from my Galaxy Nexus using Tapatalk 2


----------



## Joesyr (Feb 7, 2012)

cdkg said:


> AOKP B38: Patch works great
> 
> CM9 20120603: Bootloops


Well, I patched the latest nightly just now and it looks clean so I'll throw that up. Without digging through the changelogs for the rom I can't really get a sense for whether it broke because somthing changed, or if each nightly changes something somewhere that will break the patch. Anyone have any experience using a cm patch I posted with a later nightly and it not breaking?

Either way I think I'll plan on a weekly cm9 nightly update schedule just to see if the patcher still works, more in between if I find myself with an excess of free time. Aka, if it's been a week since I updated anything feel free to bug me as I've probably just forgotten.


----------



## cdkg (Jul 1, 2011)

you're the man!

Sent from my Galaxy Nexus using Tapatalk 2


----------



## robjective (Jan 1, 2012)

Success!!! I built the patch from 20120610-CM9, flashed, and it seems to be working.

Installed 32 bit Ubuntu 12.04 in VirtualBox
Set up shared folder with D: drive
Dragged all files to the Ubuntu Desktop


```
6  sudo mkdir /media/vboxshared<br />
7  sudo mount -t vboxsf D_DRIVE /media/vboxshared<br />
8  cd Desktop<br />
9  ls<br />
10  tar -xvf jdk-7u4-linux-i586.tar.gz<br />
13  sudo mkdir /usr/lib/jvm/<br />
14  sudo mkdir /usr/lib/jvm/jdk1.7.0<br />
15  sudo mv ./jdk1.7.0_04/ /usr/lib/jvm/jdk1.7.0 (this step needs work--it creates an extra level of folders that I only knew how to fix by "gksudo nautilus" to get a GUI for copy and paste)<br />
16  sudo update-alternatives --install "/usr/bin/java" "java" "/usr/lib/jvm/jdk1.7.0/bin/java" 1<br />
17  sudo update-alternatives --install "/usr/bin/javac" "javac" "/usr/lib/jvm/jdk1.7.0/bin/javac" 1<br />
18  sudo update-alternatives --install "/usr/bin/javaws" "javaws" "/usr/lib/jvm/jdk1.7.0/bin/javaws" 1<br />
19  sudo update-alternatives --config java<br />
23  sudo update-alternatives --config javac<br />
24  sudo update-alternatives --config javaws<br />
33  sudo update-alternatives --install "/usr/bin/jar" "jar" "/usr/lib/jvm/jdk1.7.0/bin/jar" 1<br />
36  sudo ./pp/pdroid_patcher cm-9-20120610-NIGHTLY-toro.zip
```
Helpful page for JDK http://askubuntu.com...acle-java-jdk-7

This is only confirmed to work on my 20120610 CM9 toro. Flash at your own risk after you make a backup.
http://dl.dropbox.co...m9-20120610.zip
http://dl.dropbox.co...m9-20120610.zip


----------



## yarly (Jun 22, 2011)

Pdroid seems like a useful thing. I've been dreaming of doing something like that since I had an Android phone (since it was a feature ages ago when I had a blackberry). I mucked around with trying to abstract Pdroid out of the core Android source a bit by wrapping the changes it makes by renaming the classes it modifies and then having pdroid extend those classes and use the original name of the classes (basically doing an Adapter pattern via extending the original class and passing along the code after you do whatever you want on it and then doing some more afterwards). I got sidetracked by real life and haven't worked on it in a while, but if something like that could be worked out, it would prevent having to redo things so much every time a change is made.


----------



## blaineevans (Jul 11, 2011)

yarly said:


> Pdroid seems like a useful thing. I've been dreaming of doing something like that since I had an Android phone (since it was a feature ages ago when I had a blackberry). I mucked around with trying to abstract Pdroid out of the core Android source a bit by wrapping the changes it makes by renaming the classes it modifies and then having pdroid extend those classes and use the original name of the classes (basically doing an Adapter pattern via extending the original class and passing along the code after you do whatever you want on it and then doing some more afterwards). I got sidetracked by real life and haven't worked on it in a while, but if something like that could be worked out, it would prevent having to redo things so much every time a change is made.


Lost.









Sent from my Galaxy Nexus using Tapatalk 2


----------



## yarly (Jun 22, 2011)

blaineevans said:


> Lost.
> 
> 
> 
> ...


Basically the equivalent of instead of say having your friend do all the grilling one day and doing everything that's involved in it that could vary every time, you decide you'll prepare the meat for him (whatever it may be), then once you do what you need to with it, you pass it off to him to grill and when he's done with it, he gives it back to you to season it or add some buns you grilled up with it along side.

Mostly just a pattern where the guy in the middle (doing the grilling) doesn't care what you do with the meat before or what happens exactly afterwards (or what kind of meat it is, because it can all be grilled and all the custom work is done outside of his scope). You would be the wrapper class (the adapter) in this case and he would be the original class you are renaming and taking the place of and passing the work onto him after you did anything custom needed to it.

Just a random metaphor for it that popped into my head. Maybe I'm hungry...idk.


----------



## blaineevans (Jul 11, 2011)

yarly said:


> Basically the equivalent of instead of say having your friend do all the grilling one day and doing everything that's involved in it that could vary every time, you decide you'll prepare the meat for him (whatever it may be), then once you do what you need to with it, you pass it off to him to grill and when he's done with it, he gives it back to you to season it or add some buns you grilled up with it along side.
> 
> Mostly just a pattern where the guy in the middle (doing the grilling) doesn't care what you do with the meat before or what happens exactly afterwards (or what kind of meat it is, because it can all be grilled and all the custom work is done outside of his scope). You would be the wrapper class (the adapter) in this case and he would be the original class you are renaming and taking the place of and passing the new work that could vary onto him.
> 
> Just a random metaphor for it that popped into my head. Maybe I'm hungry...idk.


That makes more sense. I tried to follow the original post but couldn't keep up.

Sent from my Galaxy Nexus using Tapatalk 2


----------



## yarly (Jun 22, 2011)

If I lose someone that's interested in what I might randomly say, just have to tell me, lol. Something like Pdroid I was leaving that mostly for the OP to read when they're not busy, but I don't mind clarifying for anyone else who just wants to learn something. Anything programming in life can be related through the right metaphor imho (also the key to a good teacher/tutor I think as well)







. That and the best indicator that one really knows the topic they're talking about, they should be able to explain it to the average person that's truly interested in it given the time and attentiveness of the listener.

Also if the OP has some time, give me a PM or something. Perhaps we could work together on it.


----------



## deepflash (Jun 15, 2012)

hey could you please release a patch for the just released Paranoid v1.2a?
That would be awesome


----------



## Joesyr (Feb 7, 2012)

yarly said:


> hey could you please release a patch for the just released Paranoid v1.2a?
> That would be awesome


I would if I didn't just read that the current maintainer is compiling 1.3. I'll dl and try to patch that when it gets posted (within the day?). I think just about all of these are now out of date with their respective roms so I'll probably just do a batch together either tonight or tomorrow.


----------



## deepflash (Jun 15, 2012)

V 1.3? I guess u mean for galaxy nexus.. I now have 1.2a for SGS2. But I think they should be compatible?

Gesendet von meinem GT-I9100 mit Tapatalk


----------



## cdkg (Jul 1, 2011)

Can anyone confirm if PDroid is working with AOKP B39?

Sent from my Galaxy Nexus


----------



## deepflash (Jun 15, 2012)

There is paranoid 1.3  already installed it.. Now waiting for Pdroid 

Gesendet von meinem GT-I9100 mit Tapatalk


----------



## deepflash (Jun 15, 2012)

Paranoid Android 1.4 released.. If you could tell me how to create a Patch I would love to make the patches for the paranoid roms

Gesendet von meinem GT-I9100 mit Tapatalk


----------



## Joesyr (Feb 7, 2012)

deepflash said:


> Paranoid Android 1.4 released.. If you could tell me how to create a Patch I would love to make the patches for the paranoid roms


Updated to latest builds.

Paranoid android doesn't patch correctly anymore, which I assume means that it's been sufficiently distinguished from its cm9 base to introduce errors on that front. Might poke around with some of the recent builds I didn't get to try and see if I can figure out why, but chances that I'll get to the bottom of that are low right now.

Deepflash, check the links in the OP. You need either a linux environment or cygwin (linux emulator) installed for windows, then you just run a simple command to generate a patch. I've helped people troubleshoot a number of things both here and on xda (thread link) so if you hit any errors check through these threads, otherwise I can help you with particulars as well.


----------



## deepflash (Jun 15, 2012)

I set up Virtual Box with Ubuntu 12.
Everything fine so far but when applying the patch I get the error "failed extracting tools".
Any help with this?

the exact output is this:

[email protected]:/media/sf_patch$ sudo ./pp/pdroid_patcher para.zip cm9
### verify tools ###
### verify ROM ###
### unzip patch tools ###
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!! error: failed extracting tools !!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

! please refer to /media/sf_patch/log20120620225727 for any debugging

! patching failed.
! it may be possible to patch /media/sf_patch/para.zip using other patch version

rm: cannot remove `/media/sf_patch/tmp20120620225727/updatecert.pem': Operation not permitted
rm: cannot remove `/media/sf_patch/tmp20120620225727/updatekey.pk8': Operation not permitted
pdroid 1.32 smali patcher v0.5.0 (patches 2012.06.16.)

usage: ./pp/pdroid_patcher ROM.ZIP [PATCHTYPE] [PATCHDATE]

optional [PATCHTYPE] can be cm9, aokp, etc.
optional [PATCHDATE] can be specified to use older patch versions.
try "./pp/pdroid_patcher ROM.ZIP -h" to see what is available


----------



## deepflash (Jun 15, 2012)

ok solved it.. I forgot to move the files from the shared folder to a "normal" linux folder








will report back if that works or not on my phone.


----------



## deepflash (Jun 15, 2012)

so works for me with Paranoid v 1.4a on SGS2.
Where did you encounter problems?

My patch: http://db.tt/6g94jgJn


----------



## Joesyr (Feb 7, 2012)

deepflash said:


> so works for me with Paranoid v 1.4a on SGS2.
> Where did you encounter problems?
> 
> My patch: http://db.tt/6g94jgJn


Crossposting from xda on account of there's no good way to have the same thread on two forums, but anyway, I'm guessing you just ran the aosp patch? I did that just now and it worked just fine. I guess I just got comfy in the assumption that cm9 was the right patch for this rom based on prior versions. Maybe the aosp patch just contains a few more tweaks that custom roms are prone to need than the cm9 patch at this point.

Edit: Huh... in the process of generating logs I can use as a workspace for poking around in the code, I just found that running cm9 patch creates a working output as well. Without my original logs to check, I guess I'm chalking the entire thing up to human error on my part. Must have done one thing and thought I was doing another.


----------



## cdkg (Jul 1, 2011)

AOKP B40+PDroid=Beauty
Can hardly wait
Sent from my A100


----------



## deepflash (Jun 15, 2012)

PDroid-Patch for ParanoidAndroid v1.5a: http://db.tt/6NMukgHZ
(made with latest Auto-Patcher 02/07/2012)
Restore-Patch: http://db.tt/a7MOBoNj
Works stable for me.


----------

