Skip to content

Commit

Permalink
add maven publish, refine demo
Browse files Browse the repository at this point in the history
  • Loading branch information
Houvven committed May 16, 2024
1 parent e5e1042 commit 83f88d2
Show file tree
Hide file tree
Showing 3 changed files with 54 additions and 5 deletions.
3 changes: 0 additions & 3 deletions demo/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,6 @@
<meta-data
android:name="xposedmodule"
android:value="true"/>
<meta-data
android:name="xposedminversion"
android:value="54"/>
</application>

</manifest>
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import androidx.activity.ComponentActivity
import androidx.activity.compose.setContent
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Column
import androidx.compose.material3.Button
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.Text
import androidx.compose.runtime.LaunchedEffect
Expand All @@ -16,6 +17,7 @@ import androidx.compose.ui.Modifier
import io.github.houvven.lservice.LServiceBridgeRootService
import kotlinx.coroutines.delay
import org.lsposed.lspd.ILSPManagerService
import org.lsposed.lspd.models.Application

class MainActivity : ComponentActivity() {

Expand Down Expand Up @@ -43,6 +45,34 @@ class MainActivity : ComponentActivity() {
Text(text = "xposedApiVersion: $xposedApiVersion")
Text(text = "xposedVersionName: $xposedVersionName")
Text(text = "xposedVersionCode: $xposedVersionCode")

Button(onClick = {
managerService?.run {
val packageName = "com.houvven.lsposed.scope.demo"
getModuleScope(packageName).apply {
addAll(listOf(
Application().apply {
userId = 0
this.packageName = "android"
},
Application().apply {
userId = 0
this.packageName = "com.android.systemui"
},
Application().apply {
userId = 0
this.packageName = "com.tencent.mm"
}
))
}.let {
setModuleScope(packageName, it)
}
}
}) {
Text(text = "Click me")
}


}
}

Expand Down
26 changes: 24 additions & 2 deletions lservice/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
plugins {
`maven-publish`
alias(libs.plugins.androidLibrary)
}

Expand All @@ -7,22 +8,43 @@ android {
namespace = "io.github.houvven.lservice"
compileSdk = 34


defaultConfig {
minSdk = 27
}

compileOptions {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}
buildFeatures {
aidl = true
}
publishing {
singleVariant("release") {
withSourcesJar()
withJavadocJar()
}
}
}

dependencies {
api(libs.libsu.service)
api(libs.rikkax.parcelablelist)
compileOnly(fileTree("libs") { include("*.jar") })
}

publishing {
publications {
register<MavenPublication>("LService") {
group = "io.github.houvven"
artifactId = "lservice"
version = "1.0.0"
afterEvaluate {
from(components.getByName("release"))
}
}
}

repositories {
mavenLocal()
}
}

0 comments on commit 83f88d2

Please sign in to comment.