Skip to content

Fix combinedAppSpecificSettingFormItems mutating shared form item state#2814

Merged
ImranR98 merged 1 commit into
ImranR98:mainfrom
RJNY:rjny/fix-version-detection-auto-disable
Apr 14, 2026
Merged

Fix combinedAppSpecificSettingFormItems mutating shared form item state#2814
ImranR98 merged 1 commit into
ImranR98:mainfrom
RJNY:rjny/fix-version-detection-auto-disable

Conversation

@RJNY

@RJNY RJNY commented Mar 9, 2026

Copy link
Copy Markdown

Discovered during an investigation: RJNY/Obtainium-Emulation-Pack#104

There are two bugs, both related to how Obtainium manages per-app settings.

The first is that the code responsible for building each app's settings screen modifies shared data in place instead of working on a copy, so settings from one app source can bleed into another.

The fixe is straightforward, the settings builder now works on a copy of the data instead of the original.


second "bug fix" was removed. keeping below for posterity.

The second is when Obtainium can't match an app's version string against a narrow set of recognized formats, it silently turns off version detection and saves the change to disk. This runs on every app load, so even if a user manually re-enables it, it gets switched off again immediately.

instead of disabling version detection when formats don't match, the app falls back to a simpler comparison that just checks if the two version strings are identical. This is the same approach Obtainium already uses for 9 other app sources like F-Droid and APKPure

Note that apps already affected will need version detection manually re-enabled after updating.

@ImranR98

Copy link
Copy Markdown
Owner

The second issue is not a bug. Those 9 sources are guaranteed to always provide real version numbers, so we don't need to worry about complicated comparisons and format checking. For other sources, like GitHub or HTML, a "version" provided by the site could be any arbitrary string, totally unrelated to the real OS-provided version number.
Version detection related code in general was tricky to figure out due to the huge number of possibilities and edge cases (there are various issues you can search up to see the history) so I would be very cautious of changing it.

@RJNY RJNY force-pushed the rjny/fix-version-detection-auto-disable branch from 9ff85f3 to 8b26ff2 Compare March 20, 2026 18:55
@RJNY

RJNY commented Mar 20, 2026

Copy link
Copy Markdown
Author

Fair enough, I dropped that "fix". Thanks for explaining, good to know the intent behind it.

I think the reason this keeps getting raised as a bug is because the toggle is silently mutated rather than visibly disabling itself with an explanation. Users see a setting they turned on just turn off with no context, so they assume something is broken. A disabled toggle with a short explanation would probably cut down on repeated reports.

@RJNY RJNY force-pushed the rjny/fix-version-detection-auto-disable branch 3 times, most recently from 36e3697 to 5d7405a Compare March 20, 2026 19:31
@RJNY

RJNY commented Mar 20, 2026

Copy link
Copy Markdown
Author

did a small little refactor since this was back on my radar, should be good to review

@RJNY RJNY changed the title Fix version detection being silently auto-disabled for non-standard version formats Fix combinedAppSpecificSettingFormItems mutating shared form item state Mar 20, 2026
@RJNY RJNY force-pushed the rjny/fix-version-detection-auto-disable branch from 5d7405a to 2cc6c4f Compare March 21, 2026 02:26
@ImranR98 ImranR98 merged commit eed96f5 into ImranR98:main Apr 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants