yashsingh1/xdaforums huggingface dataset:
[LG Optimus 2x] c-pimp:
lol, i read that outloud and my gf was like "what ladies" LMAO

turns out i did repo sync since building that damn first build days ago....

cd ~/android

repo sync -j16

patch -p1 < ~/build.diff

patch -p1 < ~/libcore.diff

patch -p1 < ~/frameworks.diff

. build/envsetup.sh

brunch <DEVICE_TARGET>

i went thru and re did the commands earlier lol so I forgot repo sync -j16 was in there....

so the zip I have on hand is useless or what? should I start over?

also they have a p990 source so pasttime if he wants to just build and play with that he might be able to get you what you need instead of building for my device since I will be out tonight and not back until tomorrow... Im glad you two are here to help me and I am glad to be learning! thanks again you guys!
[LG Optimus 2x] mateorod:
Ha! Yeah, we are all pretty cool if only everyone else knew it! Lol

No, it will be fine. Just handle your business, and whenever you see the build is completed, enter in pastime's removal commands (including the rm one), then

make clobber

Then

cd ~/android/system/

. build/envsetup.sh

brunch vibrantmtd (or the debug one pastime has above)

And let it roll. If that ends up being tomorrow, awesome. No rush, you know? Thanks.
[LG Optimus 2x] pastime1971:
i never tried to build AOKP before, and i thought it is pretty similar to CM (since AOKP is based on CM), but i am getting error no matter what i do on whichever device:

AOKP]$ breakfast aokp_p990-userdebug
including vendor/aokp/vendorsetup.sh
build/core/product_config.mk:193: *** _nic.PRODUCTS.[[vendor/aokp/products/picasso.mk]]: "device/acer/picasso/picasso.mk" does not exist. Stop.

** Don't have a product spec for: 'aokp_p990'
** Do you have the right repo manifest?

it doesn't even do "make clobber" (it spits out the same error message)

i will figure it out after work... for now i need to get back to work...:mad:
[LG Optimus 2x] c-pimp:
this tut worked flawlessly for aokp bulid for me

http://rootzwiki.com/topic/17564-tutorial-so-you-want-to-build-aokpics-for-the-toro/

also guess what! great news... just installed the newest build and pdroid is up and running!!!

so what now do I want to do to remove patches and rebuild?

patch -p1 < ~/build.diff -R

patch -p1 < ~/libcore.diff -R

patch -p1 < ~/frameworks.diff -R

make clobber

??

doing that now...
[LG Optimus 2x] pastime1971:
in a nut shell, yes...

edit:

still not working following that tutorial...

did you do ICS or MASTER ?

repo init -u git://github.com/AOKP/platform_manifest.git -b ics

or

repo init -u git://github.com/AOKP/platform_manifest.git -b master

i did master, and i think that was the issue, trying ics... :mad:
[LG Optimus 2x] c-pimp:
Yeah... I think I did ics
[LG Optimus 2x] c-pimp:
I will have both zips uploaded to dropbox as soon as I get some time tomorrow morning.

Update.. here is patched file..

http://db.tt/x0AIN6IE

Non patched is at home... coming tomorrow
[LG Optimus 2x] mateorod:
Hey, I was out all afternoon and just came back to your news. Great stuff, congrats on the success.

Did the patch get reversed with the commands you posted? You can tell by the output. I think the-R flag has to go with the patch command itself to work. If you need commands that definitely work, try the ones on pastime's first post, combined with a make clobber.

As long as you don't repo sync again, we'll get what we need. Thanks for being such a willing collaborator. It has been real cool to watch you learn so much in such a short period of time.
[LG Optimus 2x] pastime1971:
also i managed to compile AOKP w/ PDroid. it should be same as what c-pimp got...

AOKP frameworks : http://www.mediafire.com/?dujau35oof9ytvc

AOKP + PDroid frameworks : http://www.mediafire.com/?5b9gltodp1br7zz

i will look into smali patching tomorrow ... :)
[LG Optimus 2x] fragargon:
hi guys,

i m back, sorry for delayed feedback... had to rebuild the VM (hd to short)

well now sync repo done + run the patch command succed

however when i try to build the rom get alwas that message

fragargon@ubuntu:~/bravo$ breakfast bravo
including vendor/ev/vendorsetup.sh
Segmentation fault (core dumped)

