You've already forked KernelSU-Next
mirror of
https://github.com/KernelSU-Next/KernelSU-Next.git
synced 2025-08-27 23:46:34 +00:00
manager: Next modifications, ksud: 16GB sparse image
This commit is contained in:
76
.github/workflows/build-manager.yml
vendored
76
.github/workflows/build-manager.yml
vendored
@@ -2,46 +2,33 @@ name: Build Manager
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ "main", "ci" ]
|
||||
branches: [ "main", "next" ]
|
||||
paths:
|
||||
- '.github/workflows/build-manager.yml'
|
||||
- 'manager/**'
|
||||
- 'kernel/**'
|
||||
- 'userspace/ksud/**'
|
||||
pull_request:
|
||||
branches: [ "main" ]
|
||||
branches: [ "main", "next" ]
|
||||
paths:
|
||||
- 'manager/**'
|
||||
workflow_call:
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
build-lkm:
|
||||
uses: ./.github/workflows/build-lkm.yml
|
||||
secrets: inherit
|
||||
|
||||
build-ksud:
|
||||
needs: build-lkm
|
||||
strategy:
|
||||
matrix:
|
||||
include:
|
||||
- target: aarch64-linux-android
|
||||
os: ubuntu-latest
|
||||
- target: x86_64-linux-android
|
||||
os: ubuntu-latest
|
||||
- target: x86_64-pc-windows-gnu # windows pc
|
||||
os: ubuntu-latest
|
||||
- target: x86_64-apple-darwin # Intel mac
|
||||
os: macos-latest
|
||||
- target: aarch64-apple-darwin # M chip mac
|
||||
os: macos-latest
|
||||
- target: aarch64-unknown-linux-musl # arm64 Linux
|
||||
os: ubuntu-latest
|
||||
- target: x86_64-unknown-linux-musl # x86 Linux
|
||||
- target: x86_64-unknown-linux-musl # x86 Linux, keeping this so i can ksud in muh pc
|
||||
os: ubuntu-latest
|
||||
uses: ./.github/workflows/ksud.yml
|
||||
with:
|
||||
target: ${{ matrix.target }}
|
||||
os: ${{ matrix.os }}
|
||||
pack_lkm: false
|
||||
|
||||
build-manager:
|
||||
needs: build-ksud
|
||||
@@ -56,27 +43,14 @@ jobs:
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Setup need_upload
|
||||
id: need_upload
|
||||
run: |
|
||||
if [ ! -z "${{ secrets.BOT_TOKEN }}" ]; then
|
||||
echo "UPLOAD=true" >> $GITHUB_OUTPUT
|
||||
else
|
||||
echo "UPLOAD=false" >> $GITHUB_OUTPUT
|
||||
fi
|
||||
|
||||
- name: Write key
|
||||
if: ${{ ( github.event_name != 'pull_request' && github.ref == 'refs/heads/main' ) || github.ref_type == 'tag' }}
|
||||
run: |
|
||||
if [ ! -z "${{ secrets.KEYSTORE }}" ]; then
|
||||
{
|
||||
echo KEYSTORE_PASSWORD='${{ secrets.KEYSTORE_PASSWORD }}'
|
||||
echo KEY_ALIAS='${{ secrets.KEY_ALIAS }}'
|
||||
echo KEY_PASSWORD='${{ secrets.KEY_PASSWORD }}'
|
||||
echo KEYSTORE_FILE='key.jks'
|
||||
echo KEYSTORE_FILE='next.keystore'
|
||||
} >> gradle.properties
|
||||
echo ${{ secrets.KEYSTORE }} | base64 -d > key.jks
|
||||
fi
|
||||
|
||||
- name: Setup Java
|
||||
uses: actions/setup-java@v4
|
||||
@@ -96,18 +70,10 @@ jobs:
|
||||
name: ksud-aarch64-linux-android
|
||||
path: .
|
||||
|
||||
- name: Download x86_64 ksud
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: ksud-x86_64-linux-android
|
||||
path: .
|
||||
|
||||
- name: Copy ksud to app jniLibs
|
||||
run: |
|
||||
mkdir -p app/src/main/jniLibs/arm64-v8a
|
||||
mkdir -p app/src/main/jniLibs/x86_64
|
||||
cp -f ../aarch64-linux-android/release/ksud ../manager/app/src/main/jniLibs/arm64-v8a/libksud.so
|
||||
cp -f ../x86_64-linux-android/release/ksud ../manager/app/src/main/jniLibs/x86_64/libksud.so
|
||||
|
||||
- name: Build with Gradle
|
||||
run: |
|
||||
@@ -122,40 +88,12 @@ jobs:
|
||||
|
||||
- name: Upload build artifact
|
||||
uses: actions/upload-artifact@v4
|
||||
if: ${{ ( github.event_name != 'pull_request' && github.ref == 'refs/heads/main' ) || github.ref_type == 'tag' }}
|
||||
with:
|
||||
name: manager
|
||||
path: manager/app/build/outputs/apk/release/*.apk
|
||||
|
||||
- name: Upload mappings
|
||||
uses: actions/upload-artifact@v4
|
||||
if: ${{ ( github.event_name != 'pull_request' && github.ref == 'refs/heads/main' ) || github.ref_type == 'tag' }}
|
||||
with:
|
||||
name: "mappings"
|
||||
path: "manager/app/build/outputs/mapping/release/"
|
||||
|
||||
- name: Bot session cache
|
||||
if: github.event_name != 'pull_request' && steps.need_upload.outputs.UPLOAD == 'true'
|
||||
id: bot_session_cache
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: scripts/ksubot.session
|
||||
key: ${{ runner.os }}-bot-session
|
||||
|
||||
- name: Upload to telegram
|
||||
if: github.event_name != 'pull_request' && steps.need_upload.outputs.UPLOAD == 'true'
|
||||
env:
|
||||
CHAT_ID: ${{ secrets.CHAT_ID }}
|
||||
BOT_TOKEN: ${{ secrets.BOT_TOKEN }}
|
||||
MESSAGE_THREAD_ID: ${{ secrets.MESSAGE_THREAD_ID }}
|
||||
COMMIT_MESSAGE: ${{ github.event.head_commit.message }}
|
||||
COMMIT_URL: ${{ github.event.head_commit.url }}
|
||||
RUN_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
|
||||
TITLE: Manager
|
||||
run: |
|
||||
if [ ! -z "${{ secrets.BOT_TOKEN }}" ]; then
|
||||
export VERSION=$(git rev-list --count HEAD)
|
||||
APK=$(find ./app/build/outputs/apk/release -name "*.apk")
|
||||
pip3 install telethon
|
||||
python3 $GITHUB_WORKSPACE/scripts/ksubot.py $APK
|
||||
fi
|
||||
path: "manager/app/build/outputs/mapping/release/"
|
||||
@@ -68,7 +68,7 @@ android {
|
||||
applicationVariants.all {
|
||||
outputs.forEach {
|
||||
val output = it as BaseVariantOutputImpl
|
||||
output.outputFileName = "KernelSU_${managerVersionName}_${managerVersionCode}-$name.apk"
|
||||
output.outputFileName = "KernelSU_${managerVersionName}_${managerVersionCode}-next-$name.apk"
|
||||
}
|
||||
kotlin.sourceSets {
|
||||
getByName(name) {
|
||||
|
||||
@@ -102,6 +102,7 @@ fun HomeScreen(navigator: DestinationsNavigator) {
|
||||
if (checkUpdate) {
|
||||
UpdateCard()
|
||||
}
|
||||
Next()
|
||||
InfoCard()
|
||||
DonateCard()
|
||||
LearnMoreCard()
|
||||
@@ -299,15 +300,15 @@ private fun StatusCard(
|
||||
}
|
||||
|
||||
else -> {
|
||||
Icon(Icons.Outlined.Block, stringResource(R.string.home_unsupported))
|
||||
Icon(Icons.Outlined.Block, stringResource(R.string.home_failure))
|
||||
Column(Modifier.padding(start = 20.dp)) {
|
||||
Text(
|
||||
text = stringResource(R.string.home_unsupported),
|
||||
text = stringResource(R.string.home_failure),
|
||||
style = MaterialTheme.typography.titleMedium
|
||||
)
|
||||
Spacer(Modifier.height(4.dp))
|
||||
Text(
|
||||
text = stringResource(R.string.home_unsupported_reason),
|
||||
text = stringResource(R.string.home_failure_reason),
|
||||
style = MaterialTheme.typography.bodyMedium
|
||||
)
|
||||
}
|
||||
@@ -420,7 +421,7 @@ private fun InfoCard() {
|
||||
val managerVersion = getManagerVersion(context)
|
||||
InfoCardItem(
|
||||
stringResource(R.string.home_manager_version),
|
||||
"${managerVersion.first} (${managerVersion.second})"
|
||||
"${managerVersion.first}-next (${managerVersion.second})"
|
||||
)
|
||||
|
||||
Spacer(Modifier.height(16.dp))
|
||||
@@ -432,6 +433,34 @@ private fun InfoCard() {
|
||||
}
|
||||
}
|
||||
|
||||
@Composable
|
||||
fun Next() {
|
||||
val uriHandler = LocalUriHandler.current
|
||||
val url = stringResource(R.string.home_next_kernelsu_announce)
|
||||
|
||||
ElevatedCard {
|
||||
|
||||
Row(modifier = Modifier
|
||||
.fillMaxWidth()
|
||||
.clickable {
|
||||
uriHandler.openUri(url)
|
||||
}
|
||||
.padding(24.dp), verticalAlignment = Alignment.CenterVertically) {
|
||||
Column {
|
||||
Text(
|
||||
text = stringResource(R.string.home_next_kernelsu),
|
||||
style = MaterialTheme.typography.titleSmall
|
||||
)
|
||||
Spacer(Modifier.height(4.dp))
|
||||
Text(
|
||||
text = stringResource(R.string.home_next_kernelsu_body),
|
||||
style = MaterialTheme.typography.bodyMedium
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fun getManagerVersion(context: Context): Pair<String, Long> {
|
||||
val packageInfo = context.packageManager.getPackageInfo(context.packageName, 0)!!
|
||||
val versionCode = PackageInfoCompat.getLongVersionCode(packageInfo)
|
||||
|
||||
@@ -62,7 +62,8 @@ fun download(
|
||||
}
|
||||
|
||||
fun checkNewVersion(): LatestVersionInfo {
|
||||
val url = "https://api.github.com/repos/tiann/KernelSU/releases/latest"
|
||||
// Next updates
|
||||
val url = "https://api.github.com/repos/rifsxd/KernelSU/releases/latest"
|
||||
// default null value if failed
|
||||
val defaultValue = LatestVersionInfo()
|
||||
runCatching {
|
||||
|
||||
@@ -10,6 +10,8 @@
|
||||
<string name="home_module_count">Modules: %d</string>
|
||||
<string name="home_unsupported">Unsupported</string>
|
||||
<string name="home_unsupported_reason">KernelSU only supports GKI kernels now</string>
|
||||
<string name="home_failure">!kenrelsu || != size/hash</string>
|
||||
<string name="home_failure_reason">Failure! Next size/hash required.</string>
|
||||
<string name="home_kernel">Kernel</string>
|
||||
<string name="home_manager_version">Manager version</string>
|
||||
<string name="home_fingerprint">Fingerprint</string>
|
||||
@@ -47,6 +49,9 @@
|
||||
<string name="safe_mode">Safe mode</string>
|
||||
<string name="reboot_to_apply">Reboot to take effect</string>
|
||||
<string name="module_magisk_conflict">Modules are unavailable due to a conflict with Magisk!</string>
|
||||
<string name="home_next_kernelsu">🔥 Next Build</string>
|
||||
<string name="home_next_kernelsu_announce">https://github.com/rifsxd/KernelSU</string>
|
||||
<string name="home_next_kernelsu_body">Next modifications branch; Check out the repo!</string>
|
||||
<string name="home_learn_kernelsu">Learn KernelSU</string>
|
||||
<string name="home_learn_kernelsu_url">https://kernelsu.org/guide/what-is-kernelsu.html</string>
|
||||
<string name="home_click_to_learn_kernelsu">Learn how to install KernelSU and use modules</string>
|
||||
|
||||
@@ -18,7 +18,7 @@ cmaker {
|
||||
"-DANDROID_STL=none",
|
||||
)
|
||||
)
|
||||
abiFilters("arm64-v8a", "x86_64", "riscv64")
|
||||
abiFilters("arm64-v8a")
|
||||
}
|
||||
buildTypes {
|
||||
if (it.name == "release") {
|
||||
@@ -80,7 +80,7 @@ subprojects {
|
||||
versionName = managerVersionName
|
||||
}
|
||||
ndk {
|
||||
abiFilters += listOf("arm64-v8a", "x86_64", "riscv64")
|
||||
abiFilters += listOf("arm64-v8a")
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
BIN
manager/next.keystore
Normal file
BIN
manager/next.keystore
Normal file
Binary file not shown.
@@ -362,7 +362,7 @@ fn _install_module(zip: &str) -> Result<()> {
|
||||
humansize::format_size(zip_uncompressed_size, humansize::DECIMAL)
|
||||
);
|
||||
|
||||
let sparse_image_size = 1 << 40; // 1T
|
||||
let sparse_image_size = 1 << 34; // 16G
|
||||
let journal_size = 8; // 8M
|
||||
if !modules_img_exist && !modules_update_img_exist {
|
||||
// if no modules and modules_update, it is brand new installation, we should create a new img
|
||||
|
||||
Reference in New Issue
Block a user