List of usage examples for android.os RecoverySystem verifyPackage
public static void verifyPackage(File packageFile, ProgressListener listener, File deviceCertsZipFile) throws IOException, GeneralSecurityException
From source file:org.wso2.emm.system.service.api.OTAServerManager.java
public void startVerifyUpgradePackage() { Preference.putBoolean(context, context.getResources().getString(R.string.verification_failed_flag), false); File recoveryFile = new File(FileUtils.getUpgradePackageFilePath()); try {/*www. ja v a2 s . c om*/ wakeLock.acquire(); Log.d(TAG, "Verifying upgrade package"); RecoverySystem.verifyPackage(recoveryFile, recoveryVerifyListener, null); } catch (IOException e) { reportInstallError(OTAStateChangeListener.ERROR_PACKAGE_VERIFY_FAILED); String message = "Update verification failed due to file error."; Log.e(TAG, message); } catch (GeneralSecurityException e) { reportInstallError(OTAStateChangeListener.ERROR_PACKAGE_VERIFY_FAILED); String message = "Update verification failed due to security check failure."; Log.e(TAG, message); } finally { wakeLock.release(); } }