diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..647efcf --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "isodrive"] + path = isodrive + url = https://git.shihaam.dev/shihaam/isodrive diff --git a/app/src/main/java/sh/sar/isodroid/isodrive/IsoDriveManager.kt b/app/src/main/java/sh/sar/isodroid/isodrive/IsoDriveManager.kt index 1a932a4..e66cc86 100644 --- a/app/src/main/java/sh/sar/isodroid/isodrive/IsoDriveManager.kt +++ b/app/src/main/java/sh/sar/isodroid/isodrive/IsoDriveManager.kt @@ -58,42 +58,14 @@ class IsoDriveManager(private val context: Context) { binaryPath = targetFile.absolutePath true } catch (e: Exception) { - // Binary not bundled yet, will use system isodrive if available - checkSystemBinary() + // Binary extraction failed + false } } catch (e: Exception) { false } } - private suspend fun checkSystemBinary(): Boolean = withContext(Dispatchers.IO) { - // Check common locations first (more reliable than 'which') - val commonPaths = listOf( - "/data/adb/modules/isodrive-magisk/system/bin/isodrive", - "/data/adb/modules/isodrive/system/bin/isodrive", - "/system/bin/isodrive", - "/system/xbin/isodrive", - "/data/local/tmp/isodrive", - "/vendor/bin/isodrive" - ) - for (path in commonPaths) { - val checkResult = RootManager.executeCommand("test -f $path && echo exists") - if (checkResult.success && checkResult.output.contains("exists")) { - binaryPath = path - return@withContext true - } - } - - // Try 'which' as fallback - val result = RootManager.executeCommand("which isodrive 2>/dev/null") - if (result.success && result.output.isNotBlank()) { - binaryPath = result.output.trim() - return@withContext true - } - - false - } - suspend fun isSupported(): SupportStatus = withContext(Dispatchers.IO) { // First check if binary is available if (binaryPath == null && !extractBinary()) { diff --git a/isodrive b/isodrive new file mode 160000 index 0000000..2e9f28b --- /dev/null +++ b/isodrive @@ -0,0 +1 @@ +Subproject commit 2e9f28bd90dd57f4f72d2d21cb080e390336233a