yashsingh1/xdaforums huggingface dataset:
[LG Optimus 2x] mateorod:
c-pimp

My man! Thanks. And Maguro is a great choice, I really appreciate you making that happen.

Okay, so I made the patches and they are in the box pastime.

I updated the patcher, but all I did was remove the questionable current AOSP and replace them with the maguro patches from today. If you look in the zip, you'll see the aosp patches were modified today. The ones in the obsolete folder that I believe were made from the original maguro builds are still there.

And let me just mention that I have had the opportunity to use the patcher a bunch over the last several days, up to and including having to specify the obsolete patches and everything. I think it works like a charm.

There are a lot of devices that have builds of things like CM9 reloaded that build on like a bi-weekly or longer schedule. Those ROMS still use our original patches, so they ability to try bunches of patch sets is real useful.

I am going to try and add to the READ_ME and the echo output though, just to try and give the users a list of their options, patch wise. Maybe a help?

Anyway, it works great, is what I am saying.

With new AOSP patches (only change)
[LG Optimus 2x] c-pimp:
here is the crespo aosp files patched and unpatched...

busy day today on my bday lol....

thanks again for everything mateorod you been helping me alot and u too pasttime !

after this im probably done for the night... time to eat!

catch back up with you guys tomorrow !
[LG Optimus 2x] xd4d3v:
Thanks for the work guys.

How do I install this on my Nexus S CM9?

Patched or unpatched?

I tried flashing with CWM but got aborted.

thanks
[LG Optimus 2x] mateorod:
No these aren't flash able zips. They are packs of system apps we are using to make aosp patches (hopefully).

Look on the fourth post of this thread. There is an auto-patcher. Do you have Linux? If you only have windows, install cygwin and try it inside of that.

Cygwin allows you to run Linux programs inside windows.

All you need to patch your cm9 ROM is a copy of your ROM and the auto-patcher. It will create a flash able Pdroid.zip.

If you can't figure it out, let us know and we'll figure something out for you.

Edit: did you see my response to your earlier post?
[LG Optimus 2x] pastime1971:
sorry that i haven't answered sooner.

as you may have guessed, i am swamped at work these days. :mad:

it is certainly not a bad idea.

first of all, svyat's GB patcher 1.32 is causing some issues.

secondly, it makes our patcher a universal patcher, which is quite nice.

i wonder if there is a good way to figure out GB vs. ICS (for any ROM).

i will see what i can dig up.... :D
[LG Optimus 2x] mateorod:
Hey, man. I use it in my packages (EDIT: said patches. oops)

Do you see the above code?;)

Should work fine. We could put a wild card after the 7 if we find the patches are wide enough. Or just make another for 7.1

Put that above the romanager getprop we already have, and nest the patching below.

Edit 2: ohsnap, you mean for aokp and such. I'll look as well. carry on, good sir. I should know you already were on top of it...

Edit 3: Here are the crespo patches. I diffed them against the maguro ones from this morning, and they have some differences, but mostly cosmetic, and nothing in the ServerThread file that seems to still be giving us trouble with the slimROM.

My advice is to try the patcher like it is with the newest maguro patches as the standard AOSP patches. Let's test that out on some other walk-ins with AOSP and maybe contact the slimrom guys. maybe they have mixed and matched, or something? I haven't been able to find a patch set yet that patches it, but we maybe I missed something.

Most of these custom roms tend to be little more than dragging files from one rom to another, very little actual coding changes from what I can see. Maybe slim does mess with the code, but we could still ask.

Oh yeah, pastime, they are in the 5-15 folder. I am putting them up in case anyone else wants to try them on their rom.
[LG Optimus 2x] pastime1971:
@ mateorod,

man, you are flying... :D

i updated patches (not crespo one yet) http://www.mediafire.com/?g4gpnjyaxm7fkkf

i moded patch script so that it checks for ro.build.version.release for GB/ICS

for now, if the rom is GB, it will try to patch gb-*.patch (which does not exist yet)

if i remember correctly, svyat's patch works pretty well on most roms. my hope is that CM7 patches should work on any rom. (if not, we can branch it out as well.)

as for crespo, i am thinking of applying a device-specific and rom-specific patches if it exists as follows:

1. determine $DEVICE from ro.product.device from build.prop

2. determine $ROM

3. check for $DEVICE-$ROM-framework.patch. if it exists apply them. if not apply $ROM-framework.patch instead.

edit: are crespo-framework.patch & crespo-services.patch supposed to empty files ?
[LG Optimus 2x] mateorod:
It's the meth, not me...

Those patches are in the box. I can put them in if you need, though. They're in the cm7 folder.

