1

I am trying to install some apps into my android set after recovery the set and first boot.

I don't know how to judge the first boot action. are there some flag in the souce code ?

How to install the app into the /data/app/? where can i add relative install codes in the android source code ?

Sulthan Allaudeen
  • 11,330
  • 12
  • 48
  • 63
Harris Huang
  • 83
  • 1
  • 10

1 Answers1

1

If you want your applications installed on first boot after recovery, you need to have them in the userdata image.

So first thing is to prepare a userdata.img file that has the apps you want to be installed on first boot in the correspondence of /data/app/ which should be just app/ in the userdata structure, as the DATA partition is mounted on /data

So the procedure should be:

  1. restore your device to factory with recovery;
  2. enter bootloader fastboot mode;
  3. wipe your data partition;
  4. program your custom userdata.img;
  5. reboot, the device should automatically install the apks in your userdata image
Diego
  • 5,326
  • 1
  • 35
  • 32
  • How would you get these apps to run on first boot? – TheGwa Mar 16 '17 at 05:55
  • 1
    @TheGwa: that's [a separate question with a separate answer](http://stackoverflow.com/a/6392009/813810) – Diego Mar 16 '17 at 12:20
  • I have found on the Android 4.4.2 devices that the app needs to be run once manually or using `monkey` for the broadcast receivers to be "registered" after that the apps open on boot. – TheGwa Mar 18 '17 at 08:08