[Q] Trying to create a CW zip with all the apps i want to install automatically - Nexus S Q&A, Help & Troubleshooting

Can some one provide some instructions on how to go about making a CW zip file to flash and install all the apps that is on my phone?
I've seen a few of these floating around in the forum, and wanted to make my own to save time after every ROM flash
Do I just grab all the APK files throw them into a folder and Zip & Sign it?
or do I have to do a Nandroid backup first, then only use the app files from the backup?

I would like to know this too....

Would be nice as well instead of restoring
Sent from my Nexus S using XDA App

Take an existing update.zip type file. Add a folder to it with the full proper path for your apps you want to pre-install (typically this will be /data/app) and put all the apps in that folder. Should look something like this in a windows/mac explorer window:
Code:
META-INF
/com/google/android/updater-script
data
/app/myfirstapp.apk
/app/mysecondapp.apk
Then use a text editor to edit the META-INF/com/google/android/updater-script file to include the commands to copy over your stuff. It would something along the lines of:
Code:
ui_print("Installing New App Files to /data");
package_extract_dir("data", "/data");
Edit out anything in the update template you're working out of that you don't want to happen (ie., format or symlinks, etc).
Repackage the zip file and make sure nothing else got in there by mistake by re-opening it (like those pesky Mac .ds-store files).
You can re-sign it with the android tools, but I don't believe you need to with Clockwork.
I would have a fresh nandroid before testing anything, of course.
You feel this approach is better than just using Titanium to restore apps? You won't get back any app data that isn't stored on the sdcard.

Thanks!
yes, now that makes sense, i recall reading that some where else to add extra APK to the ROMs
so it's the same idea, just without the ROM portion
now i get it

distortedloop said:
Take an existing update.zip type file. Add a folder to it with the full proper path for your apps you want to pre-install (typically this will be /data/app) and put all the apps in that folder. Should look something like this in a windows/mac explorer window:
Code:
META-INF
/com/google/android/updater-script
data
/app/myfirstapp.apk
/app/mysecondapp.apk
Then use a text editor to edit the META-INF/com/google/android/updater-script file to include the commands to copy over your stuff. It would something along the lines of:
Code:
ui_print("Installing New App Files to /data");
package_extract_dir("data", "/data");
Edit out anything in the update template you're working out of that you don't want to happen (ie., format or symlinks, etc).
Repackage the zip file and make sure nothing else got in there by mistake by re-opening it (like those pesky Mac .ds-store files).
You can re-sign it with the android tools, but I don't believe you need to with Clockwork.
I would have a fresh nandroid before testing anything, of course.
You feel this approach is better than just using Titanium to restore apps? You won't get back any app data that isn't stored on the sdcard.
Click to expand...
Click to collapse
Ya essentially this method is doingan advanced nandroid restore for data only except without the settings.
Sent from my MattedBlues CM7 Nexus S from the XDA Premium app.

kenvan19 said:
Ya essentially this method is doingan advanced nandroid restore for data only except without the settings.
Sent from my MattedBlues CM7 Nexus S from the XDA Premium app.
Click to expand...
Click to collapse
I suppose if you want the app data restored as well, you would just need to identify it's location in the /data directory and add it to the /data folder in the update you're making. Seems like most of the app data goes into /data/data.
Just thinking out loud here...
So for a sample app on my phone I have called jefit pro I'd put the following in the update file.
Code:
/data/je.fit.pro-1.apk <---apk itself
/data/data/je.fit.pro <--the folder
/data/data/je.fit.pro/databases/data
/data/data/je.fit.pro/lib
/data/data/je.fit.pro/preferences/preferences.xml
I'd just pull the whole folder for the /data/data/je.fit.pro from the phone via adb.
I'm not sure how useful putting the data back is, since that's not a static set of files on many apps, but for some apps where the data is just some settings or preference files it may be a nice touch.
I don't really see any advantage to this over just use Titanium to restore apps and data, but it should work.
(<<---- this would be the whole folder and its subfolders that I pulled via adb off the phone)