** Don't have a product spec for: 'ev_bravo'
** Do you have the right repo manifest?

fragargon@ubuntu:~/bravo$ breakfast passion
including vendor/ev/vendorsetup.sh
Segmentation fault (core dumped)

** Don't have a product spec for: 'ev_passion'
** Do you have the right repo manifest?

(tried with my device code name and with texacise advice, no one run - could it be coz a run patch diff before runnning build?)

sorry for noobish question... looking forward a solution since this morning but ran out of ideas...

as i m running a bravo device i get this repo from texacise thread

looked to /device/htc and get a collection of folders included bravo

dunno why this givin me such response.

I don t wanna bothered you with this... stiil lookin a solution (hope wil find it) coz i m a one step to achived this...

my feedback

thks
[LG Optimus 2x] c-pimp:
Pasttime beat me to it... but just in case anything is different I will post mine in a few hours
[LG Optimus 2x] mateorod:
Sweet!

pastime, the aokp patches are in the dropbox folder. I haven't had time to play with them yet, but I am almost positive they are fine. We should just tracj down a aokp nightly and test them. I will do that this afternoon.

I have several ways I think we can incorporate the aokp patch into our patcher, but the easiest may be a getprop function. I have one written from another script, when I get a minute, I will post it into that script framework. I meant to put some time into it this week, but I got swamped. I will look at it some today, hopefully.

c-pimp- please post yours too! it will be helpful

fragargon- I have to run, but I will see if I can take a look at your problems later today.

Thanks guys!
[LG Optimus 2x] c-pimp:
Mine will be posted shortly... also it was patched with aosp patch so we can see if any differences...

Do you think the aokp patch might work with the slimrom files now?
[LG Optimus 2x] kerberos7:
Could you make a Tutorial for eh Beginner?
[LG Optimus 2x] mateorod:
The hope is yes. There might be a tougher solution, but I think we're closer now. I may try and build AOSP while I work later tonight as well, pastime has given ,e inspiration.

But we'll see. I will spend some quality time on the project later today.

Tutorial for what? If you need to learn how to build from source in order to apply the source patches in the OP, you would probably be better off asking in your device's forums.

If you already build from source, the directions are almost cut and paste in the first post.

What do you want to know?
[LG Optimus 2x] c-pimp:
Gonna take some more time... VM ran out of space because I had 60gb in recycle bin lol... gotta redo build with patches removed... but yes commands with -R seemed to remove patches but not 100% certain without testing
[LG Optimus 2x] c-pimp:
Are you building from source and trying to patch that or are you trying to make pdroid work with a from you downloaded? If you are not building from source then you might want to wait for a patcher to be released or you can try posting your core framework and services jars and your build.prop and perhaps it can be patched by meteorod if he isn't to busy figuring out the hopefully final stages of a working patcher
[LG Optimus 2x] c-pimp:
Bad news.... can't finish build.. whatever happened when VM ran out of mem was not good... will try again later but I may just allocate entire space for VM and start over...

I'm also trying to get my desktop up and running... I just got 24gb DDR for it :) once that is done I'll have a permanent build env
[LG Optimus 2x] mateorod:
It looks to me like be of two problems, almost certainly. I would correct/adjust both of the following to be sure and eliminate headaches.

1. I think your version of make is incorrect. Have you run an update in your software? And how did you get the necessary tools (curl, bison, python etc.)? If you used synaptic, upgrade the make package.

2. Seg faults can be memory related as well. If you have under 1.5-2 gigs of ram allocated to you VM, increase the ram if you can.

Good luck.
[LG Optimus 2x] jahrule:
Installed botbrew and repository did the refresh but don't see any pdroid packages I have a TMobile sgs2
[LG Optimus 2x] mateorod:
I have to add devices manually. If you are running CM9 or (NEW!) aokp, just upload a zip containing your services, core, and framework.jars which are in /system/framework/ and the build.prop in /system.

I'll patch the files and make a package for you. Could be ready quickly depending on when I get the files.
[LG Optimus 2x] jahrule:
Oh it has to be cm9? I am running stock ics I have the t989 not the international version. Anyway if cm9 is the only thing that can be patched now then I will upload the files you mentioned from our half broken cm9
[LG Optimus 2x] mateorod:
Hey cool!

I am going to look at it now. But those hunk fails are the same files that fail when I try to apply the cm9 patch over an AOKP build. This is the smali-services.patch you are flashing over a decompiled cm9 file?