This patch has worked for a bunch of kangs in the little while I have tested it. It would be nice if it was that wide

That looks good. I think we may have to do just that, depending. Let's get it to where CM7 and the two AOSP patches we have are available. I am going to redo the READ_ME tomorrow, and I may add a few more lines of user instruction, maybe listing their patch options after a fail for instance.

Looks good. I would hate for us to have to make a billion AOSP patches, though. I am hoping that the two we have will make a dent, and that most of our trouble was using patches from before that irritating repo change.
[LG Optimus 2x] phroenix:
Hi, I tried the patches from post #394 but wound up bootlooping my xperia. I've attached the log if you get a chance to see it perhaps you could help me out?

Thanks

edit: got it working on this http://xdaforums.com/showthread.php?t=1636501 rom

by using obsolete/cm9...

Great work from all of you involved, thank you very much!

Special mention to mateorod for your positivity & patience
[LG Optimus 2x] mateorod:
Sweet! Good work getting it done! I have been intending on improving the end-user output to more completely layout the options, but mi am glad you were able too navigate it!

Also, keep your eyes on Botbrew +1. I made debian packages for you last night, actually. So mid you install the new dpkg Botbrew, should the bootstrapping issue be resolved, then no can support your later builds within Botbrew.

Good work and thanks .
[LG Optimus 2x] kangkong!:
Any progress on stock roms?
[LG Optimus 2x] mateorod:
Go try it. We have some AOSP patches in there. Might work and it certainly won't hurt. If you are not used to looking at patch output, just open the logfile that is generated while running the patcher.

The current version of the auto-patcher is on the fourth post of this thread. Good luck. Flash the Pdroid.zip if you see no "hunks failed" in the log.
[LG Optimus 2x] pastime1971:
universal patcher

ok. now we are one step closer to a universal patcher.

patches for CM7 has been added, and patching process goes without hiccup. (will need to flash it and test though)

patcher 0.4.1 at http://www.mediafire.com/?6cvpvcghxsacks6

post #4 has been updated.
[LG Optimus 2x] cashmundy:
Medafire patcher link is "invalid/deleted". Slowly setting up a build environment, thought I'd have a look. I'm trying Fedora 64-bit these days (usually I run Debian) and seems to be less trouble to set up an Ubuntu virtualbox and do it there than natively.
[LG Optimus 2x] mateorod:
If it helps your confidence, I have now applied those patches on nearly a dozen roms without a failure. Although they were built from a ROM that does it's level best to be the smallest ROM it can (I think it is 74 mbs, now). I am not sure if that is a good thing or a bad as far as wider net patching is concerned.
[LG Optimus 2x] giliath:
seems not work on galaxy nexus cm9（maguro）？

As a noob I tried several times and several patcher version，but still not work...

IT shows like this:

### unzip tools ###

### unzip rom ###

### patch cm9 ###

cp: 无法获取"system/" 的文件状态(stat): No such file or directory

### create updater script ###

./pdroid_patcher: line 129: jar: command not found

./pdroid_patcher: line 137: jar: command not found

### create restore.zip ###

./pdroid_patcher: line 144: java: command not found

mv: 无法获取"signed.zip" 的文件状态(stat): No such file or directory

### decompile framework ###

### apply core.patch ###

### apply services.patch ###

### apply framework.patch ###

### apply preloaded.patch ###

find: `*.jar.out': No such file or directory

find: `*.jar.out': No such file or directory

### rebuild services.jar ###

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

!error: !!! failed services.jar !!!

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
[LG Optimus 2x] pastime1971:
Sounds like you are missing JAVA on your system.

In particular, jar command.

It's been a long time sjnce i installed them, so i dont remember what needs to be installed.

Can someone confirm which ?

@mateo, it looks like we also need to implement java checking and other basic commands such as patch, etc.

Edit: looks like i got it from JDK.
[LG Optimus 2x] mateorod:
Yeah, it is the jdk, which is kind of a hassle.

I can look at putting in Java checking this weekend. I have been meaning to give it some time, but I have been busy with a uboot commit. But jdk checks would be good. It would probably work with openjdk as well, though I am not sure. Most of the popular Linux distros come with some form of Java, and the ones that don't are usually used by the types that would either have Java or a philosophical reason why not.

I am just saying that I bet this is more rare then you'd imagine, at least if openjdk can run the binaries.

Now when we get it to windows...whole different kettle of fish.
[LG Optimus 2x] pastime1971:
thanks for confirmation.

i set up my system a year ago, and couldn't remember exactly what it was.

the script utilize tar, jar, and java commands. (edit: forgot about patch)

