Skip to content

Commit 345aed1

Browse files
PhuScamSaleOff
authored andcommitted
manager: some customization
1 parent c48e073 commit 345aed1

17 files changed

Lines changed: 136 additions & 370 deletions

File tree

.github/workflows/build-manager.yml

Lines changed: 21 additions & 134 deletions
Original file line numberDiff line numberDiff line change
@@ -2,34 +2,11 @@ name: Build Manager
22

33
on:
44
push:
5-
branches: [ "main", "dev", "ci", "master" ]
5+
branches: [ "sign" ]
66
paths:
7-
- 'README.md'
87
- '.github/workflows/build-manager.yml'
9-
- '.github/workflows/build-lkm.yml'
10-
- '.github/workflows/ddk-lkm.yml'
11-
- '.github/workflows/ksud.yml'
12-
- '.github/workflows/ksud-extra.yml'
13-
- '.github/scripts/setup-rust-build.sh'
14-
- 'repack_apk.py'
158
- 'manager/**'
16-
- 'kernel/**'
179
- 'userspace/**'
18-
- 'scripts/ksubot.py'
19-
pull_request:
20-
branches: [ "main", "dev" ]
21-
paths:
22-
- '.github/workflows/build-manager.yml'
23-
- '.github/workflows/build-lkm.yml'
24-
- '.github/workflows/ddk-lkm.yml'
25-
- '.github/workflows/ksud.yml'
26-
- '.github/workflows/ksud-extra.yml'
27-
- '.github/scripts/setup-rust-build.sh'
28-
- 'repack_apk.py'
29-
- 'manager/**'
30-
- 'kernel/**'
31-
- 'userspace/**'
32-
- 'scripts/ksubot.py'
3310
workflow_call:
3411
workflow_dispatch:
3512

@@ -89,52 +66,20 @@ jobs:
8966
echo "Certificate size: $SIZE_HEX ($SIZE_DEC bytes)"
9067
echo "Certificate hash: $HASH"
9168
92-
build-lkm:
93-
needs: generate-key
94-
uses: ./.github/workflows/build-lkm.yml
95-
with:
96-
expected_size2: ${{ needs.generate-key.outputs.expected_size || '' }}
97-
expected_hash2: ${{ needs.generate-key.outputs.expected_hash || '' }}
98-
secrets: inherit
99-
100-
build-ksuinit:
101-
uses: ./.github/workflows/ksuinit.yml
102-
10369
build-ksud:
104-
needs: [build-lkm, build-ksuinit]
10570
strategy:
10671
matrix:
10772
include:
10873
- target: aarch64-linux-android
109-
- target: armv7-linux-androideabi
110-
- target: x86_64-linux-android
111-
uses: ./.github/workflows/ksud.yml
112-
with:
113-
target: ${{ matrix.target }}
114-
pack_lkm: true
115-
pack_ksuinit: true
116-
117-
build-ksud-extra:
118-
needs: [build-lkm, build-ksuinit]
119-
strategy:
120-
matrix:
121-
include:
122-
- target: x86_64-pc-windows-gnu # windows pc
12374
os: ubuntu-latest
124-
- target: x86_64-apple-darwin # Intel mac
125-
os: macos-latest
126-
- target: aarch64-apple-darwin # M chip mac
127-
os: macos-latest
128-
- target: aarch64-unknown-linux-musl # arm64 Linux
129-
os: ubuntu-latest
130-
- target: x86_64-unknown-linux-musl # x86 Linux
75+
- target: armv7-linux-androideabi
13176
os: ubuntu-latest
132-
uses: ./.github/workflows/ksud-extra.yml
77+
78+
uses: ./.github/workflows/ksud.yml
13379
with:
13480
target: ${{ matrix.target }}
135-
os: ${{ matrix.os }}
136-
pack_lkm: true
137-
pack_ksuinit: true
81+
pack_lkm: false
82+
pack_ksuinit: false
13883

13984
build-manager:
14085
needs: [generate-key]
@@ -151,17 +96,14 @@ jobs:
15196
fetch-depth: 0
15297

