FORUMS
Remove All Ads from XDA

[DEV][SCRIPT] First-Boot App Install

340 posts
Thanks Meter: 547
 
By SenseiSimple, Senior Member on 12th January 2012, 07:16 AM
Post Reply Email Thread
13th January 2012, 02:45 AM |#11  
SenseiSimple's Avatar
OP Senior Member
Flag Austin, TX
Thanks Meter: 547
 
Donate to Me
More
Quote:
Originally Posted by sniperkill

Thanks for the reply buddy, so what I THINK your saying is to create a folder called "first boot" in my data folder?

In loving memory of my son" Jeffrey Ryan Giles" 11/17/1992 to 11/25/2011 - RIP :'(

Quote:
Originally Posted by bbelos

Are you trying to do this in a ROM or on the phone? Sorry if that's a dumb question, but I just want to be sure we're on the same page.

Sent from my SPH-D700 using XDA App

i hadn't noticed my zip routine apparently skips empty .folders

in the zip, there SHOULD have been /fs/data/.firstboot into which you place whatever apk files named according to their actual package name i.e. com.keramidas.TitaniumBackup.apk for Titanium Backup, com.alensw.PicFolder.apk for QuickPic and so on...

you can find out this info in Titanium Backup by finding the app in the list and tapping its name to show the data store location.

it HAS to correspond to the actual package name in order to properly back up the data files because the package manager binary as run from a script won't overwrite the data dir so the old data has to be synced back into the new install (rsync)

I am currently refactoring the script to reduce the number of dependencies... the system will then consist of the init.d script, zipalign and rsync bins, and the /data/.firstboot.sh, /data/.firstboot dir all in one place rather than scattered throughout the system.
 
 
13th January 2012, 02:58 AM |#12  
SenseiSimple's Avatar
OP Senior Member
Flag Austin, TX
Thanks Meter: 547
 
Donate to Me
More
Quote:
Originally Posted by irule9000

Is it possible for someone to develop an application to backup your personal apps and then running a script in clockwork or on first boot that does the same thing as this, alllowing for personal apps to be in the rom directly after flashing. I understand that sometimes apps may not be compatible, but can randomroms rdu script be modified to choose to do this?

Sent From My Cyan4g

it would be possible to create an app to do this, and i considered it because of the need to make sure the android system is fully loaded for package manager to work, but given the requirement for full root access to start running before the system is up without having to worry about android permissions or getting SuperUser approval it's easier/more effective to do it as part of the system init in a script.

as far as randomking's rdu script, they would be compatible, but they exist separately as in one shouldn't interfere with the other, because the firstboot script runs long after install once the system is up and running.

you could modify the rdu setup to include/exclude the /data/.firstboot dir and .firstboot.sh script based on the selected config, since the init script does nothing if it doesn't see the /data/.firstboot.sh file, and the .firstboot.sh script does nothing if it doesn't see the .firstboot dir
13th January 2012, 03:13 AM |#13  
Inactive Recognized Developer
Flag Chicago
Thanks Meter: 2,805
 
Donate to Me
More
Quote:
Originally Posted by SenseiSimple

it would be possible to create an app to do this, and i considered it because of the need to make sure the android system is fully loaded for package manager to work, but given the requirement for full root access to start running before the system is up without having to worry about android permissions or getting SuperUser approval it's easier/more effective to do it as part of the system init in a script.

as far as randomking's rdu script, they would be compatible, but they exist separately as in one shouldn't interfere with the other, because the firstboot script runs long after install once the system is up and running.

you could modify the rdu setup to include/exclude the /data/.firstboot dir and .firstboot.sh script based on the selected config, since the init script does nothing if it doesn't see the /data/.firstboot.sh file, and the .firstboot.sh script does nothing if it doesn't see the .firstboot dir

Expanding on the rdu script idea, how about a prop variable in the config to specify a user apps directory on the sdcard (best if standardized)? The user can store the apks to be installed after a clean flash in this directory. The rdu script would be modified to copy those apks to the firstboot directory. Although how to handle data? Maybe another script to be run before flashing that checks the apks in the sdcard folder, and copies the current data folder to the sdcard. This data is then restored somehow with the firstboot script. This all can be in addition to the firstboot apps included with the rom.

