android: add packaging task

This commit is contained in:
Kavish Devar
2026-04-24 19:48:45 +05:30
parent 0b578d62cf
commit 67fc93bde5
7 changed files with 124 additions and 12 deletions

7
.gitignore vendored
View File

@@ -1,10 +1,5 @@
root-module/radare2-5.9.9-android-aarch64.tar.gz
wak.toml
log.txt
btl2capfix.zip
root-module-manual
release
.vscode
testing.py
.DS_Store
CMakeLists.txt.user*

View File

@@ -1,5 +1,7 @@
import java.util.Properties
val versionName = "0.2.3"
plugins {
alias(libs.plugins.android.application)
alias(libs.plugins.kotlin.compose)
@@ -29,15 +31,14 @@ android {
minSdk = 33
targetSdk = 37
versionCode = 36
versionName = "0.2.3"
versionName = versionName
}
buildTypes {
release {
isMinifyEnabled = true
isShrinkResources = true
proguardFiles(
getDefaultProguardFile("proguard-android-optimize.txt"),
"proguard-rules.pro"
getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro"
)
externalNativeBuild {
cmake {
@@ -83,7 +84,7 @@ android {
}
sourceSets {
getByName("main") {
res.directories+="src/main/res-apple"
res.directories += "src/main/res-apple"
}
}
@@ -144,9 +145,83 @@ dependencies {
}
aboutLibraries {
export{
export {
prettyPrint = true
excludeFields = listOf("generated")
outputFile = file("src/main/res/raw/aboutlibraries.json")
}
}
val rootModuleDir = rootProject.file("../root-module-manual")
val releaseDir = rootProject.file("../release")
fun cap(s: String) = s.replaceFirstChar { it.uppercase() }
fun registerRootModuleZipTask(
name: String,
flavor: String,
buildType: String
) = tasks.register<Zip>(name) {
val variantTask = "assemble${cap(flavor)}${cap(buildType)}"
dependsOn(variantTask)
val apkPath = "outputs/apk/$flavor/$buildType/app-$flavor-$buildType.apk"
from(rootModuleDir)
duplicatesStrategy = DuplicatesStrategy.WARN
from(layout.buildDirectory.file(apkPath)) {
into("system/priv-app/LibrePods")
rename { "LibrePods.apk" }
}
archiveFileName.set("LibrePods-FOSS-v$versionName-$buildType.zip")
destinationDirectory.set(layout.buildDirectory.dir("outputs/rootModuleZips"))
}
val zipRelease = registerRootModuleZipTask(
"zipXposedReleaseModule",
"xposed",
"release"
)
val zipDebug = registerRootModuleZipTask(
"zipXposedDebugModule",
"xposed",
"debug"
)
val collect = tasks.register<Copy>("collectReleaseArtifacts") {
dependsOn(
zipRelease,
zipDebug,
"bundleXposedPlayRelease"
)
into(releaseDir)
from(layout.buildDirectory.dir("outputs/apk/xposed/release")) {
include("*.apk")
rename(".*", "LibrePods-FOSS-v$versionName-release.apk")
}
from(layout.buildDirectory.dir("outputs/apk/xposed/debug")) {
include("*.apk")
rename(".*", "LibrePods-FOSS-v$versionName-debug.apk")
}
from(layout.buildDirectory.dir("outputs/bundle/xposedPlayRelease")) {
include("*.aab")
}
from(layout.buildDirectory.dir("outputs/rootModuleZips")) {
include("*.zip")
}
}
tasks.register("packageReleaseArtifacts") {
dependsOn(collect)
}

1
root-module-manual/.gitignore vendored Normal file
View File

@@ -0,0 +1 @@
system/

View File

@@ -0,0 +1,33 @@
#!/sbin/sh
#################
# Initialization
#################
umask 022
# echo before loading util_functions
ui_print() { echo "$1"; }
require_new_magisk() {
ui_print "*******************************"
ui_print " Please install Magisk v20.4+! "
ui_print "*******************************"
exit 1
}
#########################
# Load util_functions.sh
#########################
OUTFD=$2
ZIPFILE=$3
mount /data 2>/dev/null
[ -f /data/adb/magisk/util_functions.sh ] || require_new_magisk
. /data/adb/magisk/util_functions.sh
[ $MAGISK_VER_CODE -lt 20400 ] && require_new_magisk
install_module
exit 0

View File

@@ -0,0 +1 @@
#MAGISK

View File

@@ -0,0 +1,7 @@
id=librepods
name=LibrePods
version=v0.2.0
versionCode=34
author=@kavishdevar
description=Installs LibrePods as a system app for granting BLUETOOTH_PRIVILEGED and MODIFY_PHONE_STATE permission for better integraion with android.
updateJson=https://raw.githubusercontent.com/kavishdevar/librepods/main/update_nonpatch.json

View File

@@ -1,6 +1,6 @@
{
"version": "v0.2.3",
"versionCode": 36,
"zipUrl": "https://github.com/kavishdevar/librepods/releases/download/v0.2.3/LibrePods-v0.2.3-release.zip",
"zipUrl": "https://github.com/kavishdevar/librepods/releases/download/v0.2.3/LibrePods-FOSS-v0.2.3-release.zip",
"changelog": "https://raw.githubusercontent.com/kavishdevar/librepods/main/CHANGELOG.md"
}