15398
- name: Write key
154-
if: ${{ github.event_name != 'pull_request' || github.ref_type == 'tag' }}
99+
if: ${{ ( github.event_name != 'pull_request' ) || github.ref_type == 'tag' }}
155100
run: |
156-
if [ ! -z "${{ secrets.KEYSTORE }}" ]; then
157101
{
158-
echo KEYSTORE_PASSWORD='${{ secrets.KEYSTORE_PASSWORD }}'
159-
echo KEY_ALIAS='${{ secrets.KEY_ALIAS }}'
160-
echo KEY_PASSWORD='${{ secrets.KEY_PASSWORD }}'
102+
echo KEYSTORE_PASSWORD='Hello@5678'
103+
echo KEY_ALIAS='cafes'
104+
echo KEY_PASSWORD='Hello@5678'
161105
echo KEYSTORE_FILE='key.jks'
162106
} >> gradle.properties
163-
echo "${{ secrets.KEYSTORE }}" | base64 -d > key.jks
164-
fi
165107
166108
- name: Write PR key
167109
if: github.event_name == 'pull_request'
@@ -193,21 +135,21 @@ jobs:
193135
- name: Build with Gradle
194136
run: |
195137
if [ "${{ github.event_name }}" = "pull_request" ]; then
196-
./gradlew assembleRelease -PIS_PR_BUILD=true
138+
./gradlew clean assembleRelease --stacktrace -PIS_PR_BUILD=true
197139
else
198-
./gradlew assembleRelease
140+
./gradlew clean assembleRelease --stacktrace
199141
fi
200142
201143
- name: Upload build artifact
202-
if: ${{ github.event_name == 'pull_request' || (github.event_name != 'pull_request') || github.ref_type == 'tag' }}
144+
if: ${{ ( github.event_name != 'pull_request' ) || github.ref_type == 'tag' }}
203145
uses: actions/upload-artifact@v7
204146
with:
205147
name: manager-gradle
206148
path: manager/app/build/outputs/apk/release/*.apk
207149

208150
- name: Upload mappings
209151
uses: actions/upload-artifact@v7
210-
if: ${{ ( github.event_name != 'pull_request') || github.ref_type == 'tag' }}
152+
if: ${{ ( github.event_name != 'pull_request' ) || github.ref_type == 'tag' }}
211153
with:
212154
name: "mappings"
213155
path: "manager/app/build/outputs/mapping/release/"
@@ -253,12 +195,6 @@ jobs:
253195
name: ksud-armv7-linux-androideabi
254196
path: artifacts/ksud-armv7-linux-androideabi
255197

256-
- name: Download x86_64 ksud
257-
uses: actions/download-artifact@v8
258-
with:
259-
name: ksud-x86_64-linux-android
260-
path: artifacts/ksud-x86_64-linux-android
261-
262198
- name: Place manager apk and ksud artifacts
263199
run: |
264200
mkdir -p manager/app/build/outputs/apk/release
@@ -268,87 +204,38 @@ jobs:
268204
269205
mkdir -p target/aarch64-linux-android/release
270206
mkdir -p target/armv7-linux-androideabi/release
271-
mkdir -p target/x86_64-linux-android/release
272207
ARM64_KSUD=$(find artifacts/ksud-aarch64-linux-android -type f -name ksud | head -n 1)
273208
ARM_KSUD=$(find artifacts/ksud-armv7-linux-androideabi -type f -name ksud | head -n 1)
274-
X86_64_KSUD=$(find artifacts/ksud-x86_64-linux-android -type f -name ksud | head -n 1)
275209
test -n "$ARM64_KSUD"
276210
test -n "$ARM_KSUD"
277-
test -n "$X86_64_KSUD"
278211
cp -f "$ARM64_KSUD" target/aarch64-linux-android/release/ksud
279212
cp -f "$ARM_KSUD" target/armv7-linux-androideabi/release/ksud
280-
cp -f "$X86_64_KSUD" target/x86_64-linux-android/release/ksud
281213
282214
- name: Prepare signing inputs
283-
if: ${{ github.event_name == 'pull_request' || (github.event_name != 'pull_request') || github.ref_type == 'tag' }}
284-
env:
285-
PR_KEYSTORE: ${{ needs.generate-key.outputs.keystore }}
286-
PR_KEYSTORE_PASSWORD: ${{ needs.generate-key.outputs.keystore_password }}
287-
PR_KEY_PASSWORD: ${{ needs.generate-key.outputs.key_password }}
288-
PROD_KEYSTORE: ${{ secrets.KEYSTORE }}
289-
PROD_KEY_ALIAS: ${{ secrets.KEY_ALIAS }}
290-
PROD_KEYSTORE_PASSWORD: ${{ secrets.KEYSTORE_PASSWORD }}
291-
PROD_KEY_PASSWORD: ${{ secrets.KEY_PASSWORD }}
215+
if: ${{ ( github.event_name != 'pull_request' ) || github.ref_type == 'tag' }}
292216
run: |
293-
if [ "${{ github.event_name }}" = "pull_request" ]; then
294-
echo "$PR_KEYSTORE" | base64 -d > pr-key.jks
295-
echo "SIGN_KEYSTORE_FILE=pr-key.jks" >> $GITHUB_ENV
296-
echo "SIGN_KEY_ALIAS=pr-key" >> $GITHUB_ENV
297-
echo "SIGN_KEYSTORE_PASSWORD=$PR_KEYSTORE_PASSWORD" >> $GITHUB_ENV
298-
echo "SIGN_KEY_PASSWORD=$PR_KEY_PASSWORD" >> $GITHUB_ENV
299-
else
300-
test -n "$PROD_KEYSTORE"
301-
echo "$PROD_KEYSTORE" | base64 -d > key.jks
302-
echo "SIGN_KEYSTORE_FILE=key.jks" >> $GITHUB_ENV
303-
echo "SIGN_KEY_ALIAS=$PROD_KEY_ALIAS" >> $GITHUB_ENV
304-
echo "SIGN_KEYSTORE_PASSWORD=$PROD_KEYSTORE_PASSWORD" >> $GITHUB_ENV
305-
echo "SIGN_KEY_PASSWORD=$PROD_KEY_PASSWORD" >> $GITHUB_ENV
306-
fi
217+
echo "SIGN_KEYSTORE_FILE=manager/key.jks" >> $GITHUB_ENV
218+
echo "SIGN_KEY_ALIAS=cafes" >> $GITHUB_ENV
219+
echo "SIGN_KEYSTORE_PASSWORD=Hello@5678" >> $GITHUB_ENV
220+
echo "SIGN_KEY_PASSWORD=Hello@5678" >> $GITHUB_ENV
307221
308222
- name: Repack and resign
309-
if: ${{ github.event_name == 'pull_request' || (github.event_name != 'pull_request') || github.ref_type == 'tag' }}
223+
if: ${{ ( github.event_name != 'pull_request' ) || github.ref_type == 'tag' }}
310224
run: |
311225
python3 repack_apk.py repack \
312226
-b release \
313227
-t release \
314228
-a arm64-v8a \
315229
-a armeabi-v7a \
316-
-a x86_64 \
317230
-K "$SIGN_KEYSTORE_FILE" \
318231
-A "$SIGN_KEY_ALIAS" \
319232
-P "$SIGN_KEYSTORE_PASSWORD" \
320233
-S "$SIGN_KEY_PASSWORD" \
321234
--strip
322235
323236
- name: Upload build artifact
324-
if: ${{ github.event_name == 'pull_request' || (github.event_name != 'pull_request') || github.ref_type == 'tag' }}
237+
if: ${{ ( github.event_name != 'pull_request' ) || github.ref_type == 'tag' }}
325238
uses: actions/upload-artifact@v7
326239
with:
327240
name: manager
328241
path: dist/*.apk
329-
330-
- name: Bot session cache
331-
if: github.event_name != 'pull_request' && steps.need_upload.outputs.UPLOAD == 'true'
332-
id: bot_session_cache
333-
uses: actions/cache@v5
334-
with:
335-
path: scripts/ksubot.session
336-
key: ${{ runner.os }}-bot-session
337-
338-
- name: Upload to telegram
339-
if: github.event_name != 'pull_request' && steps.need_upload.outputs.UPLOAD == 'true'
340-
env:
341-
CHAT_ID: ${{ vars.CHAT_ID }}
342-
BOT_TOKEN: ${{ secrets.BOT_TOKEN }}
343-
MESSAGE_THREAD_ID: ${{ vars.MESSAGE_THREAD_ID }}
344-
GITHUB_EVENT: ${{ toJson(github.event) }}
345-
RUN_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
346-
TITLE: Manager
347-
BRANCH: ${{ github.ref_name }}
348-
run: |
349-
if [ ! -z "${{ secrets.BOT_TOKEN }}" ]; then
350-
export VERSION=$(git rev-list --count HEAD)
351-
APK=$(find ./dist -name "*.apk")
352-
pip3 install telethon
353-
python3 $GITHUB_WORKSPACE/scripts/ksubot.py $APK
354-
fi

manager/app/build.gradle.kts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ android {
120120
targetSdk = androidTargetSdkVersion
121121
versionCode = managerVersionCode
122122
versionName = managerVersionName
123-
applicationId = "com.kowx712.supermanager"
123+
applicationId = "com.cafes.org"
124124

125125
buildConfigField("boolean", "IS_PR_BUILD", isPrBuild.toString())
126126

@@ -133,7 +133,7 @@ android {
133133
}
134134

135135
ndk {
136-
abiFilters += listOf("arm64-v8a", "armeabi-v7a", "x86_64")
136+
abiFilters += listOf("arm64-v8a", "armeabi-v7a")
137137
}
138138
}
139139

@@ -156,7 +156,7 @@ androidComponents {
156156

157157
base {
158158
archivesName.set(
159-
"KowSU_${managerVersionName}_${managerVersionCode}"
159+
"KernelSU_${managerVersionName}_${managerVersionCode}"
160160
)
161161
}
162162

manager/app/src/main/java/me/weishu/kernelsu/ui/screen/home/HomeMaterial.kt

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -510,13 +510,6 @@ private fun InfoCard(systemInfo: SystemInfo) {
510510
}
511511
)
512512

513-
InfoCardItem(
514-
icon = Icons.Outlined.Memory,
515-
label = stringResource(R.string.home_kernel),
516-
content = systemInfo.kernelVersion
517-
)
518-
519-
Spacer(Modifier.height(16.dp))
520513
InfoCardItem(
521514
icon = {
522515
Icon(
@@ -532,9 +525,9 @@ private fun InfoCard(systemInfo: SystemInfo) {
532525

533526
Spacer(Modifier.height(16.dp))
534527
InfoCardItem(
535-
icon = Icons.Outlined.Fingerprint,
536-
label = stringResource(R.string.home_fingerprint),
537-
content = systemInfo.fingerprint
528+
icon = Icons.Outlined.Memory,
529+
label = stringResource(R.string.home_kernel),
530+
content = systemInfo.kernelVersion
538531
)
539532

540533
Spacer(Modifier.height(16.dp))
@@ -550,6 +543,13 @@ private fun InfoCard(systemInfo: SystemInfo) {
550543
content = selinuxDisplay
551544
)
552545

546+
Spacer(Modifier.height(16.dp))
547+
InfoCardItem(
548+
icon = Icons.Outlined.Fingerprint,
549+
label = stringResource(R.string.home_fingerprint),
550+
content = systemInfo.fingerprint
551+
)
552+
553553
Spacer(Modifier.height(16.dp))
554554
val seccompDisplay = when (systemInfo.seccompStatus) {
555555
-1 -> stringResource(R.string.seccomp_status_not_supported)

manager/app/src/main/java/me/weishu/kernelsu/ui/screen/home/HomeMiuix.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -498,9 +498,8 @@ private fun InfoCard(systemInfo: SystemInfo) {
498498
.fillMaxWidth()
499499
.padding(16.dp)
500500
) {
501-
InfoText(title = stringResource(R.string.home_kernel), content = systemInfo.kernelVersion)
502501
InfoText(title = stringResource(R.string.home_manager_version), content = systemInfo.managerVersion)
503-
InfoText(title = stringResource(R.string.home_fingerprint), content = systemInfo.fingerprint)
502+
InfoText(title = stringResource(R.string.home_kernel), content = systemInfo.kernelVersion)
504503
val selinuxDisplay = when (systemInfo.selinuxStatus) {
505504
"Enforcing" -> stringResource(R.string.selinux_status_enforcing)
506505
"Permissive" -> stringResource(R.string.selinux_status_permissive)
@@ -511,6 +510,7 @@ private fun InfoCard(systemInfo: SystemInfo) {
511510
title = stringResource(R.string.home_selinux_status),
512511
content = selinuxDisplay,
513512
)
513+
InfoText(title = stringResource(R.string.home_fingerprint), content = systemInfo.fingerprint)
514514
val seccompDisplay = when (systemInfo.seccompStatus) {
515515
-1 -> stringResource(R.string.seccomp_status_not_supported)
516516
0 -> stringResource(R.string.seccomp_status_disabled)

0 commit comments

Comments
 (0)