diff --git a/.github/workflows/default.yml b/.github/workflows/default.yml
new file mode 100644
index 0000000..eb23066
--- /dev/null
+++ b/.github/workflows/default.yml
@@ -0,0 +1,65 @@
+name: default
+
+on:
+ push:
+ pull_request:
+
+jobs:
+ lint:
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v3
+ - name: install ktlint
+ run: |
+ curl -sSLO https://github.com/pinterest/ktlint/releases/download/0.48.2/ktlint && chmod a+x ktlint && sudo mv ktlint /usr/local/bin/
+ - name: run ktlint
+ run: |
+ ktlint --reporter=checkstyle,output=build/ktlint-report.xml
+ continue-on-error: true
+ - uses: yutailang0119/action-ktlint@v3
+ with:
+ report-path: build/*.xml # Support glob patterns by https://www.npmjs.com/package/@actions/glob
+ continue-on-error: false # If annotations contain error of severity, action-ktlint exit 1.
+ release:
+ needs: [lint]
+ if: github.event_name == 'push' && contains(github.ref, 'refs/tags/')
+ runs-on: ubuntu-latest
+ permissions:
+ contents: write
+ steps:
+ - uses: actions/checkout@v3
+ - name: Set up OpenJDK 17
+ uses: actions/setup-java@v3
+ with:
+ distribution: "zulu"
+ java-version: "17"
+ - name: Setup Android SDK
+ uses: android-actions/setup-android@v2
+ - name: Install required platform
+ run: sdkmanager "platforms;android-33" "build-tools;33.0.2"
+ - name: Replace android.jar
+ run: |
+ curl -L https://github.com/Reginer/aosp-android-jar/raw/main/android-33/android.jar > /usr/local/lib/android/sdk/platforms/android-33/android.jar
+ - run: |
+ ls $ANDROID_SDK_ROOT
+ ls $ANDROID_SDK_ROOT/build-tools
+ ls $ANDROID_SDK_ROOT/build-tools/33.0.2
+ - name: Build release APK
+ run: ./gradlew assembleRelease
+ - name: Save keystore as file
+ run: echo "${KEYSTORE_B64}" | base64 -d > keystore.jks
+ env:
+ KEYSTORE_B64: ${{ secrets.KEYSTORE_B64 }}
+ - name: align APK with zipalign
+ run: $ANDROID_SDK_ROOT/build-tools/33.0.2/zipalign -v -p 4 app/build/outputs/apk/release/app-release-unsigned.apk app-release-unsigned-aligned.apk
+ - name: Sign APK
+ run: echo "${KEY_PASSWORD}" | $ANDROID_SDK_ROOT/build-tools/33.0.2/apksigner sign --ks keystore.jks --ks-key-alias "${KEY_ALIAS}" --key-pass "env:KEY_PASSWORD" --out dev.bluehouse.enablevolte.apk app-release-unsigned-aligned.apk
+ env:
+ KEY_ALIAS: ${{ secrets.KEY_ALIAS }}
+ KEY_PASSWORD: ${{ secrets.KEY_PASSWORD }}
+ - name: Release to GitHub
+ uses: softprops/action-gh-release@v1
+ with:
+ name: "v${{ github.ref }}"
+ generate_release_notes: true
+ files: dev.bluehouse.enablevolte.apk
diff --git a/.idea/codeStyles/Project.xml b/.idea/codeStyles/Project.xml
new file mode 100644
index 0000000..4bec4ea
--- /dev/null
+++ b/.idea/codeStyles/Project.xml
@@ -0,0 +1,117 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+ xmlns:android
+
+ ^$
+
+
+
+
+
+
+
+
+ xmlns:.*
+
+ ^$
+
+
+ BY_NAME
+
+
+
+
+
+
+ .*:id
+
+ http://schemas.android.com/apk/res/android
+
+
+
+
+
+
+
+
+ .*:name
+
+ http://schemas.android.com/apk/res/android
+
+
+
+
+
+
+
+
+ name
+
+ ^$
+
+
+
+
+
+
+
+
+ style
+
+ ^$
+
+
+
+
+
+
+
+
+ .*
+
+ ^$
+
+
+ BY_NAME
+
+
+
+
+
+
+ .*
+
+ http://schemas.android.com/apk/res/android
+
+
+ ANDROID_ATTRIBUTE_ORDER
+
+
+
+
+
+
+ .*
+
+ .*
+
+
+ BY_NAME
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/codeStyles/codeStyleConfig.xml b/.idea/codeStyles/codeStyleConfig.xml
new file mode 100644
index 0000000..a55e7a1
--- /dev/null
+++ b/.idea/codeStyles/codeStyleConfig.xml
@@ -0,0 +1,5 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/inspectionProfiles/Project_Default.xml b/.idea/inspectionProfiles/Project_Default.xml
new file mode 100644
index 0000000..103e00c
--- /dev/null
+++ b/.idea/inspectionProfiles/Project_Default.xml
@@ -0,0 +1,32 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/java/dev/bluehouse/enablevolte/Utils.kt b/app/src/main/java/dev/bluehouse/enablevolte/Utils.kt
index 4ea8ddd..1477687 100644
--- a/app/src/main/java/dev/bluehouse/enablevolte/Utils.kt
+++ b/app/src/main/java/dev/bluehouse/enablevolte/Utils.kt
@@ -26,17 +26,17 @@ fun getLatestAppVersion(handler: (String) -> Unit) {
.httpGet()
.header("X-GitHub-Api-Version", "2022-11-28")
.responseJson { _, _, result ->
- when (result) {
- is Result.Failure -> {
- handler("0.0.0")
- }
- is Result.Success -> {
- try {
- handler(result.get().array().getJSONObject(0).getString("tag_name"))
- } catch (e: java.lang.Exception) {
+ when (result) {
+ is Result.Failure -> {
handler("0.0.0")
}
+ is Result.Success -> {
+ try {
+ handler(result.get().array().getJSONObject(0).getString("tag_name"))
+ } catch (e: java.lang.Exception) {
+ handler("0.0.0")
+ }
+ }
}
}
- }
-}
\ No newline at end of file
+}