distortedloop said:
I don't really see any advantage to this over just use Titanium to restore apps and data, but it should work.
Click to expand...
Click to collapse
AllGamer, I'm glad you brought this up, while I don't personally have any apps I want to put on the phone in this method, except perhaps titanium itself, I just realized we could of course do the same thing for all those little custom tweaks we put on our phones, like for me I push my personalized ringtones/notification sounds to /system. That's easy enough with adb or rootexplorer, but why not just flash them from a zip while in CW after a wipe or install of a new rom?

distortedloop said:
AllGamer, I'm glad you brought this up, while I don't personally have any apps I want to put on the phone in this method, except perhaps titanium itself, I just realized we could of course do the same thing for all those little custom tweaks we put on our phones, like for me I push my personalized ringtones/notification sounds to /system. That's easy enough with adb or rootexplorer, but why not just flash them from a zip while in CW after a wipe or install of a new rom?
Click to expand...
Click to collapse
the idea came up from several places, first Titanium Backup itself offers to create a signed .zip installer for CW
and i've seen other devices forums with people packing up like 100+ apps/tweaks/mods into it to flash after CW is done flashing the new ROM
yes, of course we can use TI, i have TI pro and it's very easy, but Ti is slow.... at restoring 300+ Apps
but everytime i see CW restoring a Zip file or even a full Nandroid backup, it does it so fast and quickly, that i though... hell might as well keep an updated signed .zip wtih all my must have apps, and flash it along right after any new ROM flash (when testing out different Custom ROMs) then i don't need to spend like an hour everytime restoring + configuring the phones
i noticed that Ti works a hell of a lot faster if the apps are already installed, and you only need to restore the data.
and that is the main reason i want to compile a list of all the apps
once they are all installed, then i can use any of the good market utilities that can do mass Apps2SD and i'll be up and running in as quickly as 15min vs. a whole hour waste on a restore/config everytime you change the ROM
using Ti i found most of the System settings can be restored safely without corrupting the new ROM
email
accounts & syncs
bluetooth pairings
wifi
... ah shoot forgot the rest
only do not restore settings for:
launcher,
wireless network (phone company)
android market
and anything that has to do with default settings
probably this weekend i'll dissect the CW zip created by Ti itself, and add more to it

Sounds like a good plan...but you've got 300+ apps if I recall correctly. I imagine that will take a long time to restore either method!
The Titanium update zip is a good place to start. Use the setting to make it a "user" app and it will put it in /data, where you want the rest of your apps as well. You could just dump what you want right into the zip file there in the folder that has titanium's apk itself and not even worry about messing with the updater-script file.

Related

Adventures in Flashing

