Skip to content

ModConf Compose

Der_Googler edited this page Oct 12, 2024 · 2 revisions

TODO

Static fields

There are some fields that can be used to access the current state of MMRL, such as is the provider alive

/* if you need to check if the provider is alive */
var isProviderAlive = false

/* displays the manager name that the user uses */
var managerName = ""

/* version code of the root */
var versionCode = 0

/* version name of the root */
var versionName = ""

/* displays the current mod id of the module */
var modId = ""

/* file path of the *.dex, *.apk or *.jar file. usually in /system/lib or /system/lib64. while debugging it is /data/data/com.dergoogler.mmrl/files */
var dexFilePath = ""

/* com.dergoogler.mmrl or com.dergoogler.mmrl.debug */
var mmrlPackageName = ""

Setup

Every ModConf needs the be have the same base setup

File called ModConfScreen.kt:

@Composable
fun ModConfScreen() {
  Text("Hello form ModConf!")
}

Any other defined function or class cannot loaded

Dependencies

It is recommend not to include all dependencies, just the necessary ones. Including these libraries can make the ModConf unnecessary big.

dependencies {
    compileOnly(libs.androidx.ui)
    compileOnly(libs.androidx.material3)
    compileOnly(libs.androidx.ui.tooling.preview)
    compileOnly(libs.androidx.runtime.livedata)
    compileOnly(libs.libsu.core)
    compileOnly(libs.libsu.io)
    compileOnly(libs.androidx.navigation.runtime.ktx)
    compileOnly(libs.androidx.navigation.compose)
}
[versions]
agp = "8.5.1"
gradle = "8.1.4"
libsu = "5.2.1"
material3 = "1.2.1"
runtimeLivedata = "1.7.2"
ui = "1.7.0-beta01"
uiToolingPreview = "1.7.2"
navigationRuntimeKtx = "2.8.2"
navigationCompose = "2.7.7"

[libraries]
androidx-material3 = { module = "androidx.compose.material3:material3", version.ref = "material3" }
androidx-runtime-livedata = { module = "androidx.compose.runtime:runtime-livedata", version.ref = "runtimeLivedata" }
androidx-ui = { module = "androidx.compose.ui:ui", version.ref = "ui" }
androidx-ui-tooling-preview = { module = "androidx.compose.ui:ui-tooling-preview", version.ref = "uiToolingPreview" }
gradle = { module = "com.android.tools.build:gradle", version.ref = "gradle" }
libsu-core = { module = "com.github.topjohnwu.libsu:core", version.ref = "libsu" }
libsu-io = { module = "com.github.topjohnwu.libsu:io", version.ref = "libsu" }
androidx-navigation-runtime-ktx = { group = "androidx.navigation", name = "navigation-runtime-ktx", version.ref = "navigationRuntimeKtx" }
androidx-navigation-compose = { group = "androidx.navigation", name = "navigation-compose", version.ref = "navigationCompose" }

[plugins]
android-application = { id = "com.android.application", version.ref = "agp" }

No Sidebar

Clone this wiki locally