Skip to content

Commit 9430975

Browse files
Add entire codebase to new repository.
0 parents  commit 9430975

59 files changed

Lines changed: 3194 additions & 0 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gitignore

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
# Built application files
2+
*.apk
3+
*.aar
4+
*.ap_
5+
*.aab
6+
7+
# Files for the ART/Dalvik VM
8+
*.dex
9+
10+
# Java class files
11+
*.class
12+
13+
# Generated files
14+
bin/
15+
gen/
16+
out/
17+
18+
# Gradle files
19+
.gradle/
20+
build/
21+
22+
# Local configuration file (sdk path, etc)
23+
local.properties
24+
25+
# Proguard folder generated by Eclipse
26+
proguard/
27+
28+
# Log Files
29+
*.log
30+
31+
# Android Studio Navigation editor temp files
32+
.navigation/
33+
34+
# Android Studio captures folder
35+
captures/
36+
37+
# IntelliJ
38+
*.iml
39+
.idea/
40+
*.hprof
41+
42+
# Keystore files
43+
*.jks
44+
*.keystore
45+
46+
# External native build folder generated in Android Studio 2.2 and later
47+
.externalNativeBuild
48+
.cxx/
49+
50+
# Google Services (e.g. APIs or Firebase)
51+
google-services.json
52+
53+
# Freeline
54+
freeline.py
55+
freeline/
56+
freeline_project_description.json
57+
58+
# fastlane
59+
fastlane/report.xml
60+
fastlane/Preview.html
61+
fastlane/screenshots
62+
fastlane/test_output
63+
fastlane/readme.md
64+
65+
# Version control
66+
vcs.xml
67+
68+
# lint
69+
lint/intermediates/
70+
lint/generated/
71+
lint/outputs/
72+
lint/tmp/
73+
# lint/reports/

LICENSE

Lines changed: 674 additions & 0 deletions
Large diffs are not rendered by default.

README.md