Let me begin by stating that I am not an expert. What I am about to relate are my own experiences today. They may help answer some questions and raise others. Hopefully someone that knows more than me will jump in and add to this.
I loved my g-tab when I got it and reloaded it with tnt-lite. I was sad when I reflashed it to try vegan and all my apps were gone. This isn't necessary but I had no idea what I was doing in any orderly sense of the word. Since then there has been a great post with simple steps on how to flash a rom. http://forum.xda-developers.com/showthread.php?t=1016695 I happened to see the Woot announcement and jumped on it to get a second tablet to experiment with so I wouldn't mess up my original once I had gotten it to just where I wanted it (that too was probably not necessary as you will soon read).
Out of the box I setup the gtab and then installed the ota update to bring it up to current specs. Next I installed ClockworkMod and re-partioned he tab as described in the post cited above. Next I made a backup using ClockworkMod so I had a full backup of the original system. These got stored in a folder ClockworkMod/Backup (and it seems they have to be here if you want to restore them). Being a cautious kind of guy, I made a copy of the folder on my SDcard2. Also, being perhaps a bit more cautious, I plugged in the usb and copied the same folder to my PC for good measure.
Now, I made a folder on the g-tab called INSTALLS (you can call it whatever you want) and copied the various rom zip files into it. I also copied clemsyns newest kernel there for use with Calkulins 1.1 rom. I also copied Calkulin's Format-All zip file here as well http://forum.xda-developers.com/showthread.php?t=985705&highlight=calkulin's+rom
Initially, I was using ClockworkMod to wipe the partitions but it appears to me that Calkulin's FormatAll can do it all at once (correct me if I'm wrong) so I switched to using that.
So - Reboot, hold down the power and volume+ keys to start ClockworkMod. Click over to install zip from sdcard. Click to choose zip from sdcard. Browse to your INSTALL directory and there are all the zip files. Right now mine has tnt_lite_v4.40/, Calkulin's FORMAT_ALL.zip, Calkulin's_G-Tab_ROM_v1.1.zip, ClemsynFROYOVersion9.zip,gtab.VEGAn.1.00.beta5.1.user.final.zip and gtab.VEGAn.1.00.beta5.11.supp.zip
Select Calkulin's FORMAT_ALL and it reformats "critical" partitions. Once it finishes, come back here and choose a ROM to install. For the sake of discussion, choose the first - tnt_lite_v4.40/ Once it finishes installing, reboot and there you are with tntlite4.40. You'll still have to do the market fix as described in the installation instructions cited in the beginning of this post.
Now get it all set up the way you like, play around, etc. and then do this. Boot up to ClockworkMod and make a backup. When it is done you can boot back up into tnt_lite or whatever ROM you've installed. Use a file explorer and you'll find the clockworkmod folder and inside you will find a folder named backup and inside is your backup. I copied it to my SDCard2 and also to my PC for safe keeping.
Now you can rinse and repeat as needed for all the other roms you want to try. So format, install rom, configure it then back it up with Clockwork Mod. When you've done all the roms you want you can just restore any one you feel like using. Remember - you are restoring from the clockworkmod/backup folder, not the INSTALL folder. Also, the names of the backups are like datestamps so write down which is which if you have several. I have a little text file in the directory that I update to keep track of which is which.
It seems pretty simple and perhaps there is something I've missed but so far I've installed, backed up and restored several roms and this has worked without a hitch. Oh - the backups seem to have checksums or something because a backup of one g-tab won't restore on another.
I hope this helps some of you that are playing around like I am without a full understanding of how everything works but still determined to try stuff. Again, anyone with more information and knowledge to add, please leave your comments.

Flash a Data.img?

