Repository navigation
Fix the Samsung Health+ build on Android 12 (#41) - #48
Conversation
|
Caution Review failedThe pull request is closed. No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: e7950a2836
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@codex review |
|
Codex Review: Didn't find any major issues. Delightful! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
|
@coderabbitai review |
Action performed
|
ZipApkFiles.head called InputStream.readNBytes(int), which Android only has from API 33, while the app runs from API 31. Only the Samsung Health+ profiles reach it (resXmlReplaceString), so building Samsung Health+ on Android 12 failed with NoSuchMethodError (#41). A readUpTo helper in the engine replaces it, and SigningKeyStore.readBounded now reuses it. The app's lint does not apply NewApi to :engine, a pure JVM module, so :engine:test now also compiles the engine sources against the API 31 android.jar instead of the JDK: such a call fails the build. CI installs platforms;android-31 for it.
An escaped sdk.dir (Android Studio writes Windows paths escaped) now decodes to the same directory the Android build uses, instead of a path that does not exist.
bcdf97d to
8c3b00d
Compare
Summary
Building Samsung Health+ on Android 12 failed at "Apply patches" with
NoSuchMethodError: No virtual method readNBytes(I)[B in class Ljava/io/InputStream.ZipApkFiles.head(Patcher.kt:42) calledInputStream.readNBytes(int), which Android only has from API 33; the app's minSdk is 31. Only the Samsung Health+ profiles reach it, throughresXmlReplaceString.readUpTohelper in the engine (Streams.kt) replaces it;SigningKeyStore.readBoundednow reuses it instead of its own copy.:engineis a pure JVM module, and the app's lint does not applyNewApito it (tried withcom.android.lint+checkDependencies: no report for the module). AnandroidApiCheckcompilation now builds the engine sources a second time against the API 31android.jarinstead of the JDK, so a JDK method that Android 12 lacks is an unresolved reference.:engine:testandcheckdepend on it; CI installsplatforms;android-31.Fixes #41
What #41 reports
The issue only carries a screenshot. It shows the patcher on step 6 of 9 ("Building your app"), the "Apply 42 patches" item failed, and this error:
Device: Xiaomi with MIUI 13 (China ROM), Android 12. Acceptance: on Android 12 the build passes the "Apply patches" step and finishes. The engine run from
origin/mainon an Android 12 emulator reproduces this exact error (see Verification).Verification
:engine:testand:app:testDebugUnitTestpass (JDK 17), including the newStreamsTest.readNBytesfails the build withUnresolved reference 'readNBytes'atPatcher.kt:42.shealth-cn):origin/main: the exactNoSuchMethodErrorfrom the issue, atZipApkFiles.head←ResXmlReplaceString.candidateBytes;Summary by CodeRabbit
NoSuchMethodError.