我的应用程序从Play商店获取的版本错误,应用程序页面的版本为1.8.12.4890,但是调试程序返回的版本为1.8.9.4716(即先前的版本)。
public String getString(String var1, String var2) {
if (var2 == null) {
return "";
} else {
this.zzam.readLock().lock();
String var3;
try {
if (this.zzai == null || !this.zzai.zzb(var1, var2)) {
if (this.zzaj != null && this.zzaj.zzb(var1, var2)) {
var3 = new String(this.zzaj.zzc(var1, var2), zzaq.UTF_8);
return var3;
}
var3 = "";
return var3;
}
var3 = new String(this.zzai.zzc(var1, var2), zzaq.UTF_8);
} finally {
this.zzam.readLock().unlock();
}
return var3;
}
}
这是FirebaseRemoteConfig.class,无法进行编辑。
验证方法:
public void check() {
final FirebaseRemoteConfig remoteConfig = FirebaseRemoteConfig.getInstance();
//if (remoteConfig.getBoolean(KEY_UPDATE_REQUIRED)) {
if (remoteConfig.getBoolean(KEY_UPDATE_ACTIVE)) {
String currentVersion = remoteConfig.getString(KEY_CURRENT_VERSION);
String appVersion = getAppVersion(context);
String updateUrl = remoteConfig.getString(KEY_UPDATE_URL);
String updateMessage = remoteConfig.getString(KEY_UPDATE_MESSAGE);
boolean updateRequired = remoteConfig.getBoolean(KEY_UPDATE_REQUIRED);
if (!TextUtils.equals(currentVersion, appVersion) && onUpdateNeededListener != null) {
onUpdateNeededListener.onUpdateNeeded(updateUrl, updateRequired, updateMessage, appVersion, currentVersion);
}
}
}