I extracted all my files from my data.img backup and made it into a .zip. Is there anyway
i can cwm flash that data.zip to get all my data back? I tried just flashing the zip and it says,
"(bad) Installation Aborted."
Any help would be greatly appreciated
mafo5000 said:
I extracted all my files from my data.img backup and made it into a .zip. Is there anyway
i can cwm flash that data.zip to get all my data back? I tried just flashing the zip and it says,
"(bad) Installation Aborted."
Any help would be greatly appreciated
Click to expand...
Click to collapse
Here's a few things you could do assuming that what you want is even in this zip file.
1) Get a working cwm format zip file and take a close look at it because you need to use it as a template if this is going to work. In particular, check out updater-script in META-INF\com\google\android\*. Updater-script is what directs the restore operation so it needs to match what you want to do. You can get the idea by looking at one that restores say, some data or system files, like a kernel will always restore some /system/lib/module files.
2) Since you've got some sort of zip file, make sure it matches the general format of a working cwm zip file and then just make sure step 1) is right.
3) I don't know if this is still a search for .android_secure folder on /sdcard, but if it is you're probably not going to get there from here, because the tf101 generallyl doesn't have that file since there's no need for tf101 -> sdcard app storage. For example, mine never had that folder either on internal or external storage.
4) Kernels aren't in the data or system archives from cwm, so that is possibly some sort of show-stopper too. I'm working on the cwm source today a bit to try to create a boot.img (or in the newer cwm lingo, boot.*.tar) archive. That archive will use blob and boot tools to be able (via the direction in updater-script) burn the blob onto block m*4.
I hope that helps.
Oh yeah, another thing you can try: If you wanted just the 'apps' from the cwm archive, you shouldn't even need the zip file. All you need to do is run Titanium Backup (assuming you've got it or can get it), and use the new feature in options called restore from cwm backup (or something like that). I've used it and it works fine on 3.x and 5.x cwm backups.
-- good luck
hachamacha said:
Here's a few things you could do assuming that what yowant is even in this zip file.
1) Get a working cwm format zip file and take a close look at it because you need to use it as a template if this is going to work. In particular, check out updater-script in META-INF\com\google\android\*. Updater-script is what directs the restore operation so it needs to match what you want to do. You can get the idea by looking at one that restores say, some data or system files, like a kernel will always restore some /system/lib/module files.
2) Since you've got some sort of zip file, make sure it matches the general format of a working cwm zip file and then just make sure step 1) is right.
3) I don't know if this is still a search for .android_secure folder on /sdcard, but if it is you're probably not going to get there from here, because the tf101 generallyl doesn't have that file since there's no need for tf101 -> sdcard app storage. For example, mine never had that folder either on internal or external storage.
4) Kernels aren't in the data or system archives from cwm, so that is possibly some sort of show-stopper too. I'm working on the cwm source today a bit to try to create a boot.img (or in the newer cwm lingo, boot.*.tar) archive. That archive will use blob and boot tools to be able (via the direction in updater-script) burn the blob onto block m*4.
I hope that helps.
Oh yeah, another thing you can try: If you wanted just the 'apps' from the cwm archive, you shouldn't even need the zip file. All you need to do is run Titanium Backup (assuming you've got it or can get it), and use the new feature in options called restore from cwm backup (or something like that). I've used it and it works fine on 3.x and 5.x cwm backups.
-- good luck
Click to expand...
Click to collapse
OK Ill see if the titanium backup way works. I'll report back to you if it works. Also if I do get all my apps back is there a way to get the app data?
Hi - If Titanium is bringing up the selections screen then the usual choices for each app are data/app/data+app, so yes.
The titanium back option is called "extract from Android backup" I can't do
It right now because I don't have my tf with me. But I don't think it will work because
The Android backup I made was currupted. I would get the .android_secure error
And couldn't restore. So if titanium takes the data.img from my Android I'm thinking
It won't work but if I can give it the zip it probably will. I won't be home for a couple
Hours.
thank you so much i got all my stuff back using titanium backup!
mafo5000 said:
thank you so much i got all my stuff back using titanium backup!
Click to expand...
Click to collapse
Cool! --
Congrats.

[Q] Adding Titanium Backup to custom rom

I'm running a custom rom (CM7.2-RC3-APOCALYPSE-BAREBONE v12-06-12, by itasoulas, based on CM7.2 RC3 by vo-1 v31-05-12) on my Galaxy Ace (GT-S5830D). I'm about to flash a newer version of the custom rom, but I wanted to add Titanium Backup and S2E to the rom, so that my ext partition is mounted automatically after flashing, and Titanium Backup is already on and ready to restore.
I have the apk files for S2E & Titanium, do I just add them to the system/app folder in the rom zip? Or do I put them in the data/app folder, in which case I'd have to create said folder in the rom zip? Please let me know, as it would let me eliminate a whole 2/3 steps in the flash/restore process (flash->install S2E->reboot to mount ext->install Titanium->restore becomes flash->restore).
Any help would be greatly appreciated. I'd post this in the CM7.2-RC3-APOCALYPSE thread, but this is my first post and I'm not allowed to post there yet.
As you can see, I didn't get any response from my post, so I rolled the dice and went for it.
So here's how it works for those who don't know:
To add system apps to a rom, place the apk files in the system/app folder in the zip. If you want the apps installed as user apps, place them in the data/app folder in the zip. Worked like a charm. I flashed, booted, configured S2E (installed w/rom), rebooted, ran Titanium Backup and restored everything.
BTW, I was also able to add the APN info for my carrier into the rom. You can do that by editing the apns-conf file in the system/etc folder in the zip. This is handy because when I flash a custom rom I have no APNs set up, as well as no wireless networks saved, so by doing this I was able to run the initial setup when you first reboot the phone (instead of just skipping it, missing Gapps, and adding my account later).
Hope this helped for anyone who is interested.
Neat. Though I'd likely keep titanium as a user app, I'm definitely going to try this.
Sent from my U8150 using XDA
There is an app to move apps from users space to system space available on the google play. It is called app-mover. It is simple tool. If you are already using link2sd then there is a menu option for moving the apps.