There are aokp patches in there as well.

Can't wait to look at it.

edit: and yeah, I spread the comments all over the place, but I realized that hapfway through. It's why I switched back to baksmali in the first place. I had never known that apktool was essentially a packager. You made a diff patch for the classes. Cool.
[LG Optimus 2x] jahrule:
Is this only for cm9 roms? Or because it is a smali patcher it should work on any rom right?
[LG Optimus 2x] mateorod:
all code is not the same, it depends on the rom. The patches look for unique areas of context in which to attach. If the source code is different enough, the patches won't match and then won't apply.
[LG Optimus 2x] jahrule:
So what you think i should do? Try the patcher or just give you our half broken cm9 files?
[LG Optimus 2x] mateorod:
I don't know. We have patches for CM9 and AOKP ONLY. If you would like PDroid badly enough to run half-broken CM9, I can try and patch it for you or you can try the patcher, I guess. It depends on how badly half-broken is, I guess.

You can try the patch on your stock, maybe we'll get lucky. But this is ALPHA ALPHA stuff. I think pastime put it up to be vetted, not distributed. But it's up to you.

edit: pastime, the patcher worked beautifully on my CM9 encore rom. Beautiful. I am going to flash now.

Let's consider how to integrate the aokp patches. I originally was suggesting a getprop function, which is actually what I logged on to do. But as I think about it, maybe we should let users enter in which patches they want. I am thinking here of the hybrid types like slimrom. I haven't had a chance to see if the AOKP patches work on those, but perhaps users of those ROMS would like to try a second set of patches if, say, they try the CM9 patches and they fail.

I know we can make an unpatcher just adding the -R option, no problems there.
[LG Optimus 2x] jahrule:
http://xdaforums.com/showthread.php?t=1531189 This is a AOSP rom (note the RC9 build NOT the RC10 or others). It seems to be working fine for most. Our cm9 is too broken for me to use so no use me bothering you with it. I will try the patcher on my stock rom if it works i might jiz in my pants, i fnot then time to flash the aosp rom i linked :)
[LG Optimus 2x] pastime1971:
cool...

we can check build.prop for different ROM

ro.rommanager.developerid=cyanogenmod

for cm9

ro.rommanager.developerid=teamkang

for aokp

and apply different services.patch in the shell script

and maybe further extend it to other ROMs
[LG Optimus 2x] mateorod:
maybe add some more, I have this in one of my packages

if `getprop ro.cm.version | grep -qvF 9.0.0`; then
rm "${SOURCE}" || true
echo 1>&2 "Not replacing \`services.jar' because this is not CyanogenMod 9."
exit

otherwise we'll have some CM7 users up our butts. You know?

edit: and obviously, just nest that inside the getprops, with the equivalent for AOKP.

Edit: Did you find out why the patching failed that first time? Maybe it was AOKP? I have seen that output a BUNCH. :-)
[LG Optimus 2x] jahrule:
OK so tried the patcher on my stock rom.... it did not go very well LOL http://pastebin.com/yT74ic7n there is the log. Downloading the *workingish* AOSP build for my phone now. Should I try patcher again or upload the jars and build.prop to you (mateorod)?

EDIT: So, yea tried to patch the AOSP build got this: http://pastebin.com/y1YPMhLt seemed to have created a pdroid.zip and restore.zip. If they work or not i have no idea but going to test will report back.
[LG Optimus 2x] mateorod:
Dude, jah. I don't think you're hearing me.

we have patches for AOKP and CM9. that's it.

We cant patch AOSP yet.

I was going to work on this patcher tonight, but since pastime did it already (awesome!) I am going to work on building AOSP from source and making a patch for it. If you keep your eyes on the thread, if I am successful you can be the first to know.

But as of now, it is CM9 or bust, for you.
[LG Optimus 2x] jahrule:
LOL sorry. Must be my wishful thinking lol. I saw AOKP as AOSP. AOSP build will take a while. Good luck.
[LG Optimus 2x] mateorod:
Hmmm...Pdroid is FCing on me with the patched ROM. I don't know why yet. I will look into it.

Okay, I uninstalled and reinstalled through Play, but now it is reading as if the ROM isn't patched.

So we have a bug here in the patching process. I will go through the script more carefully. The patching output was fine from what I could see.

