Skip to content

feat: Added Root Install method - #50

Open
0xBadCod3 wants to merge 16 commits into
bikram-agarwal:mainfrom
0xBadCod3:root-impl
Open

feat: Added Root Install method#50
0xBadCod3 wants to merge 16 commits into
bikram-agarwal:mainfrom
0xBadCod3:root-impl

Conversation

@0xBadCod3

Copy link
Copy Markdown

This PR adds root installation support along with configuration for Google Play spoofing behavior.
The root install flow uses elevated shell commands through Root access.

  • Added root installation support
  • Added a toggle to spoof Google Play as installer source
  • Used elevated shell commands through libsu
  • Added rootPretendToBeGooglePlay setting
  • Added root availability checks and settings UI
  • Fixes Add support for Rooted Installer #45

Here's a Demo:
Device: Xaga
Android: 16 AOSP
Root Granted using ReSukiSU

ScreenRecord.mp4

Comment thread android/app/src/main/kotlin/dev/imranr/obtainium/MainActivity.kt Outdated
Comment thread lib/providers/apps_provider.dart Outdated
Comment thread lib/providers/apps_provider.dart Outdated
Comment thread android/app/src/main/kotlin/dev/imranr/obtainium/MainActivity.kt Outdated
@bikram-agarwal

Copy link
Copy Markdown
Owner

Please run formatting before updating the PR. dart format --set-exit-if-changed rewrites some Dart files, and git diff --check reports trailing whitespace in assets/translations/en.json.

@0xBadCod3
0xBadCod3 requested a review from bikram-agarwal May 10, 2026 13:05
Comment thread android/app/src/main/kotlin/dev/imranr/obtainium/MainActivity.kt Outdated
Comment thread android/app/src/main/kotlin/dev/imranr/obtainium/MainActivity.kt Outdated
@0xBadCod3
0xBadCod3 requested a review from bikram-agarwal May 24, 2026 07:42
Comment thread android/app/src/main/kotlin/dev/imranr/obtainium/MainActivity.kt Outdated
Comment on lines +779 to +786
val writeToProcess = CompletableFuture.runAsync {
try {
file.inputStream().use { it.copyTo(process.outputStream) }
} finally {
runCatching { process.outputStream.close() }
}
process.waitFor()
}

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This version fixes the previous cleanup/timeout concern. The one-shot subprocess design now looks much safer.

One remaining correctness issue: process.waitFor() is called, but its exit code is ignored. If pm install-write exits non-zero after consuming stdin, this block still completes successfully and the loop continues.

Please check the process exit code after writeToProcess.get(...) returns, and fail/abandon the session if it is non-zero. The error should include stdout/stderr so failed root installs are diagnosable.

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.

Add support for Rooted Installer

2 participants