Created
August 22, 2013 13:39
-
-
Save shriduttkothari/6307289 to your computer and use it in GitHub Desktop.
On successful download of the update zip file from server we must verify the cryptographic signature of the downloaded update file, and then we can install it as follows: It will reboot the device in recovery mode, where recovery console will first verify the signature of the file then execute the updater script of that update zip file, which wi…
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
try { | |
File otafileloc = new File("/cache/update.zip"); | |
// Verify the cryptographic signature before installing it. | |
RecoverySystem.verifyPackage(otafileloc, null, null); | |
// Reboots the device into recovery mode to install the update package. | |
RecoverySystem.installPackage(getApplicationContext(), otafileloc); | |
} catch (IOException e) { | |
e.printStackTrace(); | |
} catch (GeneralSecurityException e) { | |
e.printStackTrace(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment