Skip to content
This repository has been archived by the owner on Mar 15, 2022. It is now read-only.

Commit

Permalink
bundle busybox
Browse files Browse the repository at this point in the history
  • Loading branch information
X1nto committed Oct 8, 2021
1 parent ccd82f3 commit 6ed72d3
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 12 deletions.
6 changes: 4 additions & 2 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -123,8 +123,10 @@ dependencies {
implementation("com.squareup.retrofit2:retrofit:2.9.0")

// Root permissions
implementation("com.github.topjohnwu.libsu:core:3.1.2")
implementation("com.github.topjohnwu.libsu:io:3.1.2")
val libsuVersion = "3.1.2"
implementation("com.github.topjohnwu.libsu:core:$libsuVersion")
implementation("com.github.topjohnwu.libsu:io:$libsuVersion")
implementation("com.github.topjohnwu.libsu:busybox:$libsuVersion")

// Layout
implementation("com.google.android.flexbox:flexbox:3.0.0")
Expand Down
12 changes: 11 additions & 1 deletion app/src/main/java/com/vanced/manager/core/App.kt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@ package com.vanced.manager.core

import android.app.Application
import androidx.preference.PreferenceManager.getDefaultSharedPreferences
import com.vanced.manager.BuildConfig.*
import com.topjohnwu.superuser.BusyBoxInstaller
import com.topjohnwu.superuser.Shell
import com.vanced.manager.BuildConfig
import com.vanced.manager.utils.loadJson
import com.vanced.manager.utils.managerAccent
import com.vanced.manager.utils.mutableAccentColor
Expand All @@ -20,6 +22,14 @@ class App : Application() {
scope.launch { loadJson(this@App) }
super.onCreate()
mutableAccentColor.value = prefs.managerAccent
Shell.enableVerboseLogging = BuildConfig.DEBUG
Shell.setDefaultBuilder(
Shell.Builder
.create()
.setFlags(Shell.FLAG_REDIRECT_STDERR)
.setInitializers(BusyBoxInstaller::class.java)
.setTimeout(10)
)
}

}
9 changes: 0 additions & 9 deletions app/src/main/java/com/vanced/manager/utils/PackageHelper.kt
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,6 @@ object PackageHelper {
private val vancedThemes =
vanced.value?.array<String>("themes")?.value ?: listOf("black", "dark", "pink", "blue")

init {
Shell.enableVerboseLogging = BuildConfig.DEBUG
Shell.setDefaultBuilder(
Shell.Builder.create()
.setFlags(Shell.FLAG_REDIRECT_STDERR)
.setTimeout(10)
)
}

private fun getAppNameRoot(pkg: String): String {
return when (pkg) {
vancedRootPkg -> "vanced"
Expand Down

0 comments on commit 6ed72d3

Please sign in to comment.