Sent from my SPH-D700 using XDA App
13th January 2012, 04:00 AM |#14  
irule9000's Avatar
Senior Member
Boston, MA
Thanks Meter: 56
 
More
app
I honestly have no developing experience. To clarify, I was I simply asking if the app could back up the users personal apps/data to the specified folders, to make this script fool proof. Then when a rom is flashed the randomromkings rdu script which currently decides on lite roms or full roms could be modified to either install apps or not install apps depending on the rom compatibility. Finally data is wiped, rom flashes, and your script runs on boot allowing the apps to all be there. Expanding on that if the ROM allows apps to be re installed via your script, through the modified rdu, your script could be moved from one directory to another allowing the process to happen and at the end moves itself back to the original directory. This means that the end user who has no clue how to do anything but flash roms (like myself, but I want to learn) has done nothing accept backing up their apps. I know this is all hypothetical, but would this be possible, and also I have another idea that is probably impossible. If a script could be written so that the apps are backed up when the rom flashes, then the rom automatically does a factory restore and wipes the various caches, meaning that less people are going to have force close issues or other avoidable bugs because they didnt wipe. thanks for all your hard work
3rd May 2012, 12:20 PM |#15  
aayushARM's Avatar
Senior Member
Flag Ahmedabad
Thanks Meter: 51
 
More
Clear Me Here !!

You said that the script (.firstboot.sh) removes itself, but does it remove Y02firstboot script from init.d?? I don't think so, also, there are no disadvantages of this after first boot, as it won't find .firsboot.sh and skip the operation, but why shud it execute unneccesarily everytime??

@OP--Plz. tell me if i am right or wrong.......If right, plz. add a function to remove that script from init.d. However files in /xbin are OK though, so no need to remove them............
3rd May 2012, 02:24 PM |#16  
RandomKing's Avatar
Retired Recognized Developer
Flag Random Land
Thanks Meter: 1,465
 
Donate to Me
More
Everybody is writing and making this appear as complicated as possible! So let me clarify what I believe the idea is here. First of all, the 'RDU script' I assume you're referring to is simply a flash-able zip to set you phone for a lite or full installation. It sets a config file. I use it in my rom, and I also currently use that config file to set several other features upon installation, and changeable at anytime one of my themes is flashed.

RDU was simply meant to jump start the idea of developers making installations more uniform. Which has happened to various extents, for example, I've used this first-boot install to solve my quickpic(I love the app) and flash pre-install problems. It also fixes usb tether, vlingo, terminal, etc.

SO, what are we saying here? We'd like to be able to backup our apps to the sd card, as many apps can do for us. Then, we'd like to either:

A. Build a script into a rom to restore these apps prior to or upon installation.

or

B. Build a separate script which would be run AFTER a rom installation to restore these apps from CWM.

Yes?

P.S. I see this is very late to the game, didn't realize this thread was being revived...

Still. Neat idea, sorry I hadn't noticed it yet.
The Following User Says Thank You to RandomKing For This Useful Post: [ View ] Gift RandomKing Ad-Free
3rd June 2012, 11:56 PM |#17  
Junior Member
Thanks Meter: 1
 
More
+1 Thanks

After integrating this into my custom ROM, my phone (Galaxy S 4G) would only install the first .apk file in the .firstboot directory. After I removed the code which tells it to backup/restore the /data/data directories, it worked fine. I won't need that code since the ROM does a full wipe of /data every time anyway, but I'm not sure why it doesnt work when it's there. I'm not well versed enough with Java's syntax yet to comprehend why.

Also, your first post says that it should record logs to \sdcard\sleeperlog.txt but the script tries to record it to \sdcard\sleeperromlog.txt and neither one of those files actually appear on the sd card.

Edit: I had to remove the check to make sure the .firstboot directory is empty before deleting it, but it works fine on my Galaxy S 4G ROM as long as there are no /data/data directories for the programs I am installing.
17th April 2019, 02:47 AM |#18  
ANDROID2468's Avatar
Senior Member
Flag Nashville
Thanks Meter: 93
 
More
does anyone still have a template of this? The link is down.
Edit: nevermind I don't need it anymore.
Post Reply Subscribe to Thread

Tags
firstboot installer

Guest Quick Reply (no urls or BBcode)
Message:
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes