Skip to content

检查补丁包

canaan edited this page Sep 1, 2016 · 1 revision

Amigo.java

...

if (demoAPk.exists() && isSignatureRight(this, demoAPk)) {
	 SharedPreferences sp = getSharedPreferences(SP_NAME, MODE_MULTI_PROCESS);
	 String demoApkChecksum = checksum(demoAPk);
	 boolean isFirstRun = !sp.getString(NEW_APK_SIG, "").equals(demoApkChecksum);
...

这段代码中,首先检查是否有补丁包,并且签名正确,如果正确,则通过检验校验和是否与之前的检验和相同,不同则为检测到新的补丁包。

Clone this wiki locally