Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -545,6 +545,11 @@ the problem and tap **Export .txt**. Attach the file to the issue.
- **Cause:** the patch engine called a Java method that only exists from Android 13 on, and only the Samsung Health+ build reaches it. The tests run on Android 13 and newer, so they did not catch it. Confirmed on a Xiaomi phone with MIUI 13 (Android 12).
- **Status:** fixed in 0.11.7, and the build now also checks the engine against Android 12. An affected user still needs to report that the build works.
- **Workaround (before 0.11.7):** leave Samsung Health+ out; the other apps still build.
- :construction: **Samsung Health+ 7.2.0.041 asks for a Samsung Account even with the Local-only option** ([#32](https://github.com/LibreStatic/LibreWrist/issues/32))
- **Cause:** this version checks for an account in more places during first-run setup. The Local-only patch only covered the first one. Without an account, setup shows the sign-in screen again after **Start**, closes with "Server error occurred (0x2F#131072)", or keeps spinning. Reproduced on an emulator.
- **Status:** the fix is in progress. It covers each of those checks and was tested from first-run setup to the dashboard with no account.
- :mag: **Blood pressure calibration fails at 99% with an SQI error on the Galaxy Watch8 Classic** ([#42](https://github.com/LibreStatic/LibreWrist/issues/42))
- **Cause:** not known yet. The log shows that the watch delivers optical heart sensor data during the calibration, but it flags every sample as unusable, and the values look different from those of watches where blood pressure works. A test build that logs the raw sensor data is linked in the issue.

[↑ Back to contents](#contents)

Expand Down
73 changes: 71 additions & 2 deletions catalogue/catalogue.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"schema": 2,
"serial": 64,
"serial": 65,
"minAppVersion": 45,
"inputs": [
{
Expand Down Expand Up @@ -2347,7 +2347,7 @@
"shealth-phone"
],
"title": "Local-only mode (no Samsung Account)",
"description": "The SamsungAccountManager state getter (j3x.s0 in 7.2.0.041) reports LOG_IN, so the mandatory sign-in stop state right after OOBE never fires; the app runs account-less with no cloud sync",
"description": "The SamsungAccountManager state getter (j3x.s0 in 7.2.0.041) reports LOG_IN, so the mandatory sign-in stop state right after OOBE never fires, and the first-run wizard's two sign-in checks (HomeOobeUtil: the suspend t4g.n used by the welcome screen and the synchronous t4g.m used by each wizard screen's onResume) report that no sign-in is needed, so the wizard never opens the Samsung Account sign-in screen, and the wizard's Korean old-child account check (KcbOldChildResult) always reports that the account info was read with no error, so the wizard does not close with a server error (0x2F#131072) for lack of an account, and the consent init step (OobeConsentInitHandler) takes its \"Cms Already initialized\" branch, so the wizard does not wait forever for an account-bound consent sync; the app runs account-less with no cloud sync",
"optional": true,
"offByDefault": true,
"ops": [
Expand All @@ -2367,6 +2367,75 @@
"SamsungAccountManager$State;->LOG_OUT:",
"\"getContext(...)\""
]
},
{
"op": "setMethodBody",
"fileAll": [
"\"SHEALTH#HomeOobeUtil\""
],
"sigRegex": "public final \\w+\\(Landroid/app/Activity;L\\w+;\\)Ljava/lang/Object;",
"body": [
" .locals 0",
"",
" sget-object p0, Ljava/lang/Boolean;->FALSE:Ljava/lang/Boolean;",
"",
" return-object p0"
],
"expect": 1,
"bodyAll": [
"SamsungAccountUtils.isDeviceSignInSamsungAccountAsync"
]
},
{
"op": "setMethodBody",
"fileAll": [
"\"SHEALTH#HomeOobeUtil\""
],
"sigRegex": "public static \\w+\\(\\)Z",
"body": [
" .locals 1",
"",
" const/4 v0, 0x0",
"",
" return v0"
],
"expect": 1,
"bodyAll": [
"SamsungAccountUtils;->isDeviceSignInSamsungAccount(Landroid/content/Context;)Z"
]
},
{
"op": "insertInMethodAtMatch",
"fileAll": [
"\"KcbOldChildResult(isCheckingSaInfoSuccess=\""
],
"sigRegex": "public constructor <init>\\(IZZ\\)V",
"pattern": "(?P<at> iput-boolean p2, p0, L\\w+;->\\w+:Z\\n)",
"insert": [
" const/4 p1, 0x0",
"",
" const/4 p2, 0x1",
"",
""
],
"expect": 1
},
{
"op": "insertInMethodAtMatch",
"fileAll": [
"\"Check Cms Flow\""
],
"sigRegex": "public final \\w+\\(L\\w+;\\)V",
"bodyAll": [
"\"Cms Already initialized\""
],
"pattern": "(?P<at>) if-eqz v0, :\\w+\\n\\n const-string v0, \"Cms Already initialized\"",
"insert": [
" const/4 v0, 0x1",
"",
""
],
"expect": 1
}
]
},
Expand Down
Binary file modified catalogue/catalogue.json.sig
Binary file not shown.
2 changes: 1 addition & 1 deletion docs/patches.md
Original file line number Diff line number Diff line change
Expand Up @@ -465,7 +465,7 @@ app that started the sign-in.
| 10b | `shealth-capability-gates` *(optional, China build 7.00.6.012 only)* | the 7.00.x form of row 10: every inlined `service_capability_list` check (`getServiceList` + `List.contains`; 3 sites on 7.00.6.011: Vitals `xvx.J0`, Training load `t950`, fitness index `xao`) is forced true, and the per-sleep Vitals device check (`xvx.K0` on 7.00.6.011, a historical name; `wvo.Q` on the China build) returns `TRUE` | Same reason as row 10 |
| 11 | `shealth-shm-providers` | the `content://com.samsung.android.shealthmonitor.sleep` and `.bp` URIs and the two `uses-permission` entries guarding them (`sleep.READ_SLEEP_APNEA_STATUS`, `bp.READ_MEASURE_FLAG`) -> `com.samsung.android.shealthmonitors.*` | The phone Health Monitor is renamed (`phone-rebrand-gms`), so Samsung Health+ asked a provider that does not exist and showed no Sleep apnea card under Sleep. Pairs with `shm-provider-callers` on the Health Monitor side |
| 12 | `shealth-launcher-badge` *(optional)* | `adaptiveIconBadge`: the adaptive icons (8 on 7.2.0.041 (9 on 7.00.6.011): app icon plus widget and shortcut icons; 12 on the China build, which keeps 3 unused `mipmap-anydpi*/ic_launcher*` copies) get a small LibreWrist badge at the bottom-right of the foreground layer and, for the app icon, of the monochrome (themed) layer | The renamed copy installs next to the stock app and would otherwise look identical in the launcher |
| 13 | `shealth-oobe-local` *(optional, off by default)* | the Samsung Account state getter (`j3x.s0` in 7.2.0.041; `j9v.s0` in 7.00.6.011) reports `LOG_IN`, so the mandatory sign-in stop state right after OOBE never fires | For running the app without a Samsung Account; the first-run wizard itself has no sign-in step, this only removes the gate after it. Off by default: cloud sign-in is expected to work on the re-signed copy (the code has no signature gate); enable it (or flip `offByDefault` in the catalogue) if sign-in does not work on this device |
| 13 | `shealth-oobe-local` *(optional, off by default)* | five ops: (1) the Samsung Account state getter (`j3x.s0` in 7.2.0.041; `j9v.s0` in 7.00.6.011) reports `LOG_IN`, so the mandatory sign-in stop state right after OOBE never fires; (2) the first-run wizard's async sign-in check (`t4g.n` in 7.2.0.041, the suspend method of `HomeOobeUtil` that calls `SamsungAccountUtils.isDeviceSignInSamsungAccountAsync`) returns `false`, so the welcome screen does not send `SA_MANDATORY_GUIDE` to `HomeSaSignInActivity`; (3) its synchronous twin (`t4g.m`, the static `()Z` method of `HomeOobeUtil` that calls `SamsungAccountUtils.isDeviceSignInSamsungAccount`) returns `false`, so the `onResume` of each wizard screen does not open the sign-in screen again; (4) the `KcbOldChildResult(IZZ)` constructor (`bqi` in 7.2.0.041) stores code `0` and `isCheckingSaInfoSuccess=true`, so the Korean old-child account check does not close the app with "Server error occurred (0x2F#131072)" for lack of an account (the Korean-child flag itself is kept); (5) the consent step (`OobeConsentInitHandler`, `d9p` in 7.2.0.041) takes its "Cms Already initialized" branch and goes on to the next step, because with no account its consent sync from the server returns without a result and the wizard stays on a spinner (the app still asks for the local consents, such as location processing, and the terms state moves to `NOT_NEEDED` when the wizard finishes) | For running the app without a Samsung Account. In 7.2.0.041 the wizard checks for an account in three more places than the state getter ([#32](https://github.com/LibreStatic/LibreWrist/issues/32)): with only op 1 it opens the sign-in screen from its welcome screen, without op 3 it reopens the sign-in screen in a loop after **Start**, without op 4 it stops on the server error, and without op 5 it stays on a spinner. Tested end to end on an API 31 emulator with no Samsung Account: the wizard reaches the dashboard, and a cold start goes straight to it. Off by default: cloud sign-in is expected to work on the re-signed copy (the code has no signature gate); enable it (or flip `offByDefault` in the catalogue) if sign-in does not work on this device |
| 14 | `shealth-china-account-gate` *(optional, off by default, experimental)* | regional check disabled: in the two post-sign-in OOBE paths that log `Global APK, China SACC, NO Smart Switch` (the `HomeOobeWelcomeFragment` coroutine and `HomeOobeWelcomeSplashFragment`, 2 sites on 7.2.x), the result of the account-country check (account country == `CN`) that precedes the Smart Switch restore check is forced false (`insertInMethodAtMatch`, `expect` 2), so the app no longer opens `HomeAppCloseActivity` with `OOBE_GLOBAL_APK_CHINA_SACC_APP_CLOSE` ("phone must be purchased in the country/region where your Samsung account was created") | The international build closes itself for a Samsung Account registered in mainland China ([#8](https://github.com/LibreStatic/LibreWrist/issues/8)). Only the OOBE call sites are touched: the account-country check (`ozn.Y` in 7.00.6.011) had ~20 other callers that switch China-account features (count from the 7.00.6.011 analysis). Experimental: the China/international server split is the build flavor (`fs90.u()` in 7.00.6.011, fixed at compile time), so this build keeps talking to the international servers and cloud sync for a CN account may not work; the real fix is a China build input |

Anchors: semantic method names and literals of the official APK (`isEnabled()Z`, `L1()Z`,
Expand Down
2 changes: 1 addition & 1 deletion patcher-app/app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ android {
val catalogueMinApp = Regex("\"minAppVersion\":\\s*(\\d+)")
.find(rootProject.file("../catalogue/catalogue.json").readText())?.groupValues?.get(1)?.toInt() ?: 1
versionCode = System.getenv("PATCHER_VERSION_CODE")?.toIntOrNull() ?: catalogueMinApp
versionName = "0.11.7"
versionName = "0.11.8"
Comment thread
FacuM marked this conversation as resolved.
Resolved
// Base URL of the raw `catalogue/` directory of the public repository (config.env CATALOGUE_URL,
// or -PcatalogueUrl). Empty disables catalogue updates. Only https is accepted.
val catalogueUrl = (providers.gradleProperty("catalogueUrl").orNull ?: System.getenv("CATALOGUE_URL") ?: "").trim()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class AppCatalogueTest {

@Test
fun serialAndInputs() {
assertEquals(64L, c.serial)
assertEquals(65L, c.serial)
assertEquals("chinaFrom / obtain.yyb need CI run 45", 45L, c.engine.minAppVersion)
assertEquals(
listOf(
Expand Down
Loading