From cd10c54f3976bd4835b20649cd55e0881e1ced9c Mon Sep 17 00:00:00 2001 From: iSmartCoding Date: Tue, 5 Dec 2023 22:33:26 +0800 Subject: [PATCH] Add build apk workflow --- .github/workflows/generate-apk-release.yml | 36 ++++++++++++++++++ .gitignore | 4 +- app/build.gradle.kts | 2 +- app/free/release/output-metadata.json | 20 ---------- app/release.jks | Bin 0 -> 2727 bytes .../services/NotificationListenerService.kt | 5 ++- build-apk.sh | 33 ++++++++++++++++ 7 files changed, 76 insertions(+), 24 deletions(-) create mode 100644 .github/workflows/generate-apk-release.yml delete mode 100644 app/free/release/output-metadata.json create mode 100644 app/release.jks create mode 100644 build-apk.sh diff --git a/.github/workflows/generate-apk-release.yml b/.github/workflows/generate-apk-release.yml new file mode 100644 index 00000000..d57003b9 --- /dev/null +++ b/.github/workflows/generate-apk-release.yml @@ -0,0 +1,36 @@ +name: Generated APK + +on: + workflow_dispatch: + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + + - name: Set Up JDK + uses: actions/setup-java@v4 + with: + distribution: 'zulu' # See 'Supported distributions' for available options + java-version: '17' + cache: 'gradle' + + - name: Change wrapper permissions + run: chmod +x ./gradlew + + # Create APK Release + - name: Build apk + run: | + ANDROID_STORE_PASSWORD=${{ secrets.ANDROID_STORE_PASSWORD }} + ANDROID_KEY_PASSWORD=${{ secrets.ANDROID_KEY_PASSWORD }} + bash build-apk.sh + + # Upload Artifact Build + - name: Upload APK + uses: actions/upload-artifact@v3 + with: + name: plain-app + path: /app/build/outputs/apk/free/release/app/ diff --git a/.gitignore b/.gitignore index 710e7d09..bbe97b1a 100644 --- a/.gitignore +++ b/.gitignore @@ -24,7 +24,7 @@ build/ # Local configuration file (sdk path, etc) local.properties keystore.properties -release.jks +# release.jks # Proguard folder generated by Eclipse proguard/ @@ -80,4 +80,4 @@ lint/tmp/ *.hprof .DS_Store -/app/release/output-metadata.json +output-metadata.json diff --git a/app/build.gradle.kts b/app/build.gradle.kts index 3e83e817..6191c482 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -78,7 +78,7 @@ android { debugSymbolLevel = "SYMBOL_TABLE" } configure { - mappingFileUploadEnabled = true + mappingFileUploadEnabled = false } // setProguardFiles(listOf(getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro")) } diff --git a/app/free/release/output-metadata.json b/app/free/release/output-metadata.json deleted file mode 100644 index 196b5ea9..00000000 --- a/app/free/release/output-metadata.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "version": 3, - "artifactType": { - "type": "APK", - "kind": "Directory" - }, - "applicationId": "com.ismartcoding.plain", - "variantName": "freeRelease", - "elements": [ - { - "type": "SINGLE", - "filters": [], - "attributes": [], - "versionCode": 175, - "versionName": "1.2.14", - "outputFile": "app-free-release.apk" - } - ], - "elementType": "File" -} \ No newline at end of file diff --git a/app/release.jks b/app/release.jks new file mode 100644 index 0000000000000000000000000000000000000000..6d0a2178002695ef4d43b4f3833f4c720fda11c6 GIT binary patch literal 2727 zcma)+c{CJ^8pda5#x_c}WGmTgreVxv%WjCu*s>)Fp&3hquNpBJTYQ$WRF**!MV65% zDNC|%Ar&QSmI}!}#_gPYPv5zJ-TTLT-t+#R_j&$&P&7ml2na^e5H2vd3f-K(Apqn7 zGHD1a2n|8_jZIKA=;QyApt%ql^v-Xb@q1EXeE)IrBY+?#4SMP~)IoXuaX^R;O*E0wSf?pa}$0M1p{_D1I34zY{@lC;)W`26v~M122Oi zKotlQu}7&{xl-k6{rE+%1r6x}p+Wj3T3Zx(mMe47>V(OhgUe^w<0(^NTi+d%p~;=< z{Ive&dA5sPXg~EY1?SinU(V0&s3QFb7ob9KKOGrpwLYZaTK1-XWAkUf<)Q5aL7F<& z_TZqKi{e`yFkIV4p17bEaaU&r*CvyADZ(LDrD{|;D0o0R>H^Ioav?U*K80L4(JAi1 zYxJ>U2mHCVEhZn`9(!#nSO4mRqztdTnn#$S)2fV$IoJA(x0PeZ4yazu(Ml@S113C@ z-^`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CV_qxpSX!F~7$8U)bJWT+G+3Z2n|s(R2|W<7o$FzO(eIn>C8uGW_IRfbG* zf_QnMMf^HC8fJ? z&#Jun%S~?hw&vT&So#mO1H@rB&x@;j#l&I9YNr3anL3=1`z zVxMe^@{usC<(J07P$FGd16PiG*ed=0rC2#=veDU>5QMm=))A^aVCWcP)!*-dw8MDv z&52Lrkc7t_TB_9Dg8Uorc4|yVBb54X>lNMSdCDZ{l594zBF%8#w6(R(mW{-XP@#Av*29=T!?-W(|i0Rx!yE$1uw=w?0%*9+{8St8*N{p zT`d^**=E!_1Xt!G78V14+p2H&&hfR#vQfPb;UlMJ7+e`E-U*rHxQbnF$}1R&4m?pA zV$zNL@iyd|NyzxTi(zm_&ilZpRWcU(%dGtPqx@mUa^;q~bxo|f|48Auo%rT{aNry*Awi+a#E==X( z=P~5{#p(Q0gI|@0iotPC3?KaH2b0%{MV+s8eSMh{ZY;oy-C&`DSzm^D65|`!Ib3zc zAEk$qL&0HCRY5RF5(lAtD0fCGol%@a7Vl37nV~ OI7wB8kwIV}o%t_o+T@J@ literal 0 HcmV?d00001 diff --git a/app/src/main/java/com/ismartcoding/plain/services/NotificationListenerService.kt b/app/src/main/java/com/ismartcoding/plain/services/NotificationListenerService.kt index 35271ec1..66a77146 100644 --- a/app/src/main/java/com/ismartcoding/plain/services/NotificationListenerService.kt +++ b/app/src/main/java/com/ismartcoding/plain/services/NotificationListenerService.kt @@ -28,7 +28,10 @@ class NotificationListenerService : NotificationListenerService() { private fun isValidNotification(statusBarNotification: StatusBarNotification): Boolean { val notification = statusBarNotification.notification - if (notification.flags and Notification.FLAG_FOREGROUND_SERVICE != 0 || notification.flags and Notification.FLAG_ONGOING_EVENT != 0 || notification.flags and Notification.FLAG_LOCAL_ONLY != 0 || notification.flags and NotificationCompat.FLAG_GROUP_SUMMARY != 0 //The notification that groups other notifications + if (notification.flags and Notification.FLAG_FOREGROUND_SERVICE != 0 + || notification.flags and Notification.FLAG_ONGOING_EVENT != 0 + || notification.flags and Notification.FLAG_LOCAL_ONLY != 0 + || notification.flags and NotificationCompat.FLAG_GROUP_SUMMARY != 0 //The notification that groups other notifications ) { //This is not a notification we want! return false diff --git a/build-apk.sh b/build-apk.sh new file mode 100644 index 00000000..4ab0a9a2 --- /dev/null +++ b/build-apk.sh @@ -0,0 +1,33 @@ +#!/bin/bash + +function err_and_exit() +{ + echo "$1" >&2 + exit 1 +} + +function getVersionName() +{ + echo $(grep versionName ./app/build.gradle.kts | awk -F '"' '{print $2}') +} + +cat > ./keystore.properties < ./local.properties <