yashsingh1/xdaforums huggingface dataset:
[LG Optimus 2x] pastime1971:
patcher v0.4.4 w/ patches 2012.05.31. uploaded, http://www.mediafire.com/?jhm9l1a2svteyw6

@ mateorod,

as for reducing patcher size, we can simply use symbolic links for identical files.

for example, we could "ln -s cm9-proloaded.patch cm9_20120518-proloaded.patch" to make a copy w/ very small overall file size increase.

of course, another possibility is to tweak the shell script to do this, as you suggested.

in my opinion, if difference is very small, it would be better to do it in the script. if difference is major and only a small portion is common, symbolic link would be better.

also it may be a good idea to organize patches under a directory, in the future, just like you are doing in dropbox ?

as for automatically trying older patches, it is possible. i'm just not sure if we want it though. at the moment, after patching fails, it shows a message to suggest try other versions of patches, and list available patches, so that user can see what is available to try. it may be also possible that patching succeeds but user may experience bootloop. (of course, user can always to try to specify a patch version when that happens.)

as for logging, my guess is that patching works flawlessly, because it doesn't care about if a certain symbol is defined or not. then, compiling fails because that certain symbol is not defined. (i've seen it a few times.)

### rebuild framework.jar ###
framework.jar.out/smali/android/widget/ListView.smali[7019,16] Label "cond_cc" is not defined.
framework.jar.out/smali/android/widget/ListView.smali[7035,13] Label "goto_24" is not defined.
framework.jar.out/smali/android/widget/ListView.smali[7041,4] mismatched tree node: I_STATEMENT_FORMAT22c_FIELD expecting I_CATCHES
framework.jar.out/smali/android/widget/ListView.smali[7049,4] mismatched tree node: I_STATEMENT_FORMAT23x expecting <UP>
framework.jar.out/smali/android/widget/GridView.smali[4472,17] Label "cond_d9" is not defined.
framework.jar.out/smali/android/widget/GridView.smali[4490,10] Label "goto_2c" is not defined.
framework.jar.out/smali/android/widget/GridView.smali[4496,4] mismatched tree node: I_STATEMENT_FORMAT22c_FIELD expecting I_CATCHES
framework.jar.out/smali/android/widget/GridView.smali[4504,4] mismatched tree node: I_STATEMENT_FORMAT22x expecting <UP>
framework.jar.out/smali/android/database/sqlite/SQLiteCursor.smali[141,46] Label "catchall_66" is not defined.
framework.jar.out/smali/android/database/sqlite/SQLiteDatabase.smali[4319,10] Label "goto_19" is not defined.
framework.jar.out/smali/android/app/DownloadManager.smali[1229,10] Label "goto_1c" is not defined.
framework.jar.out/smali/android/app/DownloadManager.smali[1257,10] Label "goto_1c" is not defined.

i think this type of error is quite difficult to aumatically fix.

what do you think of those above ?

edit: for automatically trying different versions of patches (and partially), i am bit worried about a case where two different patches succeed patching and compiling equally (for some reasons) but one ends up bootloop. then patcher cannot decide which one was a correct one.
[LG Optimus 2x] mateorod:
I was actually working on patching something for someone right now.

With the logging, I just meant that as of now, we pipe it all to the log file, but nothing comes up on the terminal. As I am sure you have seen, it will quite often recompile a system.jar that has not been patched correctly. I would say failed patchings are recompiled about 33% of the time.

Without the hunks failed messages on the users terminal, I think most people would just flash the pdroid zip, which would give them bootloops. At that point, they either come here for support, or give up on the patcher all together.

I think they would know to try another patch (and I am fine with leaving that up to them, that was just an idea) if they could see that the patching failed.

They could always check the log, but we realistically can't expect that to be the norm. If it compiled correctly, I think that 75%+ would flash it without ever looking at the log.
[LG Optimus 2x] pastime1971:
ok.

i am trying to check error in patching by patch -N -p1 -d framework.jar.out < $RID-framework.patch >> $LOG 2>> $LOG || printerror "failed patching framework.jar !!!"

problem is that WifiConfigStore.smali sometimes throws

patching file smali/android/net/wifi/WifiConfigStore.smali
Reversed (or previously applied) patch detected! Skipping patch.
36 out of 36 hunks ignored -- saving rejects to file smali/android/net/wifi/WifiConfigStore.smali.rej

which we ignore by "-N" option. nevertheless patch command sets error flag, and patcher terminates.

i'm not sure how to work around it.

we could examine if it is "ignored" or "failed" by examining the log. (which could be troublesome.)