hmmm.

edit: looks like I didn't read the script very deeply at all. I thought it created a patched rom! I see the updater/restore zips being created. Just dumb. that's all.
[LG Optimus 2x] jahrule:
OK so the patcher, like i said before, created the pdroid.zip which i flashed and it booted. However, when I started pdroid i get the "bad news: not avaliable for ICS..." error and it closes. yea...... I will wait for you to finish off the AOSP patcher.
[LG Optimus 2x] pastime1971:
i will see what i can do about it.

patching will miserably fail for CM7 anyway, but at the moment there is zero error checking. (we can fix that once we have a fully function patcher.)

meanwhile, here is one that will check ROM types (cm or aokp for now) and apply different patches. cm9-*.patch and aokp-*.patch. also i renamed preloaded.diff to preloaded.patch
[LG Optimus 2x] pastime1971:
i am not sure which AOSP ROM you are running, but there is a big chance that your ROM is odexed, and this patching won't work ? (it was the case for maguro AOSP)
[LG Optimus 2x] jahrule:
I linked you to the AOSP rom i am using already.. Once again it is: http://xdaforums.com/showthread.php?t=1531189 (it is the RC9)

The rom is not odexed.
[LG Optimus 2x] mateorod:
I didn't know you were working on it right now, I was about to paste in something I had written to the same affect.

Well great, man. This was real good work. I still don't know what you were reporting about the first failed patching, though. As for the non-pdroid related change, were you talking about the preloaded classes, or where was that?

The preloaded classes I think are from a build you made for the p930, and all the smali patches should be pdroid only. where were you thinking it was? Some of the changes in framework are technically non-pdroid, but are caused by the pdroid changes we did need.

Anyway, I am going to start building AOSP right now. I don't know what will be necessary, maybe I will need to track down some libs, I don't know. But hopefully sometime tomorrow I will add an AOSP patch to the pile.

great work.

Edit: we could also consider adding in a deodexer, should it come to that. I have deodexed some system apps before, but it isn't something i do a lot of. But it is doable.

Edit2: Scratch the AOSP build. I don't run 64 bit. Well, the two we have is pretty sweet, if I do say so myself.
[LG Optimus 2x] jahrule:
Noooooo! :(

... Wierd. so i ported over the services, core, framework jars from the maguro (spelling) build and pdroid works :) but icons are all waked in pdroid and i am getting the "Unfortunetly, the process com.android.phone has stopped" :(
[LG Optimus 2x] pastime1971:
as for non-pdroid-related patch, i thought so because of the following message, when applying to a very old cm.zip.

patching file smali/android/net/wifi/WifiConfigStore.smali
Reversed (or previously applied) patch detected! Assume -R? [n]
Apply anyway? [n]
Skipping patch.

i don't see this message for AOKP-vibrantmtd. so maybe it was an issue with that zip only.

i will find a cm9 nightly and try it now. (will report here)

edit: i get the exact same message w/ the latest cm9 nightly for p930, http://download.cyanogenmod.com/?device=p930&type=nightly
[LG Optimus 2x] c-pimp:
Nice, can't wait for tomorrow, hopefully I can get my desktop back up and running tomorrow, been running everything on my htpc
[LG Optimus 2x] pastime1971:
@ mateorod,

btw, my patch script doesn't do anything on classes.dex file, which could be why you get FC.

as i am not familiar with baksmali/smali process, could you tell me what needs to be done on it ?
[LG Optimus 2x] mateorod:
Now, the error messages from pdroid could have been my fault. I pushed the rom back to the device, not the pdroid zip. I would recommend an echo at the end of the script telling people which file to push.

I am about to flash the proper zip now.

I may have made a dumb mistake, but I won't be the only one.

Now I haven't dug into the script like I will over the next 12 hours or so. But what we have with the baksmali/smali process is this.

The baksmali decompiles and creates an out folder, designated smali here.

apply patches

recompile the smali folder with smali.jar, which creates classes.dex.

That classes dex needs to get swapped into the existing jar file.

My guess here, is that when you unzip the jars in your script process, you didn't realize that the classes.dex was getting overwritten with the smali command I gave you. So it is working, although it is conceivable that we may have a problem with the restore zip, if you didn't see that was what happened.

But that is fixable, if this is even what you wanted to know or what is actually happening. Like I said, I have to really look at the script a little closer.

That is why I had copies pulled into a temp or work folder in the original script layout. Because it is pretty easy to get them confused. the smali out folders themselves are hard enough to keep organized.

If you look at the patch headers, you'll see I created sub-dirs for each jar and patched from there, to keep it all clean.

Now, I am just starting to look at the patcher, but what are the diff files for? I see the patch commands for the diffs are commented out. Also, what did you do to create the preloaded classes file? extract and diff pdroid and non? That's what it looked like at first blush, but the extra files have me a little confused.

But probably all of that will become clear when I have the chance to take a closer look.

And either way, the patcher is doing what it is supposed to. My flashing of the pdroid.zip worked great. I am real proud of the work we've done. great job, pastime.

But yeah, the smali binaries are only affecting the classes.dex. That's all we are messing with really.
[LG Optimus 2x] pastime1971:
@ mateorod,

thanks for the kind explanation.

you can ignore those various .diff files. it is a left over, and will be removed.

i will do some more clean up for the script tomorrow, including saving a copy of original framework, and do some error checking...
[LG Optimus 2x] mateorod:
Okay, this is weird. The pdroid zip, not the restore zip are the ones without a classes.dex. Which should be causing major problems with my install, but isn't.

Okay, I know what it is. Pdroid is working on my current rom because it already worked, having had pdroid enabled originally with Botbrew.

Our updater script just updated the meta-info and those such files. We need to modify the script so that the patched and recompiled classes.dex is placed in the pdroid.zip framework files.

i was trying to diff the pdroid and restore and went WHAT?;)