PAC preferences wiping after updates

Hey all,
I'm using the PAC ROM found here. Anytime I dirty flash an update, I lose all my Paranoid Android preferences (DPI, color schemes, etc). I've backed them up with the internal backup, but when I search for the backed up file (in order to try to manually back it up via Dropbox or Drive) I can't find the backup anywhere. I've searched for this file/folder but I can't for the life of me find it. Is there some location, naming, or compression issue that I don't know about that would be inhibiting me from finding the preferences file? Re-doing all my preferences is a huge pain.
Also, I know that dirty flashing is not preferable. I'm familiar with Titanium, but even using that, I feel like I spend a lot of time re-configuring system settings, installing apps that I shouldn't restore with Titanium, etc. Is this the normal hassle associated with updating ROMs, or am I making it harder than it should be?
Thanks in advance!
The file is here:
/system/etc/Paranoid/properties.conf
You'll need to manually drop that in the updated ROM.
Before restoring you need to make sure you don't have the broken Paranoid Preferences (it's the black one). If you do, take ParanoidPreferences.apk from /system/app of your old Pac-Man (make sure it's the white one) and replace the current apk. Restart.
Now you can restore!
Sent from my SAMSUNG-SGH-I727 using Tapatalk 2
curiouscrackers said:
The file is here:
/system/etc/Paranoid/properties.conf
Click to expand...
Click to collapse
It says that file was last modified a month ago... Are you sure that's it?
curiouscrackers said:
Before restoring you need to make sure you don't have the broken Paranoid Preferences (it's the black one). If you do, take ParanoidPreferences.apk from /system/app of your old Pac-Man (make sure it's the white one) and replace the current apk. Restart.
Click to expand...
Click to collapse
Which one is this (oh, I can't post links... cool. imgur extension is sjDdwRa.png)? Black PAC on white circle. This is me still on the working ROM install, so if it's black, I don't know what to do...
Thanks for the help!
Any thoughts on dirty flashing the PAC updates in general? Should I not be doing that?
Here, http://db.tt/SgpYcZ8a. This is a working ParanoidPreferences.apk. Drop it in /system/app replacing the existing one (don't forget make a copy first if you want a backup). Make sure to change it's permissions to match the other files in this directory. Restart.
This will allow you to make and restore backups, as well as adjust per-app settings without being in landscape. If you dirty flashed then you should be able to restore your backups. If not, you'll have to restore a nandroid to get the config file...
Backups can be found in /data/data/something (I'm going by memory here). The file names are something like 20130321.conf
Or
The current config file is in /system/etc/Paranoid and is called properties.conf
Copy one of these and drop it into /system/etc/Paranoid of your current Pac ROM. If it's one of your backups rename it properties.conf. Change the permissions and restart. Your phone should boot with the settings already in place.
Edit.
I'm sorry, I didn't see before where you said you were on the working ROM. Then just do the first part (replace the apk), then go into paranoid and do a backup. After updating, replace the apk again and you should be able to restore. If you do a clean flash you will still need to copy the config file.
Sent from my SAMSUNG-SGH-I727 using Tapatalk 2
Victory! I wasn't able to overwrite the apk with ES File Explorer due to folder permissions, but $4 Root Explorer did the trick.
Thanks very much for your help!

Backup and Restore Apps and Data [Manually]

Hello folks,
I am tired of restoring all my apps settings and replaying my games from the beginning each time I install a new rom or do a factory reset so I was looking (a couple of hours ago) for how to restore my apps setting and especially my games progress after every data wipe......
I read that many users faced problems using helium and some similar apps (Titanium Backup seems to be perfect for this job but it's a paid app and that is the problem:laugh and after all this I figured out that what were doing these apps to make a full backup of an app is just making a copy of the app.apk and the app folder in /data/data where app is the name of the considered app(sorry if this is well-known but I really didn't know)
So I made this tutorial on how to backup/restore your apps and data MANUALLY because this let you choose which app to backup/restore...
This tutorial is for noobs (because I am noob!!!!!)
Requirements:
Galaxy SL or any other android device.
ES explorer or any other file explorer with root access support.
Your phone needs to be rooted.
Backing up app and data:
Enable your explorer read/write permissions (for ES explorer >>settings>>root options).
Go to /data/app and copy the app.apk to your SD card backup folder.
Go to /data/data and copy app folder to your SD card backup folder.
that's it, now your app is fully backed up.
Restoring app and data:
Install app.apk from backup folder
Go to /data/data and remove the existing app folder (don't launch the app now because it won't start)
Copy the app folder from the backup folder to /data/data
launch your app now, it should work!
that's it, now your app is fully restored.
Notes:
I tried this to backup and restore NFS most wanted progress and it WORKED!!!!
Maybe this methode don't work for some apps but it should work for the rest of them.
For system apps go to /system/app .
app folder should start with "com." (for example "com.ea.games.nfs13_na" for NFS most wanted).
I don't know what is the difference between this methode and the adb methode so can someone tell me if there is a difference.
Restoring apps settings from/to different android versions may not work
hey guys, this is my first thread so please don't blame me if it's not good enough
sorry for my bad English and hope this will be helpful for you
Best regards
any replays here???
how to restore helium backup manually????
:fingers-crossed::fingers-crossed::fingers-crossed:
ASMI1 said:
3. Copy the app folder from the backup folder to /data/data
4. launch your app now, it should work!
Click to expand...
Click to collapse
Thanks, it works!
But there is some small point. The Android system uses technical users to separate the data of the apps from each other. If you copy the files this way then the copied files will belong to root and be accessible for all apps.
So you should also take care that the file and folder attributes for rights, users and groups are correctly set. Therefore start and stop the installed app again, it will create its folder in /data/data. You can then see (and set) the attributes in the properties entry of ES file explorer. And only then overwrite the files with the backup and after this set the attributes.
Unfortunately this is not very comfortable with ES file explorer, because it has to be done for each and every file/folder separately and the technical user has to be chosen from a long list...
ThemGo said:
Thanks, it works!
But there is some small point. The Android system uses technical users to separate the data of the apps from each other. If you copy the files this way then the copied files will belong to root and be accessible for all apps.
So you should also take care that the file and folder attributes for rights, users and groups are correctly set. Therefore start and stop the installed app again, it will create its folder in /data/data. You can then see (and set) the attributes in the properties entry of ES file explorer. And only then overwrite the files with the backup and after this set the attributes.
Unfortunately this is not very comfortable with ES file explorer, because it has to be done for each and every file/folder separately and the technical user has to be chosen from a long list...
Click to expand...
Click to collapse
Hi ThemGo! You have reopened a bit old thread :laugh: Now a days, the play store is bull of useful apps to backup almost everything on your android device. I found that Titanium backup Pro is the best among them all. Its a paid app but it really deserve it
Kind Regards
ASMI1 said:
the play store is bull of useful apps to backup almost everything on your android device
Click to expand...
Click to collapse
Of course, but what - as happened to me last month - if your phone dies suddenly, you get yourself a new one and fortunately have a not too old backup made with cwm recovery, what will you do?
Yes, extract the necessary data from the backup and then copy it manually to the new phone.
ThemGo said:
Of course, but what - as happened to me last month - if your phone dies suddenly, you get yourself a new one and fortunately have a not too old backup made with cwm recovery, what will you do?
Yes, extract the necessary data from the backup and then copy it manually to the new phone.
Click to expand...
Click to collapse
Havent really tried that but if both phones are using same android version that may work. Because some of my apps that were backed up on Jellybean are not working on Kitkat & Lollipop even when using the same phone so I guess the backup procedure is not just a matter of copying & pasting.

Categories

Resources