RecoverySystem.verifyPackage方法注释介绍

xiaoxiao2021-02-28  28

/** * Verify the cryptographic signature of a system update package before installing it. Note that the package is also verified separately by the installer once the device is rebooted into the recovery system. This function will return only if the package was successfully verified; otherwise it will throw an exception. *在安装之前,验证系统更新包的密码签名。注意,一旦设备重新启动到revovery系统中,安装程序也会单独验证包裹。只有在成功验证包的情况下,该函数才会返回;否则它将抛出一个异常。 Verification of a package can take significant time, so this function should not be called from a UI thread. Interrupting the thread while this function is in progress will result in a SecurityException being thrown (and the thread's interrupt flag will be cleared). * 对升级包的验证可能需要花费大量的时间,所以这个函数不应该从UI线程调用。在这个函数正在进行的时候中断线程会导致一个SecurityException被抛出(并且线程的中断标志将被清除)。 @param packageFile the package to be verified 要验证的包 @param listener an object to receive periodic progress updates as verification proceeds. May be null. 作为验证过程的一个对象,可以接收定期的进度更新。可能是null。 @param deviceCertsZipFile the zip file of certificates whose public keys we will accept. Verification succeeds if the package is signed by the private key corresponding to any default file (currently "/system/etc/security/otacerts.zip"). @throws IOException if there were any errors reading the package or certs files. @throws GeneralSecurityException if verification failed

此文仅作为学习记录

转载请注明原文地址: https://www.6miu.com/read-2400293.html

最新回复(0)