Show build type and update host
This commit is contained in:
parent
c683f135e3
commit
16086a593f
@ -26,8 +26,8 @@ APIs directly:
|
|||||||
- automatic update checks against the selected release manifest
|
- automatic update checks against the selected release manifest
|
||||||
- one-download-per-version APK cache, SHA-256 verification, and installer
|
- one-download-per-version APK cache, SHA-256 verification, and installer
|
||||||
handoff
|
handoff
|
||||||
- native Update and About pages for version, protocol, permission, and release
|
- native Update and About pages for version/build type, protocol, permission,
|
||||||
information
|
selected update source, and release information
|
||||||
|
|
||||||
## Server URL
|
## Server URL
|
||||||
|
|
||||||
@ -185,5 +185,5 @@ In the app:
|
|||||||
state, and a `Check update` button.
|
state, and a `Check update` button.
|
||||||
- Open the `Update` page and tap `App settings` for Android's full per-app
|
- Open the `Update` page and tap `App settings` for Android's full per-app
|
||||||
permission/settings screen.
|
permission/settings screen.
|
||||||
- Open the `About` page to see the app version, package name, API/protocol
|
- Open the `About` page to see the app version/build type, package name,
|
||||||
summary, selected update source, and update policy.
|
API/protocol summary, selected update source, and update policy.
|
||||||
|
|||||||
@ -301,8 +301,9 @@ public final class MainActivity extends Activity {
|
|||||||
LinearLayout content = pageContent();
|
LinearLayout content = pageContent();
|
||||||
content.addView(infoBlock(
|
content.addView(infoBlock(
|
||||||
"Installed",
|
"Installed",
|
||||||
"Version " + BuildConfig.VERSION_NAME + " (" + BuildConfig.VERSION_CODE + ")\n"
|
appIdentityText() + "\n"
|
||||||
+ "Update source:\n" + prefs.getString("update_url", BuildConfig.DEFAULT_UPDATE_URL)
|
+ "Update source: " + updateSourceHost() + "\n"
|
||||||
|
+ prefs.getString("update_url", BuildConfig.DEFAULT_UPDATE_URL)
|
||||||
));
|
));
|
||||||
content.addView(sectionTitle("Update"));
|
content.addView(sectionTitle("Update"));
|
||||||
content.addView(actionPanel(
|
content.addView(actionPanel(
|
||||||
@ -351,7 +352,7 @@ public final class MainActivity extends Activity {
|
|||||||
content.addView(infoBlock(
|
content.addView(infoBlock(
|
||||||
"tmux-browser Android",
|
"tmux-browser Android",
|
||||||
"Native Android client for the remote tmux-browser API.\n"
|
"Native Android client for the remote tmux-browser API.\n"
|
||||||
+ "Version " + BuildConfig.VERSION_NAME + " (" + BuildConfig.VERSION_CODE + ")\n"
|
+ appIdentityText() + "\n"
|
||||||
+ "Package " + getPackageName()
|
+ "Package " + getPackageName()
|
||||||
));
|
));
|
||||||
content.addView(infoBlock(
|
content.addView(infoBlock(
|
||||||
@ -362,7 +363,8 @@ public final class MainActivity extends Activity {
|
|||||||
));
|
));
|
||||||
content.addView(infoBlock(
|
content.addView(infoBlock(
|
||||||
"Update policy",
|
"Update policy",
|
||||||
"Selected source:\n" + prefs.getString("update_url", BuildConfig.DEFAULT_UPDATE_URL) + "\n"
|
"Selected source: " + updateSourceHost() + "\n"
|
||||||
|
+ prefs.getString("update_url", BuildConfig.DEFAULT_UPDATE_URL) + "\n"
|
||||||
+ "The app checks only this source. APK downloads are cached by version and reused after Android install permission is granted."
|
+ "The app checks only this source. APK downloads are cached by version and reused after Android install permission is granted."
|
||||||
));
|
));
|
||||||
content.addView(actionPanel(
|
content.addView(actionPanel(
|
||||||
@ -1208,11 +1210,7 @@ public final class MainActivity extends Activity {
|
|||||||
|
|
||||||
private void showPermissionsAndUpdateStatus() {
|
private void showPermissionsAndUpdateStatus() {
|
||||||
StringBuilder text = new StringBuilder();
|
StringBuilder text = new StringBuilder();
|
||||||
text.append("Installed app: ")
|
text.append("Installed app: ").append(appIdentityText()).append('\n');
|
||||||
.append(BuildConfig.VERSION_NAME)
|
|
||||||
.append(" (")
|
|
||||||
.append(BuildConfig.VERSION_CODE)
|
|
||||||
.append(")\n");
|
|
||||||
text.append("Server: ").append(getServerUrl()).append('\n');
|
text.append("Server: ").append(getServerUrl()).append('\n');
|
||||||
text.append('\n');
|
text.append('\n');
|
||||||
text.append("Manual APK download:\n");
|
text.append("Manual APK download:\n");
|
||||||
@ -1222,7 +1220,9 @@ public final class MainActivity extends Activity {
|
|||||||
text.append('\n');
|
text.append('\n');
|
||||||
text.append("In-app update:\n");
|
text.append("In-app update:\n");
|
||||||
text.append("Tap Check now on the Update page. The app checks only the selected source, downloads one APK per version, verifies SHA-256, then opens Android's installer.\n");
|
text.append("Tap Check now on the Update page. The app checks only the selected source, downloads one APK per version, verifies SHA-256, then opens Android's installer.\n");
|
||||||
text.append("Selected manifest:\n")
|
text.append("Selected manifest: ")
|
||||||
|
.append(updateSourceHost())
|
||||||
|
.append('\n')
|
||||||
.append(prefs.getString("update_url", BuildConfig.DEFAULT_UPDATE_URL))
|
.append(prefs.getString("update_url", BuildConfig.DEFAULT_UPDATE_URL))
|
||||||
.append('\n');
|
.append('\n');
|
||||||
text.append("Available sources:\n");
|
text.append("Available sources:\n");
|
||||||
@ -1738,6 +1738,22 @@ public final class MainActivity extends Activity {
|
|||||||
return prefs.getString("server_url", BuildConfig.DEFAULT_SERVER_URL);
|
return prefs.getString("server_url", BuildConfig.DEFAULT_SERVER_URL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private String appIdentityText() {
|
||||||
|
return "Version " + BuildConfig.VERSION_NAME
|
||||||
|
+ " (" + BuildConfig.VERSION_CODE + ", "
|
||||||
|
+ (BuildConfig.DEBUG ? "debug" : "release")
|
||||||
|
+ ")";
|
||||||
|
}
|
||||||
|
|
||||||
|
private String updateSourceHost() {
|
||||||
|
String url = prefs.getString("update_url", BuildConfig.DEFAULT_UPDATE_URL);
|
||||||
|
if (url == null || url.trim().isEmpty()) {
|
||||||
|
url = BuildConfig.DEFAULT_UPDATE_URL;
|
||||||
|
}
|
||||||
|
String host = Uri.parse(url).getHost();
|
||||||
|
return host == null || host.isEmpty() ? "custom" : host;
|
||||||
|
}
|
||||||
|
|
||||||
private String normalizeServerUrl(String raw) {
|
private String normalizeServerUrl(String raw) {
|
||||||
String value = raw.trim();
|
String value = raw.trim();
|
||||||
if (value.isEmpty()) {
|
if (value.isEmpty()) {
|
||||||
|
|||||||
@ -89,7 +89,7 @@ Implemented now:
|
|||||||
- one-download-per-version APK cache, SHA-256 verification, and installer
|
- one-download-per-version APK cache, SHA-256 verification, and installer
|
||||||
handoff
|
handoff
|
||||||
- permission/about surfaces for unknown-app install status, notification status,
|
- permission/about surfaces for unknown-app install status, notification status,
|
||||||
app settings, app version, package name, selected update source, and
|
app settings, app version/build type, package name, selected update source, and
|
||||||
HTTP/WebSocket API/protocol summary
|
HTTP/WebSocket API/protocol summary
|
||||||
|
|
||||||
## Update And Release Policy
|
## Update And Release Policy
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user