public static int checkSignatureAndTinkerID(Context context,File patchFile,ShareSecurityCheck securityCheck){
  if (!securityCheck.verifyPatchMetaSignature(patchFile)) {
    return ShareConstants.ERROR_PACKAGE_CHECK_SIGNATURE_FAIL;
  }
  String oldTinkerId=getManifestTinkerID(context);
  if (oldTinkerId == null) {
    return ShareConstants.ERROR_PACKAGE_CHECK_APK_TINKER_ID_NOT_FOUND;
  }
  HashMap<String,String> properties=securityCheck.getPackagePropertiesIfPresent();
  if (properties == null) {
    return ShareConstants.ERROR_PACKAGE_CHECK_PACKAGE_META_NOT_FOUND;
  }
  String patchTinkerId=properties.get(ShareConstants.TINKER_ID);
  if (patchTinkerId == null) {
    return ShareConstants.ERROR_PACKAGE_CHECK_PATCH_TINKER_ID_NOT_FOUND;
  }
  if (!oldTinkerId.equals(patchTinkerId)) {
    return ShareConstants.ERROR_PACKAGE_CHECK_TINKER_ID_NOT_EQUAL;
  }
  return ShareConstants.ERROR_PACKAGE_CHECK_OK;
}

public static int checkSignatureAndTinkerID ( Context context , File patchFile , ShareSecurityCheck securityCheck ) { if ( ! securityCheck . verifyPatchMetaSignature ( patchFile ) ) { return ShareConstants . ERROR_PACKAGE_CHECK_SIGNATURE_FAIL ; } String oldTinkerId = getManifestTinkerID ( context ) ; if ( oldTinkerId == null ) { return ShareConstants . ERROR_PACKAGE_CHECK_APK_TINKER_ID_NOT_FOUND ; } HashMap < String , String > properties = securityCheck . getPackagePropertiesIfPresent ( ) ; if ( properties == null ) { return ShareConstants . ERROR_PACKAGE_CHECK_PACKAGE_META_NOT_FOUND ; } String patchTinkerId = properties . get ( ShareConstants . TINKER_ID ) ; if ( patchTinkerId == null ) { return ShareConstants . ERROR_PACKAGE_CHECK_PATCH_TINKER_ID_NOT_FOUND ; } if ( ! oldTinkerId . equals ( patchTinkerId ) ) { return ShareConstants . ERROR_PACKAGE_CHECK_TINKER_ID_NOT_EQUAL ; } return ShareConstants . ERROR_PACKAGE_CHECK_OK ; }
check patch file signature and tinker_id