And as for the errant patch, the patch header will inform the patch command if it needs to create a new file. But if it can't find a file it usually patches, then it will spit an error at you. That's all that we are seeing there.
[LG Optimus 2x] pastime1971:
yeah, i noticed it as well. i tried to baksmali again and framework.jar had been already changed by script, and it errored saying about missing classes.dex.

if you can tell me what needs to be done for classes.dex, i will include that tomorrow when i'm up again...
[LG Optimus 2x] pastime1971:
that is probably because they are compiled long time ago, and your AOSP ROM has updated.

framework.jar contains icons, menu texts, etc. replacing it with older one does that. (i experienced it when i tried circular battery mod.)

edit: looking at the thread you pointed, he definitely has made some changes to source. we may be able to make CM smali patching to work on AOSP. it would be great if you can invite him to this thread and interest him to include PDroid in his ROM...

edit: never mind. i saw you already tried...
[LG Optimus 2x] mateorod:
wait a minute. we have a maguro build. I can make a patch from that, I bet. We already have the non-pdroid as well, right?

pastime, what do you need to know exactly about the patching process? I will work on the AOSP patch (it will take me longer than usual because I have to deodex, which includes gathering and relearning some tools) but will keep an eye on the thread.

After the smali command, you have to find the classes.dex and preloaded classes and then put it inside the jar files before repacking.

We can include an out folder in the tools and place our output there, or just put them in a temp folder. But either way, we need to make sure they are placed in a very specific spot the way that the script is structured.

Otherwise the smali command will just keep overwriting the classes.dex file each time it is invoked.

edit: For instance, I see we are placing our output into a *.jar.out folder, which is the output for apktool. I don't know if that is an artifact or a created temp folder, but we can put some work folders right in the patcher or mkdir -p if we want. we can clean it up if we feel like it in the garbage collection phase at the end of the script.
[LG Optimus 2x] pastime1971:
@ mateorod,

yes, we have maguro AOSP builds in my mediafire folder. http://www.mediafire.com/myfiles.php#b3ita84jwd4fl

however, for jahrule's case, it looks like his rom is not odexed. maybe we can focus on that first.
[LG Optimus 2x] pastime1971:
i think i understand what you mean there. let me fix it.

i do find preloaded classes from framework.jar, patch it, and put it back in moded jar.

does classes.dex needs patching ? or smali does it automatically ?
[LG Optimus 2x] mateorod:
well, it looks like maguro is not odexed. So I am working on the patch now, although it is giving me a real strange output right now. At least, I don't see any odex files there.

we need a pdroid AOSP build to make a patch though.

Unless you have an idea?
[LG Optimus 2x] jahrule:
I see you wrote in ravers forum telling him that you can build the patch?
[LG Optimus 2x] pastime1971:
i invited him to this thread.

will see if he is interested...