tags:

views:

39

answers:

1

Hi,

I want the android source to check at boot time if sdcard is inserted and if yes then override the default crypto package in the android source code with the one in sd card, else it does nothing.

Now I have 2 questions: 1. How can i override a default package? 2. How to check the status of sdcard at boot time?

I know how to check the status of sdcard in an application, which i got from one of the posts here, but how to utilize this boot time

if(android.os.Environment.getExternalStorageState().equals(android.os.Environment.MEDIA_MOUNTED))

Regards, Yogesh

+1  A: 
  1. How can i override a default package?

You don't. You can create your own firmware that uses a different crypto package, and hope you don't break anything.

  1. How to check the status of sdcard at boot time?

The SD card is not usable until very late in the boot process, after the home screen has launched. The snippet of source code you show should work -- the question is timing. For example, you can register a BroadcastReceiver to get control at "boot time" via the BOOT_COMPLETED broadcast, but it may get control before the SD card is mounted.

CommonsWare
In that case i have to search more because creating a different crypto package doesn't serve my purpose as i want all apps installed on the device to run through my crypto package if it is present. Can you guide me where to look,i want to a functionality similar to ld_library_path in linux where a bunch of paths are defined and the first one which matches gets picked up.
JoshMachine
@JoshMachine: You will need to create your own firmware, then.
CommonsWare
Thanks but i think before working towards firmware, I'll give one more try by editing .bashrc file and adding ld_library_path to my sdcard and hope it works
JoshMachine
You may not need to compile a new firmware from source, but you would have to change things on /system. Probably you will need to bring up the sdcard earlier during boot (maybe temporarily), then you should copy the crypto library off of it and use the copy so your device doesn't crash if the sdcard is subsequently handed over to the mass storage function (which unmounts it as far as the phone is concerned). You could then either figure out how library path support works or just use simlinks. Keep in mind /system is normally mounted read only.
Chris Stratton