[Q] How to create a Google Apps flashable zip from the stock ROM ? - General Questions and Answers

From CM Gapps page it says
It is possible to perform a "backup" of the Google Apps on your device and then "restore" them, but this does take additional steps which are not covered here.
Click to expand...
Click to collapse
I'd like to know how can I do this.
I've searched all across the forum but had no luck. It looks like some kind of trade secret.
I know that it's not just a matter of pulling the apk files. Because I can see that the zip has .apk, .jars, .so, configuration and certificate files.
I'm guessing this is done by extracting the files from a system.img.
But how is this done?
Is there some script available to build a gapps zip from a system.img file?
Another thing is that my OnePlus phone doesn't has an official LP update yet (although CM12 and their gapps work fine) so I suspect this would have to be done using the stock ROM of another device, maybe a Nexus. Is this correct?
Any help is appreciated.
Thanks

Related

Custom clockworkmod compatible update.zip

Hello, I would like to create my own update.zip that would be compatible with clockwork mod. I have several files in several locations that I manually copy over after new installs like multicolored bash nano iwconfig iwlist etc. And I think it would be much easier to create a installable package for that, I also delete a number of built I. Apps like tweeter amazon etc. And I have seen the scripts inside oyhers update.zip's that I could add the bash commands to remove those things as well.unfortunately I know nothing about what clockworkmod wants and I see binarys inside these zips dont know if those are customized for each zip or the same in all of them, I dont know what files or information is absolutely required. The best possible solution is if I had a blank update.zip that held all of the required files settings and all I needed to do was add my files and asd a few lines to a preexisting script to remove sum stock apps.thinking back I might have seen a file containing all the files names and md5 chucksums for each as well which if necessary I can do. Is there something like this available for download sumwhere? If not ajy resources to learn the required information and find the required binarys.thank you in advance.
Sent from my Droid using Tapatalk
Hi,
I've been trying to learn the same thing. I'm curious if you found anything useful since posting this.
Of course, if I find anything, i'll post back here too.
Thanks.
Same problem here
Good to hear someone with same problems. I want to create a generic ROM for myself and I want to use ClockworkMod to help flash it instead of using fastboot.
Well, I have found no documentation about what ClockworkMod may need for a zip file.
But I guess it could be possible to just replace them with your own by downloading an existing zip file created by someone else.
I'll try it to see if that works or not. Of course, a documentation would be better.
I regularly flash a new CM7 Nightly as they are released and I have to manually modify some things each time a new rom is flashed. I change screen density and add a notification ringtone that CM7 does not have. I wanted to automate that. Since I have to reflash the Google Apps each time anyway, I thought why not modify the gapps zip to include my changes. After searching the web I found a little info about how to do it. I just modify the zip on my computer using WinRar, copy the file to my device and re-sign the package using signapktic which is free on the market. Then flash using CWM. It worked great. No more manual adjustments. There are some instructions here which helped me:
http://forum.cyanogenmod.com/topic/15030-moving-apps-to-system/
I been getting into the kitchen
http://forum.xda-developers.com/showthread.php?t=633246
So far i`ve managed to integrate a few apps , ringtone should be easy
next the fonts from utmost rom
thanks to the kitchen, Im now running at script kiddie level

[Q] Editing zip before flashing a ROM

I know I have done this before and this is a noob question, but lately I've been having trouble with this.
If I make changes to the zip file of a ROM (eg replace a few existing files, and remove some unwanted system APKs, but not add anything new), do I need to sign the zip before flashing or just flash straight after editing? Also what's the best tool to use to replace the files within the zip? I trust WinRAR will do the trick...
djsubtronic said:
I know I have done this before and this is a noob question, but lately I've been having trouble with this.
If I make changes to the zip file of a ROM (eg replace a few existing files, and remove some unwanted system APKs, but not add anything new), do I need to sign the zip before flashing or just flash straight after editing? Also what's the best tool to use to replace the files within the zip? I trust WinRAR will do the trick...
Click to expand...
Click to collapse
I've never added anything (yet!), just deleted un-wanted APK's and altered some system files (ie build,prop etc). I've never signed anything and I used IZArc although only as that's what's installed on my XP system.
This is something that I too would like to do more so that I can further personalize and tweak some of these already great ROMS, so I'm also curious for some pointers from more the experienced.
Check the portal, there's an app to create flashable zips there.
PS - POST QUESTIONS IN THE GENERAL SECTION !!!!!!!!
You can set a flag in recovery to check for signatures or not. When it is not set you can flash any zip file
Sent from my HTC Desire S using XDA App
jorgen2009 said:
You can set a flag in recovery to check for signatures or not. When it is not set you can flash any zip file
Sent from my HTC Desire S using XDA App
Click to expand...
Click to collapse
I tried this once, and then I flashed the zip. It was a CM7 zip which would normally take at least 20-30 seconds to complete, but this modified zip flashed in less than ten seconds. It said successfully flashed but when I rebooted nothing had actually happened. Hence I was wondering what went wrong?

[Q] (Stock Deodexing) -- boot.img failure on update.zip flash? Fix, Replace? Re-Zip?

I have a ZTE990 avail.
Currently I'm rooted with no other roms installed, simply stock, and odexed.
I've tried to manually de-odex using baksmali, Xultimate, etc. All were a pain, all wouldn't work properly.
I found someone and downloaded someone who just simply uploaded a Stock_Deodex.zip rom. Sounded perfect.
So I boot into CWM, try to update and...
assert failed: write_raw_image("/tmp/boot.img","boot" android
Click to expand...
Click to collapse
Since I have stock.. and am just trying to De-Odex.
Can I just unzip the Stock_Deodex.zip, delete the current (apparently faulty) boot.img, and replace it with one of the ones created with the cwm recovery, re-zip and attempt to update as usual?
Or since (if my understanding is correct), the only thing necessary for a system to become deodex is the files in /system/app and /system/restore.
Obviously when I un-zip stock_deodex.zip I have access to them. Could I possibly just replace the two folders (somehow?) and be properly de-odexed?
Any other options that I could use that'd be best?
Much appreciated to anyone who helps, thanks!

Modyfying existing ROM

Hi,
I decided to try to make a modification of an existing ROM which would suit me better right after flashing. Nothing large, only adding some apps and stuff. But Ive got a couple of questions:
1) Ive read some apps cant run from /system partition. Looks like that (at least) one of mine is one of them - it FCs when in /system/apps or /system/priv-apps. Is there any workaround to make this work? I dont want to lose it when doing factory reset (or to flash the ROM again after every factory reset).
2) I wanted to add langunages (http://forum.xda-developers.com/showthread.php?t=2602704) but according to forums those files are odexed. How could I deodex them to make them run on an deodexed ROM?
3) I want to include the faux kernel but Im not sure if simply copying those files into the ROM would do ... in the other cases it went ok but Im not sure about the kernel - Im afraid I could break something.
4) Can I also use the ROM file to store other files? I mean - if I put files into the ROM in /data/media/0/ would it simply appear in my home directory or could this break anything - by which I mean to destroy my existing files?
Thanks for any leads!
michalurban said:
Hi,
I decided to try to make a modification of an existing ROM which would suit me better right after flashing. Nothing large, only adding some apps and stuff. But Ive got a couple of questions:
1) Ive read some apps cant run from /system partition. Looks like that (at least) one of mine is one of them - it FCs when in /system/apps or /system/priv-apps. Is there any workaround to make this work? I dont want to lose it when doing factory reset (or to flash the ROM again after every factory reset).
2) I wanted to add langunages (http://forum.xda-developers.com/showthread.php?t=2602704) but according to forums those files are odexed. How could I deodex them to make them run on an deodexed ROM?
3) I want to include the faux kernel but Im not sure if simply copying those files into the ROM would do ... in the other cases it went ok but Im not sure about the kernel - Im afraid I could break something.
4) Can I also use the ROM file to store other files? I mean - if I put files into the ROM in /data/media/0/ would it simply appear in my home directory or could this break anything - by which I mean to destroy my existing files?
Thanks for any leads!
Click to expand...
Click to collapse
1) What is the app? on system/app they should work fine since kitkat update, i think
2) To deodex i used a kitchen i got out of foro nexus (cant get the link atm) that only worked on linux. If you want to translate things in your rom, i think it can be done without deodexing, im not sure.
3) Copy paste should work fine but if you take a look at faux's meta inf, see what's there, merge it with your rom's meta inf. But it should work with cp
4) You can use the meta inf to link files to storage like your sdcard, yes. However, if you try to put a wallpaper somewhere inside the rom it wont show up
anerik said:
1) What is the app? on system/app they should work fine since kitkat update, i think
2) To deodex i used a kitchen i got out of foro nexus (cant get the link atm) that only worked on linux. If you want to translate things in your rom, i think it can be done without deodexing, im not sure.
3) Copy paste should work fine but if you take a look at faux's meta inf, see what's there, merge it with your rom's meta inf. But it should work with cp
4) You can use the meta inf to link files to storage like your sdcard, yes. However, if you try to put a wallpaper somewhere inside the rom it wont show up
Click to expand...
Click to collapse
Thanks very much for your reply! Now:
1) The app is a game, Traffic Racer. When I flash a ROM where this app has been put in /data/app it runs fine. In /system/app or /system/priv-app it FCs. As you say it should work Ill try to do it again - but I tried it twice in /system/priv-app and once in /system/app already so I dont believe it would work. BTW I use APKs from update.zip created by TiBa if it could be relevant.
2) Linux is not a problem so Ill try to find the link here.
3) Ill try only to copy the files first before messing with meta files.
4) I only want to store some apps config backup files (for Apex launcher and Agenda widget mainly).
michalurban said:
Thanks very much for your reply! Now:
1) The app is a game, Traffic Racer. When I flash a ROM where this app has been put in /data/app it runs fine. In /system/app or /system/priv-app it FCs. As you say it should work Ill try to do it again - but I tried it twice in /system/priv-app and once in /system/app already so I dont believe it would work. BTW I use APKs from update.zip created by TiBa if it could be relevant.
2) Linux is not a problem so Ill try to find the link here.
3) Ill try only to copy the files first before messing with meta files.
4) I only want to store some apps config backup files (for Apex launcher and Agenda widget mainly).
Click to expand...
Click to collapse
Oh, games could cause issues, yes. Better leave it on data app. Messing with meta inf is totally easier than it sounds anyways and could help fixing any possible bugs, you gotta try it. Backup files i dont think they'll work on the rom but you can store them into storage/emulated/legacy which is the storage, though you could do this any other easier way
anerik said:
Oh, games could cause issues, yes. Better leave it on data app. Messing with meta inf is totally easier than it sounds anyways and could help fixing any possible bugs, you gotta try it. Backup files i dont think they'll work on the rom but you can store them into storage/emulated/legacy which is the storage, though you could do this any other easier way
Click to expand...
Click to collapse
Thanks again! Ive got one more question about including the faux kernel. The updater-script is supposed to run this command during the installation in CWM:
Code:
package_extract_file("boot.img", "/dev/block/platform/msm_sdcc.1/by-name/boot");
... which I dont know how to implement. If I would only copy all files it would overwrite the original boot.img (Kitkat+ 1.1 original anyway) - which im not sure is the same. So Im not sure if it wont screw something up ...
Or is this extraction the same as copying it? Does the "/dev/block/platform/msm_sdcc.1/by-name/boot" just mean - "its a block device on first SD, partition name boot"?
michalurban said:
Thanks again! Ive got one more question about including the faux kernel. The updater-script is supposed to run this command during the installation in CWM:
Code:
package_extract_file("boot.img", "/dev/block/platform/msm_sdcc.1/by-name/boot");
... which I dont know how to implement. If I would only copy all files it would overwrite the original boot.img (Kitkat+ 1.1 original anyway) - which im not sure is the same. So Im not sure if it wont screw something up ...
Or is this extraction the same as copying it? Does the "/dev/block/platform/msm_sdcc.1/by-name/boot" just mean - "its a block device on first SD, partition name boot"?
Click to expand...
Click to collapse
Put faux's boot.img on the rom first, then on updater script go to the line that refers to extracting boot.img (should be like the last one) and replace that with the command on faux's updater script. That means it will extract it in that directory, nothing else. Be sure to copy modules aswell and set the perms
Q&A threads should be created in the Q&A forum... not the Development forum.
Thread moved.
One more question - is there a special way how to pack the ZIP file? Cause I unpacked a ROM, added some apks, packed it but it didnt work (no error, just ended at "opening rom" or what the CWM message is) ... but when I modified existing ZIP it went fine ...

[Q] Does anyone have a copy of the stock 4.4.3 Mail apps?

Does anyone have, or know where I can find, a copy of the 4.4.3 stock mail & exchange apps?
I'm running modded versions, which I need to restore to stock before I can apply the 4.4.4 update (getting bored of seeing the notification now) - and have misplaced my own backup copies.
Thought a factory restore would have done the job - but didn't!
Thanks
The factory update zip would be a good place to look
pepdavies said:
The factory update zip would be a good place to look
Click to expand...
Click to collapse
Thanks, I'll give that a go - not extracted files from a factory image before, but do have the image so I'll give it a try!
aldredd said:
Thanks, I'll give that a go - not extracted files from a factory image before, but do have the image so I'll give it a try!
Click to expand...
Click to collapse
Would be easier to find a rooted stock flashable zip file. The factory images have .img files which take effort to extract
http://forum.xda-developers.com/goo...t/rom-stock-4-4-3-ktu84m-odex-deodex-t2771010
rootSU said:
Would be easier to find a rooted stock flashable zip file. The factory images have .img files which take effort to extract
http://forum.xda-developers.com/goo...t/rom-stock-4-4-3-ktu84m-odex-deodex-t2771010
Click to expand...
Click to collapse
Cheers, I will call that one plan B then - I've managed to extract the files - just moving the to app folder now!
(this link was very useful for the extract process http://forum.xda-developers.com/showthread.php?t=2294909)
Fab, was able to get it all to work using the extracted files - and learnt something new in the process (how to extract from an image)
thanks for the help.

Categories

Resources