tar comes with linux, and we don't need to worry about it, i guess.

edit: patch needs to be checked, i think :D

for checking we can do

java -version || printerror "missing command : java"

jar doesn't support -h (help) or -v (version)

which jar || printerror "missing command : jar"

edit: i have Fedora14 system with openjdk: looks like jar is packaged in java-1.6.0-openjdk-devel

edit: i will test patcher on that system using openjdk

edit: it works fine.

@ giliath , try to install "jar". how to install it depends on which linux distro you are using. if it is fedora, do "yum install java-1.6.0-openjdk-devel"
[LG Optimus 2x] pastime1971:
uploaded v0.4.2 http://www.mediafire.com/?aig9idb5148d3ut

v0.4.2 includes tool checking (java, jar, tar, patch)

added a change log (from my head) to the script
[LG Optimus 2x] giliath:
yes it's a jdk problem

after i install jdk.the patcher runs successfully.And it seems work well on my phone.big thx~:D:D:D
[LG Optimus 2x] JoeSyr:
Hi, sorry I stopped replying a few pages back, life got busy and I had to give this up for a bit.

Just installed cygwin after reading the recent posts here and (after a lot of troubleshooting) I have the patcher (0.4.2) running. A lot of mixed results for different roms, here's what I've seen so far:

AOKP b36: Patched w/ latest aokp, works fine. Flashed it and pdroid runs. Minimal testing so far but looks a-okay. Very excited about this, going to go share it next. I can post the patch here too, if it's helpful to you at all.

CM9 nightly:Patched w/o errors, however I have yet to flash the rom and that patch to see if it's all working.

Stock AOSP (+root, deodexed, busybox, zipalign) (Rom here): Failed to patch framework jar. Tried latest aosp and obsolete 21020507 version.

As for my daily driver, liquidsmooth 1.4, I get mixed results for different patches, none of them working. Last time I posted the rom was on 1.35, I believe, and this release has a lot of changes and additions. I've attached the usual files if you'd like to look them over.

I tried the latest version of some patches with these results:

-aosp:Bootloops

-aokp:Bootloops

-cm9: Phone boots up, but pdroid app doesn't launch(no ics support message pops up).
[LG Optimus 2x] c-pimp:
okay I tried patching new team gummy 1.2 source build and here is what happens on frameworks.diff

patch -p1 < ~/Android/Gummy/frameworks.diff

patching file frameworks/base/Android.mk

Hunk #2 succeeded at 189 (offset 1 line).

Hunk #3 succeeded at 204 (offset 1 line).

Hunk #4 succeeded at 247 (offset 1 line).

Hunk #5 succeeded at 293 (offset 1 line).

patching file frameworks/base/core/java/android/app/ContextImpl.java

Hunk #1 succeeded at 84 (offset 7 lines).

Hunk #2 succeeded at 161 (offset 7 lines).

Hunk #3 succeeded at 275 (offset 7 lines).

Hunk #4 succeeded at 362 (offset 7 lines).

Hunk #5 succeeded at 427 (offset 7 lines).

Hunk #6 succeeded at 479 with fuzz 2 (offset 12 lines).

Hunk #7 succeeded at 1513 (offset 26 lines).

Hunk #8 succeeded at 1528 (offset 26 lines).

Hunk #9 succeeded at 1588 (offset 26 lines).

patching file frameworks/base/core/java/android/content/ContentResolver.java

Hunk #2 succeeded at 317 (offset 5 lines).

patching file frameworks/base/preloaded-classes

patching file frameworks/base/privacy/java/android/privacy/IPrivacySettingsManager.aidl

patching file frameworks/base/privacy/java/android/privacy/PrivacyFileObserver.java

patching file frameworks/base/privacy/java/android/privacy/PrivacyPersistenceAdapter.java

patching file frameworks/base/privacy/java/android/privacy/PrivacySettings.aidl

patching file frameworks/base/privacy/java/android/privacy/PrivacySettings.java

patching file frameworks/base/privacy/java/android/privacy/PrivacySettingsManager.java

patching file frameworks/base/privacy/java/android/privacy/PrivacySettingsManagerService.java

patching file frameworks/base/privacy/java/android/privacy/surrogate/PrivacyAccountManager.java

patching file frameworks/base/privacy/java/android/privacy/surrogate/PrivacyActivityManagerService.java

patching file frameworks/base/privacy/java/android/privacy/surrogate/PrivacyContentResolver.java

patching file frameworks/base/privacy/java/android/privacy/surrogate/PrivacyCursor.java

patching file frameworks/base/privacy/java/android/privacy/surrogate/PrivacyLocationManager.java

patching file frameworks/base/privacy/java/android/privacy/surrogate/PrivacyTelephonyManager.java

patching file frameworks/base/services/java/com/android/server/am/ActivityManagerService.java

Hunk #1 FAILED at 146.

Hunk #2 succeeded at 13108 (offset 94 lines).

Hunk #3 succeeded at 13258 (offset 94 lines).

1 out of 3 hunks FAILED -- saving rejects to file frameworks/base/services/java/com/android/server/am/ActivityManagerService.java.rej

patching file frameworks/base/services/java/com/android/server/SystemServer.java

Hunk #1 succeeded at 36 (offset 2 lines).

Hunk #2 succeeded at 192 with fuzz 2 (offset 4 lines).

Hunk #3 succeeded at 779 (offset 21 lines).

patching file frameworks/base/telephony/java/android/telephony/PhoneStateListener.java

I have not made a new package yet, im about to right now and see if it works.. just thought id throw that out there... I used the aosp 4.04 patch... going to dinner and we will see what happens when i get back or tomorrow after work...
[LG Optimus 2x] pastime1971:
@ c-pimp,

try to see where it fails in frameworks/base/services/java/com/android/server/am/ActivityManagerService.java

hunk #1, ActivityManagerService part in framework.diff (line #4099) is simply adding "import android.privacy.surrogate.PrivacyActivityManagerService;"

@@ -138,6 +138,9 @@ import java.util.Map;
import java.util.concurrent.atomic.AtomicBoolean;
import java.util.concurrent.atomic.AtomicLong;
import dalvik.system.Zygote;
+// BEGIN privacy-added
+import android.privacy.surrogate.PrivacyActivityManagerService;
+// END privacy-added

public final class ActivityManagerService extends ActivityManagerNative
implements Watchdog.Monitor, BatteryStatsImpl.BatteryCallback {

the culprit could be Zygote part which were added March 30th.

edit: to modify the diff files, copy ActivityManagerService.java to a temporary folder. manually add the line above of "import ...". run "diff -Npru ORIGINALJAVA TEMP/EDITEDJAVA" and modify the corresponding part in frameworks.diff
[LG Optimus 2x] c-pimp:
Ok, before you posted I was unable to build so I moved to another directory in case I broke some thing, I now have two separate directories synced for gummy and both build are un patched, do you want me to use the same aosp patch and apply the fixes you posted or can I add them to the patch to try from there? I won't have time to do any of this until I get off work tonight but I will do what I can later :-) thanks for the help
[LG Optimus 2x] pastime1971:
Apply patches to one, and it shall fail in one hunk.

Manually edit it.

Remove any *.rej and *.orig that patch command generates when it failed.

Create a new patch for yours by diff -Npru unpatched/framework/base patched/framework/base > your-patch.diff

Happy patching...
[LG Optimus 2x] JoeSyr:
Did a bit more testing and I've got three roms fully working. I'm chronicling this in the Gnex forum; thread is here:

http://xdaforums.com/showthread.php?t=1662904

My experience with unsupported roms so far tends to be that the aokp and aosp patches cause bootloops, and cm9 doesn't break anything but pdroid remains disabled.
[LG Optimus 2x] c-pimp:
Okay Im confused on what to do, I reapplied patch this is the reject file it created

--- frameworks/base/services/java/com/android/server/am/ActivityManagerService.java	2012-02-26 01:16:28.000000000 -0800

+++ frameworks/base/services/java/com/android/server/am/ActivityManagerService.java	2012-03-30 13:21:32.877986794 -0700

@@ -146,6 +146,9 @@

import java.util.Set;

import java.util.concurrent.atomic.AtomicBoolean;

import java.util.concurrent.atomic.AtomicLong;

+// BEGIN privacy-added

+import android.privacy.surrogate.PrivacyActivityManagerService;

+// END privacy-added

public final class ActivityManagerService extends ActivityManagerNative

implements Watchdog.Monitor, BatteryStatsImpl.BatteryCallback {

I am unsure what you mean for me to do, im still learning so bear with me if you will ;)

edit: to modify the diff files, copy ActivityManagerService.java to a temporary folder. manually add the line above of "import ...". run "diff -Npru ORIGINALJAVA TEMP/EDITEDJAVA" and modify the corresponding part in frameworks.diff

what line above import am I to manually add and what am I adding it to and where exactly?

im also confused about the corresponding part in frameworks.diff

Create a new patch for yours by diff -Npru unpatched/framework/base patched/framework/base > your-patch.diff

please help me to figure out what it is that I am doing here...
[LG Optimus 2x] pastime1971:
which diff files are you using ?

the rej file doesn't have Zygote part that i quote in post #412, which was the latest change in March 30th.

maybe you are using an older diff files ?

edit: see the blue marked hunk in post $417 ? the third line in there is "... Zygote ..." in the updated diff file.
[LG Optimus 2x] c-pimp:
right I noticed that, I got the files from the first post the v1.32 Aosp 4.04 patch and I redownloaded to make sure I had gotten the latest... is there another one I missed in the thread that is more updated?

Edit: here is rom info

http://rootzwiki.com/topic/25210-release-05-09-12-gummy-120-the-chronicles-of-nyania/

Features

Android AOSP 4.0.4 Based (neither CM nor AOKP we built this from the ground up)

should I have used the cm9 patcher? cm9 patcher was the one that was updated correct?

have to get to bed again, getting late again and got to be up early, will have more time tomorrow to play and off work tuesday so I can get all this done!

Thanks a bunch pasttime!

also here is the tut I used to build! incase anyone else wants to play with it.

http://rootzwiki.com/topic/18318-tutorial-how-to-compile-gummy-for-non-moto-devices/
[LG Optimus 2x] pastime1971:
I see.

In that case, you have to take a look at ActivityServiceManager.java to figure out what is the difference.

It is correct that only CM/AOKP includes Zygote import.

Should be straightforward to fix it since you just need to add import privacy part.

Let me know how it goes.

If it is not clear, post a link to that java file...
[LG Optimus 2x] Keithn:
I'm getting an issue were it is telling me that I am" Missing "patch diff tools" " I looked through but couldn't see any files that I would think to be missing
[LG Optimus 2x] pastime1971:
it means you need to install a linux command "patch".

if you are running Fedora, do su -c "yum install patch"

if you are running Ubuntu, probably do su -c "apt-get install patch"

if you are running Debian based, probably do dpkg -i patch.deb

i'm a Fedora user, so i can't be 100% sure of those above. you will need to refer web search to find out the exact procedure and commands.

once it is installed, you can verify by running which patch. it will tell you where the command is. also you can do patch -v. it will tell you the version information of the command.

edit: if someone has a different distro (including Ubuntu or Debian) and knows how to install it, please post here. (thanks in advance)

edit: this web page says sudo apt-get install patch for ubuntu

edit: there is some difference between "sudo" and "su" (refer to google search please)
[LG Optimus 2x] pastime1971:
minor bug fix in patcher v.0.4.3.

now it applies device-specific patches

only

when specified so.

also removed crespo-specific patches as files are identical to aosp.

@ mateorod,

crespo-aosp-core.patch is almost identical to aosp-core.patch.

other crespo-*.patch files are empty.

is it supposed to be so ? :confused:
[LG Optimus 2x] cashmundy:
apt install patch diffutils should work on any Debian-based distro. Odd that they aren't there already. You have to do this as root. You can also find and install them via a GUI package manager.

Side note : I recently tried Ubuntu and found that their "Software Manager" is a Google Play ripoff, and just as crass. Thing was full of $$$, trying to sell me basic utilities and overpriced German magazines. I'll never have anything to do with Ubuntu again: Debian forever!

I then tried Mint LMDE, and it is really quite nice.
[LG Optimus 2x] mateorod:
Sorry I've been MIA for a little while, I have been keeping my eye on the thread, but have been tied up getting the debian repos together for Botbrew Basil as well as struggling over a bootloader commit. How's your C, pastime, do you know any?

The core patches are the ones most likely to be the same, as there are only a few hunks. When I make a new patch, I try to diff the frameworks and services. If I see differences, I have been passing them along.

As far as the other crespo being empty, well I just checked them and saw you're right. I thought that was weird too. I usually check the core patches when I make a patch set, because they are the smallest and easiest to visually skim.

So I tried to remake the patches, but same result. I then made a new directory structure with the original zips, and tried again. Same thing. The smali folders are not empty, they are working, so either the patching at build time failed or there was a mix up in the packaging of the zips. Although the fact that the patched core.jar is correct leads me to believe that c-pimp may have the correct files on his hard drive somewhere, although they may be hard to find.

Keeping all the system jars in a usable and distinct file structure is half the challenge. You should see my PDroid directory. Massive.

So no crespo for now, I guess.
[LG Optimus 2x] pastime1971:
@ mateorod,

i do okay w/ C in scientific calculation, but you probably need expertise in system programming, right ?
[LG Optimus 2x] cashmundy:
I used to be pretty good with c: kernel and drivers. I reckon I can still read it well enough, if that would help.