Lines changed: 124 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,124 @@
1+
## SimpleBoot will soon be a product of RedHead Industries, a non-profit organization that I have founded -- By the people, for the people. This does not mean SimpleBoot will go proprietary, this is simply a change of ownership (and where SimpleBoot's repository will be at).
2+
3+
# 📱 SimpleBoot
4+
5+
**SimpleBoot** is a powerful, root-required Android app that transforms your phone into a fully bootable USB device. Mount ISO/IMG files via **ConfigFS**, **Legacy mass_storage**, or raw **Loopback** mode and boot directly into live systems on any PC.
6+
7+
> Successor to DriveDroid and PhoneStick, built for Android 11+ with full modern kernel and ConfigFS support.
8+
9+
---
10+
11+
## 🚀 Features
12+
13+
- 🔍 **Automatic ISO/IMG discovery** from `/storage/emulated/0/SimpleBootISOs`
14+
- 📦 **Three mount methods**:
15+
- `ConfigFS`: For most modern kernels
16+
- `Legacy`: For older Android USB stacks
17+
- `Loopback`: For direct mount w/o USB gadget (testing or chaining)
18+
- 💿 **CD-ROM boot mode** with forced descriptors for BIOS/UEFI compatibility (Deprecated. To be removed in later builds.)
19+
- 🔐 **Root shell integration** using [`libsu`](https://github.com/topjohnwu/libsu)
20+
- 🧠 **Complete logging** of all mount/unmount operations (`SimpleBootLogs`)
21+
- 🌓 **Light/Dark mode** Jetpack Compose UI
22+
- 🛠️ **Per-ISO selection** of mount method
23+
- 🧲 **Toggle USB Charging + ADB** from within the UI
24+
- ⚙️ **Persistent preferences** for read-only mounting
25+
- 📤 Export logs and diagnostics for debugging
26+
27+
---
28+
29+
## 📸 Screenshots
30+
31+
<p align="center">
32+
<img src="https://github.com/user-attachments/assets/81af67c3-1c10-40dc-bf7e-81a62158c33a" alt="Screenshot 1" width="200"/>
33+
<img src="https://github.com/user-attachments/assets/81af67c3-1c10-40dc-bf7e-81a62158c33a" alt="Screenshot 2" width="200"/>
34+
</p>
35+
36+
## ⚙️ Requirements
37+
38+
- 📱 Android 11+ (API 30 or later)
39+
- 📲 Root access (Magisk recommended)
40+
- 🔌 OTG-capable USB port
41+
- 📦 Kernel support for ConfigFS (most modern AOSP-based ROMs)
42+
- 🧪 Optional: Legacy USB gadget stack for older devices
43+
44+
---
45+
46+
## 🗂 File System Layout
47+
48+
- `/storage/emulated/0/SimpleBootISOs/`
49+
Drop your `.iso` or `.img` files here
50+
- `/storage/emulated/0/SimpleBootLogs/`
51+
Verbose mount/unmount logs
52+
- `/storage/emulated/0/SimpleBootLogs/mount_log_YYYYMMDD.txt`
53+
Daily logs for boot diagnostics
54+
- `/dev/block/loopX`
55+
Loop device usage via `losetup` (automatic)
56+
57+
---
58+
59+
## 💻 How It Works
60+
61+
1. You select an ISO from the UI
62+
2. You choose the desired **mount method**
63+
3. SimpleBoot sets up the USB gadget using ConfigFS or legacy nodes
64+
4. It attaches the loop device and configures the gadget as a **bootable CD-ROM**
65+
5. Your PC sees it as a USB boot drive — boot away!
66+
67+
---
68+
69+
## 📦 Mount Methods Explained
70+
71+
| Method | Description |
72+
|------------|-----------------------------------------------------------------------------|
73+
| `ConfigFS` | Modern gadget system. Uses `/config/usb_gadget/...`. Required for Android 11+ |
74+
| `Legacy` | Uses `/sys/class/android_usb/android0/` and `f_mass_storage`. Older devices |
75+
| `Loopback` | Mounts ISO to `/dev/block/loop7` only (no USB exposure). For dev/testing |
76+
77+
---
78+
79+
## ⚠️ Disclaimers
80+
81+
- 📛 This app **requires root** and **full filesystem access**
82+
- 🧱 Misconfiguration or unsupported kernels may cause boot failures or USB stack issues
83+
- ⚡ SimpleBoot tries to restore ADB/charging state on every unmount and mount failure
84+
85+
---
86+
87+
## 🛠️ Built With
88+
89+
- [Jetpack Compose](https://developer.android.com/jetpack/compose)
90+
- [libsu](https://github.com/topjohnwu/libsu)
91+
- [Kotlin](https://kotlinlang.org/)
92+
- [Android 11+ Permissions API](https://developer.android.com/about/versions/11/privacy/storage)
93+
94+
---
95+
96+
## 📜 License
97+
98+
GNU GPLv3 – see [LICENSE](./LICENSE)
99+
100+
---
101+
102+
## 💬 Contribute
103+
104+
Pull requests welcome for:
105+
- Additional mount backends (e.g. FFS + userspace)
106+
- USB mode presets (keyboard, HID)
107+
- Multi-ISO boot chains (Ventoy-style)
108+
- USB detection callback API (notify when PC sees device)
109+
110+
---
111+
112+
## 🙏 Credits
113+
114+
- **Lead Dev:** [@matthewdaluz](https://github.com/matthewdaluz)
115+
- **AI Assistants:** ChatGPT + DeepSeek
116+
- **Special Thanks:** The open-source Android root community
117+
118+
---
119+
120+
## 🔚 Final Words
121+
122+
SimpleBoot gives Android users full control over USB boot from their pocket. Whether you're an IT tech, a Linux user, or just want to carry live systems on your phone — this tool is the bootloader companion you've been missing.
123+
124+
> ✨ Mount. Boot. Reboot. Simple. ✨

app/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/build

app/build.gradle

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
plugins {
2+
alias(libs.plugins.android.application)
3+
alias(libs.plugins.kotlin.android)
4+
alias(libs.plugins.kotlin.compose)
5+
}
6+
7+
android {
8+
namespace 'redhead.app.simpleboot'
9+
compileSdk 35
10+
11+
defaultConfig {
12+
applicationId "redhead.app.simpleboot"
13+
minSdk 30
14+
targetSdk 35
15+
versionCode 1
16+
versionName "2.1"
17+
18+
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
19+
}
20+
21+
buildTypes {
22+
release {
23+
minifyEnabled false
24+
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
25+
}
26+
}
27+
compileOptions {
28+
sourceCompatibility JavaVersion.VERSION_11
29+
targetCompatibility JavaVersion.VERSION_11
30+
coreLibraryDesugaringEnabled true
31+
}
32+
kotlinOptions {
33+
jvmTarget = '11'
34+
}
35+
buildFeatures {
36+
compose true
37+
}
38+
}
39+
40+
dependencies {
41+
implementation "androidx.compose.material:material-icons-extended:1.7.8" // Use latest stable version
42+
implementation libs.androidx.core.ktx
43+
implementation libs.androidx.lifecycle.runtime.ktx
44+
implementation libs.androidx.activity.compose
45+
implementation platform(libs.androidx.compose.bom)
46+
implementation libs.androidx.ui
47+
implementation libs.androidx.ui.graphics
48+
implementation libs.androidx.ui.tooling.preview
49+
implementation libs.androidx.material3
50+
implementation libs.androidx.benchmark.gradle.plugin
51+
coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:2.1.5'
52+
// Add libsu (topjohnwu) root access support
53+
implementation 'com.github.topjohnwu.libsu:core:5.0.4'
54+
implementation 'com.github.topjohnwu.libsu:service:5.0.4'
55+
56+
testImplementation libs.junit
57+
androidTestImplementation libs.androidx.junit
58+
androidTestImplementation libs.androidx.espresso.core
59+
androidTestImplementation platform(libs.androidx.compose.bom)
60+
androidTestImplementation libs.androidx.ui.test.junit4
61+
debugImplementation libs.androidx.ui.tooling
62+
debugImplementation libs.androidx.ui.test.manifest
63+
}

app/proguard-rules.pro

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Add project specific ProGuard rules here.
2+
# You can control the set of applied configuration files using the
3+
# proguardFiles setting in build.gradle.
4+
#
5+
# For more details, see
6+
# http://developer.android.com/guide/developing/tools/proguard.html
7+
8+
# If your project uses WebView with JS, uncomment the following
9+
# and specify the fully qualified class name to the JavaScript interface
10+
# class:
11+
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
12+
# public *;
13+
#}
14+
15+
# Uncomment this to preserve the line number information for
16+
# debugging stack traces.
17+
#-keepattributes SourceFile,LineNumberTable
18+
19+
# If you keep the line number information, uncomment this to
20+
# hide the original source file name.
21+
#-renamesourcefileattribute SourceFile

app/src/main/AndroidManifest.xml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
3+
xmlns:tools="http://schemas.android.com/tools">
4+
5+
<!-- All files access for Android 11+ -->
6+
<uses-permission android:name="android.permission.MANAGE_EXTERNAL_STORAGE"
7+
tools:ignore="AllFilesAccessPolicy,ScopedStorage" />
8+
9+
<application
10+
android:allowBackup="true"
11+
android:dataExtractionRules="@xml/data_extraction_rules"
12+
android:fullBackupContent="@xml/backup_rules"
13+
android:icon="@mipmap/ic_launcher"
14+
android:label="@string/app_name"
15+
android:roundIcon="@mipmap/ic_launcher_round"
16+
android:supportsRtl="true"
17+
android:theme="@style/Theme.SimpleBoot"
18+
tools:targetApi="31">
19+
20+
<provider
21+
android:name="androidx.core.content.FileProvider"
22+
android:authorities="${applicationId}.provider"
23+
android:exported="false"
24+
android:grantUriPermissions="true">
25+
<meta-data
26+
android:name="android.support.FILE_PROVIDER_PATHS"
27+
android:resource="@xml/file_paths" />
28+
</provider>
29+
30+
<activity
31+
android:name=".MainActivity"
32+
android:exported="true"
33+
android:theme="@style/Theme.SimpleBoot">
34+
<intent-filter>
35+
<action android:name="android.intent.action.MAIN" />
36+
<category android:name="android.intent.category.LAUNCHER" />
37+
</intent-filter>
38+
</activity>
39+
</application>
40+
41+
</manifest>
27.2 KB
Loading

0 commit comments

Comments
 (0)