another possibility is that since it is always WifiConfigStore.smali (so far), we could separate a patch for WifiConfigStore.smali and not check error for this. (this is assuming that it will be only WifiConfigStore.smali)
[LG Optimus 2x] mateorod:
Let me look at it tomorrow. There is always the possibility that we could just axe that file's patch. It might not be relevant anyway. Some of these files are changed by modified build instructions, which doesn't always mean they are necessary for Pdroid's operation (as I have tried to tell Lanchon, in the thread and over pm.)
[LG Optimus 2x] karamelos:
Hi

Thanks for your work

Patcher for linux work fine on this rom: http://xdaforums.com/showthread.php?p=26802523 but no manually (noob inside ...... :D )

Envoyé depuis mon GT-N7000
[LG Optimus 2x] Pandur:
Galaxy Note CM9 Nightly

Cant get it to work on the latest Nightly for Galax Note (http://get.cm/get/jenkins/2339/update-cm-9-20120604-NIGHTLY-n7000-signed.zip)

I try it via Cygwin, dont kow if I miss somthing on my Cygwin Installation or is this Rom not compatible?

Please can someone take a look at the Log-File and help me?
[LG Optimus 2x] pastime1971:
Error! CRCs do not match! Got 5ae7c9d7, expected db511257
# VID= 4.0.4
# MID= cm9
# RID= cm9
# DID=
### decompile framework ###
Can't find the file system/framework/services.jar
Can't find the file system/framework/core.jar
Can't find the file system/framework/framework.jar
Error opening system/framework/framework.jar for reading!
system/framework/framework.jar: No such file or directory
### apply patches ###
patch: **** Can't change to directory core.jar.out : No such file or directory
patch: **** Can't change to directory services.jar.out : No such file or directory
patch: **** Can't change to directory framework.jar.out : No such file or directory

lots of things went wrong. first unzipping patcher tools didn't go well. (tar xvzf pdroid_tools.tgz)

it sounds to me either that patcher you downloaded was bad or that you cygwin environment is not set up correctly...

first, check md5sum of pp20120531v044.zip. it should be e2a5c7b4fd5157b1a62b785412186823

if cygwin is the issue, maybe mateo can help you. (i don't have any experience with it)
[LG Optimus 2x] Pandur:
Thanks, but extracting the tar-File doesnt help, get the same Error...
[LG Optimus 2x] pastime1971:
i didn't mean that you need to extract it.

i was saying it errored when pdroid_patcher failed when it executed tar xvzf ...

which is likely that zip you downloaded may be a bad download.

can you confirm md5sum ?

edit: sorry, on a second look, it could be error when it does "jar -xvf ROM"

can you manually run jar -xvf ROM.zip and see if it extracts files ok ?
[LG Optimus 2x] Pandur:
Yes, md5sum is correct

It extracts but shows a CRC-Error! But the md5 for the Rom is also Okay...
[LG Optimus 2x] pastime1971:
ok.

can you post a link to the rom zip file ?

i will take a look.
[LG Optimus 2x] Pandur:
http://get.cm/get/jenkins/2339/update-cm-9-20120604-NIGHTLY-n7000-signed.zip

Thank you!
[LG Optimus 2x] pastime1971:
well, it patches the rom ok.

attached are log, pdroid.zip, restore.zip for update-cm-9-20120604-NIGHTLY-n7000-signed.zip

md5sum of ROM was b3e53f7f51c8badf5669069d0b1866b5

if you get the same md5sum, (which i didn't check from download site), it could be that your cygwin environment issue.

edit: if it is cygwin issue, i recommend a vm setup.
[LG Optimus 2x] Pandur:
Thank you VERRY much for your help! Seems to be a Problem with (my?)Cygwin...
[LG Optimus 2x] pastime1971:
could be.

can't say. i never used cygwin in my life.

vm should definitely work for sure... :D

it would be great if you can test it out in a linux environment.

also it would be GREAT if you can trouble-shoot your cygwin environment, and educate us how to make it work (if it is possible)
[LG Optimus 2x] mateorod:
+1 on that. My personal experience with cygwin is limited. I have used it some though, and in that small capacity, it seemed to handle the *nix tools I threw at it ok, but I definitely can't troubleshoot it.

I just suggested it as I know it is the standard for those who don't want to set aside the time/storage to set up a vm.
[LG Optimus 2x] SAI Peregrinus:
So my rom devs (team Passion) came out with a new AOKP based rom (ICS Chimera). The patcher works, pdroid works, etc. I'm pretty certain that ServerThread is in fact the SystemServer.java file.

This rom uses Aroma Installer. If you have a rom using Aroma the file structure is a bit different, META-INF/com/google/android/update-binary gets renamed to update-binary-installer and a new update-binary for aroma is created. The patcher copies both into the pdroid.zip. This will cause flashing to fail. To fix it, delete update-binary in the zip then rename update-binary-installer to update-binary.
[LG Optimus 2x] pastime1971:
thanks for the info.

but i'm bit confused. can you post a link to the ROM, so that i can take a look at it ?

edit: i am reading http://xdaforums.com/showthread.php?t=1461712 but i am not getting it (silly me). should i do the following ?

1. i will need to know how to figure out if a ROM uses aroma installer or CWM, but i can't until i can take a look at a ROM.zip

2. if aroma, then delete update-binary (so, that means ROM.zip does have both update-binary & update-binary-installer ?)

3. rename update-binary-installer to update-binary

4. copy the generated updater-script
[LG Optimus 2x] mateorod:
It is inevitable that we'd come up against an Aroma installed ROM. Thanks a bunch to SAI for doing to dirty work of testing.

Pastime, it is new installer in recovery, really pretty cool. I flashed the recovery file manager to test a couple weeks ago, but it was a little buggy for me. I understand that the dev is waiting for some donations to get a new phone before continuing development, which is a shame because it is real interesting, but needs some finishing touches.

Here is the Aroma thread, which is quite possibly the most information packed thread on xda.

Pastime, I thinking coded a solution to the output issue, and possibly a work around to the stderror problems as well. I am going to tinker and test and will share tomorrow.

Thanks a bunch SAI peregrinus! And I haven't disregarded your tip about the server thread, I've just been swamped. My Android time has been swallowed by this uboot.bin. but I will investigate using your info!
[LG Optimus 2x] pastime1971:
@ SAI Peregrinus

i tried to do just what you described in a new version, http://www.mediafire.com/?bdz4a77nfs66ann

could you try and see if it works with Aroma installer ?
[LG Optimus 2x] SAI Peregrinus:
I reposted that because I thought you may have missed it, since it was the last post of a page and got no response. Better safe than sorry.

http://team-passion.com/index.php/forum/6-vibrant-general/1651-mirrors-for-chimera-v1-1 is the ICS Chimera download mirror page.

The new patcher (v045) does seem to have worked.
[LG Optimus 2x] testman86:
I only want to thank you guys for this nice developement :-) keep on working and I hope you get it running :-)
[LG Optimus 2x] testman86:
Hi Guys,

I got it working with this ROM http://xdaforums.com/showthread.php?t=1551746 and with alpha v0.4.4 patches 2012.05.31 of the script.

I will test and give a feedback if everything is running without reboots or something else.

I did "./pp/pdroid_patcher update-cm-9.0.0-RC0-shooteru-UNOFFICIAL-signed-b1-030612.zip cm9" to patch and got it working :-)

