get versionName from AndroidManifest.xml, remove duplicate strings field
No need to have the version set it more than one place!
This commit is contained in:
parent
e543895940
commit
c23d4e1988
@ -2,7 +2,6 @@
|
||||
<resources>
|
||||
|
||||
<string name="app_name">F-Droid</string>
|
||||
<string name="version_name">0.88</string>
|
||||
|
||||
<string name="about_sitec">https://f-droid.org</string>
|
||||
<string name="about_mailc">team@f-droid.org</string>
|
||||
|
@ -1,6 +1,7 @@
|
||||
package org.fdroid.fdroid.updater;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.pm.PackageManager;
|
||||
import android.util.Log;
|
||||
|
||||
import org.fdroid.fdroid.FDroidApp;
|
||||
@ -109,7 +110,13 @@ public class SignedRepoUpdater extends RepoUpdater {
|
||||
|
||||
@Override
|
||||
protected String getIndexAddress() {
|
||||
return repo.address + "/index.jar?client_version=" + context.getString(R.string.version_name);
|
||||
try {
|
||||
String versionName = context.getPackageManager().getPackageInfo(context.getPackageName(), 0).versionName;
|
||||
return repo.address + "/index.jar?client_version=" + versionName;
|
||||
} catch (PackageManager.NameNotFoundException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return repo.address + "/index.jar";
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
x
Reference in New Issue
Block a user