How to override a package in android source code at boot-time? – Education Career Blog

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. 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.

Leave a Comment