This is for installing the patch http://d-h.st/NAT and that to get rid of it again http://d-h.st/jXl (I can not garantee that it works! It worked on my Evo 3D GSM 4EXT Recovery Touch with the ROM shown above! So it is your own risk :-) Or make the patch yourself, it is very easy. I can say that because I do not have much experience and still i got it working ^^)

The most reason to stay on a GB ROM was that PDroid was not working, but now I can go to Android 4.0.4. I hope that you will be able to make a patch for all Android 4 Roms because of HTC Sense and other nice stuff :-)

I there are not enough thanks-buttons for your work :-) I am really glad that you get it working :-)
[LG Optimus 2x] pastime1971:
another success story ...
[LG Optimus 2x] mateorod:
Pastime-

I have modified the patch script on order to allow the standard ouput and error (of the patching only, as I think that is all that is called for) to be both logged and printed to the screen.

I believe this will cut down on the chance that people will flash bad pdroid.zips due to not checking the logfile.

I am attaching the patcher script, but the changes look like this:

echo "### apply core.patch ###"
$PATCH -p1 -d core.jar.out < $RID-core.patch 2>&1 | tee -a $LOG 2>> $LOG #|| printerror "failed patching core.jar !!!"

I think this will take care of the problem you were having where the unneeded reversed patch errors were interrupting the patching process as well. Let me know if not, I think that since we have a pretty secure patching script we could also patch with the -f force flag and eliminate the issue that way, especially since we are patching a copy of the files in a temp folder and nothing that needs to be kept pristine.

I am also playing with a getbuildprop ro.build.date.utc function, which would hopefully help slot the proper patches. This will take some work, as we will need to define the time frames for each patch and then pound it out in bash properly. My bash-fu is nowhere near as strong as yours, so this is a project for me. But the patcher works great as is, that is just an extra to make things even easier. ;)

I had to add the .docx extension again, obviously it is unnecessary...
[LG Optimus 2x] pastime1971:
great work.

i didn't know about "tee" until just now. :p

however, i think it may be a little bit too much to show every output of "patch" command.

how about adding "-s" option to keep the output minimal ?
[LG Optimus 2x] alroger:
repo project changes details

DEVs, can anyone tell me which projects exactly in the CyanogenMod repo are afected by these patches?

I'm helping with the CM9 SGT7 builds with PDroid, as mentioned before, and things are getting so big and time consuming that I'm trying to optimize my scripts.

I want to know which "projects" I have to clean and repo resync to make sure I'm getting the latest framework files from CyanogenMod git, before aplying the patches again.

Thanks in advance!
[LG Optimus 2x] SilentEYE:
Hello I am trying to make a Patch for a Sony Xperia S Device. At the moment I am not quite sure if I use the correct ROM because I got Hunk Error Messages and at the end an error: failed compiling framework.jar.

Is someone kindly enough to have a look at this ROM Page:

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

Attached the Error Log.
[LG Optimus 2x] Datastreamx:
How would you go about doing this for stock roms for HTC? There's no source for those to compile PDroid with, right?
[LG Optimus 2x] mateorod:
I don't really understand why you would need to repo sync specific individual projects, but if you say so. Why not just open up your patches and look? They are easy to read, especially if you know the source tree you're patching, which I think you'd have to in order to do whatever it is you're trying to do.

Lots of errors. Looks like maybe a themed AOSP ROM? We don't have enough builders for AOSP, so there are some holes in the range of AOSP rooms we can cover.

Did you try all the various patches in the patcher?

@pastime I have only used -i and -a with tee. I see a -s option that delivers the file size? I was guessing that it outputted only fails when I saw you suggested it.

I do know we could tweak the 2>&1 part to output only stderr, although to be honest I am not sure that failed hunks count as standard error or output. I will try the -s option today. It is a lot of info, but I think it is important to deliver some onscreen info about the success or failure of the patching. Sure it sometimes fails to compile, but it sometimes compiles just fine with failed hunks.
[LG Optimus 2x] pastime1971:
@ materorod,

sorry for not being clear. i meant "patch -Nls" so that patching goes silent for successful ones and only prints error and warning.
[LG Optimus 2x] mateorod:
I didn't know -s printed errors. That sounds great. I might put together a verbose option for the user input, where they could see the patching if they want (someday). But that combo sounds great.
[LG Optimus 2x] SilentEYE:
I just tried the standard CM7 Version. I think that Rom is just a Stock Sony Rom with some modifications. Therefore i just didnt try AOSP.

The standard Pdroid Patcher from the Devs Side is somehow working on this ROM but i loose Titanium Backup Root rights.
[LG Optimus 2x] testman86:
Hi Guys,

i got PDroid working on an AOKP port for Evo 3D

http://xdaforums.com/showpost.php?p=27116473&postcount=408

I could make the patch without any issues and it boots well reorganice the apps and then after installing PDroid I was able to choose the permissions. I hope that does mean, that everything works as it should :-)

Or is there a possibillity to check if everything is working correctly?

Thanks again for your work :-)
[LG Optimus 2x] mateorod:
You can put on the notifications in the PDroid settings and then check stuff app by app. That's what I did. I am reasonably convinced that PDroid works on ICS exactly as it is supposed to.

The one thing to note is that many permissions are actually shared/accessed through the Gapps. So if you see something you believe is a hole, try blocking the relevant Google app and see if that changes anything. I bet it will.
[LG Optimus 2x] karamelos:
one more

hi

work's fine on this rom :

[galaxy note][ROM] PARANOIDANDROID v0.2 [TABLET/HYBRID][CM9][30/05]

ty
[LG Optimus 2x] mateorod:
CM pulled the 4.0.4 r2.1 code from Google tonight. I'm building a clobber right now and will check in the morning.

UPDATE: Patches work fine.
[LG Optimus 2x] alroger:
Ohh, sorry, I'm not really a dev, just trying to help building CM9 and PDroid for P1000/L/N/C.

Let me try to explain....

If I already patched PDroid, next repo sync it will not download any new files that have already been patched... and I would like to know which part of the tree ("projects" as I understand) I have to remove to actually get any new updates on the framework...

I want my script just to "undo" the pdroid patch, repo sync, and then patch again, without having to re-download the whole tree again.
[LG Optimus 2x] pastime1971:
frameworks, libcore, and build

did you do the first simple method, or the second in post #1 ?

the first method will break git repo, which i am guessing what you are experiencing.

the second method should be git-friendly (as far as i can tell) :D
[LG Optimus 2x] alroger:
Thanks.

If that second method was there when I started all this I probably didn't understand it and ignored it at the time. Exactly what I needed to know.
[LG Optimus 2x] mateorod:
I just used the patcher on a 6-11 encore build, and the patches failed on the Wifi config store file, of all things.

That's the one that keeps popping up on you, right?

I may look into axing that part of the patch. One way or another, I will come back with a new patch tonight or tommorow, after I make a decision on it.
[LG Optimus 2x] Px80:
will there be a patcher for windows ?
[LG Optimus 2x] pastime1971:
sorry, that is unlikely. at least at the moment.

edit: we recommend to set up a linux virtual machine.
[LG Optimus 2x] robjective:
@Px80: If you have a tiny bit of Linux knowledge, or are pretty good with the Google-fu, I've got a breakdown of how I did my virtual machine setup to make the patch.

http://xdaforums.com/showpost.php?p=27241458&postcount=37
[LG Optimus 2x] pastime1971:
Thanks.

I couldn't have done it better !
[LG Optimus 2x] mateorod:
Hey pastime, when you have time, would you build a patched and non-patched jar set for me from your p990 source? I am going to upgrade the patches and I am would like to make one from your source in addition to encore. I am going to use them to make a call on the patch set. I may make a combo patch, or maybe even have both in the patcher and have the patcher check for certain functionality.

It will depend on the diffs of the two what we do next.

Thanks.
[LG Optimus 2x] pastime1971:
sure. no problem.
[LG Optimus 2x] mateorod:
another script edit for whenever we push the new version...

Zeppelinrox (of V6 supercharger infamy) noted that with the head -1 command, apparently the older busyboxs don't like that too much. He recommends head -n 1.

His script has been used on devices far and wide, so I am willing to give him the benefit of the doubt on this one if you are..

so it would be...

cat META-INF/com/google/android/updater-script | grep ^mount | grep "/system" | head -n 1 > updater-script

in the two places we use head.

Sound good? We can just push it when we push the new patches and the tee command. I am still thinking about the best way to add new patches. I think you might be right and symbolic links would be the way to go.

But we'll see after your builds go up. I will not only diff between the devices, I will also diff between same device patch build dates. Just to make sure that even though it may patch perfectly, we aren't leaving behind substantive differences using an older framework patch or whatever.
[LG Optimus 2x] pastime1971:
that sounds weird.

"head" there is a linux command on a linux machine, not a

busybox

command on an android phone.

i wonder which linux distro he was using it on.

nevertheless, "-n" sounds good.

in fact, man page says "-n #" is standard.

i will build cm9 for p930 and p990.

the reason is because p930 builds nice w/o any tweak/mod on cm9.

p990 needs a couple of unofficial changes to work.

however, that change is not related to pdroid part. it is just to be sure.

since my build machine is quite old, it may take some time.
[LG Optimus 2x] mateorod:
You know, I got his message and passed it straight along after a brief scan of a man page. Barely even thought about it.

I bet he is just used to working on device. But as these newer phones get beefier, it won't be long before we can run these types of programs onboard. With botbrew I can actually do all of these operations on my nook right now, but it takes very specific iterations of the javavm and so forth.

But still it is probably not the worst habit to get into, trying to accomodate both pc and phone. I know that was the mindset behind the streamlining of the newer kernels.

I have new CM9 patches from encore done, but I will wait until your builds are done and I have time to look at the patches before I push them over. Our current patcher still fails to patch the WifiConfigStore, but compiles and seems to run fine.
[LG Optimus 2x] pastime1971:
yeah, i'm all for using a standard format of command.

i just didn't think about it because i have been using "head -1" for 15 years, and it always worked. i didn't realize it wasn't the standard (or POSIX compliant?) format.

i knew about "tail --lines=#" though, and i believe it used work as "tail -#" but not any more. so i should have known about head as well... :eek:
[LG Optimus 2x] pastime1971:
pdroid and latest cm9 of LG P930 at http://www.mediafire.com/?ey6wglw8evara

i'm having trouble with commit cherry pick with P990.

rebuilding one without any commit now...

edit: URL link updated