Updater: point to oxmc.me update API with device/type/serial params

Update and changelog URLs now point to https://oxmc.me/aosp_apis/.
Add {sn} placeholder (ro.serialno) and {type} (ro.pawlet.releasetype,
lowercased) to both URLs so the server can filter by build type and
identify individual devices.
This commit is contained in:
oxmc
2026-06-12 17:57:42 -07:00
parent 22652f5240
commit 85ea3b5c12
2 changed files with 9 additions and 4 deletions
@@ -155,6 +155,7 @@ public class Utils {
String device = SystemProperties.get(Constants.PROP_NEXT_DEVICE,
SystemProperties.get(Constants.PROP_DEVICE));
String type = SystemProperties.get(Constants.PROP_RELEASE_TYPE).toLowerCase(Locale.ROOT);
String serial = SystemProperties.get("ro.serialno", "");
String serverUrl = SystemProperties.get(Constants.PROP_UPDATER_URI);
if (serverUrl.trim().isEmpty()) {
@@ -163,7 +164,8 @@ public class Utils {
return serverUrl.replace("{device}", device)
.replace("{type}", type)
.replace("{incr}", incrementalVersion);
.replace("{incr}", incrementalVersion)
.replace("{sn}", serial);
}
public static String getUpgradeBlockedURL(Context context) {
@@ -175,7 +177,10 @@ public class Utils {
public static String getChangelogURL(Context context) {
String device = SystemProperties.get(Constants.PROP_NEXT_DEVICE,
SystemProperties.get(Constants.PROP_DEVICE));
return context.getString(R.string.menu_changelog_url, device);
String serial = SystemProperties.get("ro.serialno", "");
return context.getString(R.string.menu_changelog_url)
.replace("{device}", device)
.replace("{sn}", serial);
}
public static void triggerUpdate(Context context, String downloadId) {
+2 -2
View File
@@ -19,7 +19,7 @@
Optional placeholders replaced at runtime:
{device} - Device name
-->
<string name="updater_server_url" translatable="false">https://updates.pawlet.me/api/v1/{device}/</string>
<string name="updater_server_url" translatable="false">https://oxmc.me/aosp_apis/update.php?device={device}&amp;type={type}&amp;sn={sn}</string>
<string name="verification_failed_notification">Verification failed</string>
<string name="verifying_download_notification">Verifying update</string>
@@ -71,7 +71,7 @@
<string name="menu_copy_url">Copy URL</string>
<string name="menu_export_update">Export update</string>
<string name="menu_show_changelog">Show changelog</string>
<string name="menu_changelog_url" translatable="false">https://updates.pawlet.me/changelog/<xliff:g id="device_name">%1$s</xliff:g></string>
<string name="menu_changelog_url" translatable="false">https://oxmc.me/aosp_apis/update-changelog.php?device={device}&amp;sn={sn}</string>
<string name="menu_ab_perf_mode">Prioritize update process</string>
<string name="menu_update_recovery">Update recovery</string>
<string name="toast_forced_update_recovery">It is impossible to disable PawletOS Recovery updates on this device.</string>