diff --git a/.github/workflows/firebase-deploy.yml b/.github/workflows/firebase-deploy.yml new file mode 100644 index 0000000..707f654 --- /dev/null +++ b/.github/workflows/firebase-deploy.yml @@ -0,0 +1,39 @@ +name: πŸ”₯ Deploy to Firebase App Distribution + +on: + push: + branches: + - release # Only in release branch + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + path: android + - name: Setup JDK + uses: actions/setup-java@v3 + with: + distribution: 'oracle' + java-version: '17' + - name: Generate Keystore + env: + KEYSTORE_B64: ${{ secrets.APP_KEYSTORE }} + run: | + echo $KEYSTORE_B64 > keystore_b64.txt + base64 -d keystore_b64.txt > keystore.jks + + - name: Build Release APK + env: + SIGNING_KEY_ALIAS: ${{ secrets.KEY_ALIAS }} + SIGNING_PASSWORD: ${{ secrets.KEY_PASSWORD }} + run: ./gradlew assembleRelease + + - name: Upload to Firebase App Distribution + uses: wzieba/Firebase-Distribution-Github-Action@v1 + with: + appId: ${{ secrets.FIREBASE_APP_ID }} + serviceCredentialsFileContent: ${{ secrets.CREDENTIAL_FILE_CONTENT }} + groups: testers + file: app/release/app-release.apk diff --git a/.github/workflows/ktlint.yml b/.github/workflows/ktlint.yml new file mode 100644 index 0000000..4dd1b5b --- /dev/null +++ b/.github/workflows/ktlint.yml @@ -0,0 +1,19 @@ +name: reviewdog_kotlin +on: + pull_request: + paths: + - android/** + +jobs: + ktlint: + name: Check Kotlin Format + runs-on: ubuntu-latest + + steps: + - name: Clone repo + uses: actions/checkout@v4 + - name: ktlint + uses: ScaCap/action-ktlint@master + with: + github_token: ${{ secrets.github_token }} + reporter: github-pr-review diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..5a73fbc --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +# MacOS +.DS_Store diff --git a/android/.editorconfig b/android/.editorconfig new file mode 100644 index 0000000..1aa5fa1 --- /dev/null +++ b/android/.editorconfig @@ -0,0 +1,18 @@ +[*.{kt,kts}] +end_of_line = lf +ij_kotlin_allow_trailing_comma = false +ij_kotlin_allow_trailing_comma_on_call_site = false +ij_kotlin_imports_layout = * +ij_kotlin_packages_to_use_import_on_demand = java.util.*,kotlinx.android.synthetic.** +indent_size = 4 +indent_style = space +insert_final_newline = true +ktlint_chain_method_rule_force_multiline_when_chain_operator_count_greater_or_equal_than = unset +ktlint_class_signature_rule_force_multiline_when_parameter_count_greater_or_equal_than = unset +ktlint_code_style = android_studio +ktlint_function_naming_ignore_when_annotated_with = [unset] +ktlint_function_signature_body_expression_wrapping = default +ktlint_function_signature_rule_force_multiline_when_parameter_count_greater_or_equal_than = unset +ktlint_ignore_back_ticked_identifier = false +max_line_length = off + diff --git a/android/.gitignore b/android/.gitignore index aa724b7..f01e7c6 100644 --- a/android/.gitignore +++ b/android/.gitignore @@ -13,3 +13,9 @@ .externalNativeBuild .cxx local.properties + +# Keystore +*.jks + +# Release +/app/release \ No newline at end of file diff --git a/android/.idea/.name b/android/.idea/.name new file mode 100644 index 0000000..727cd1e --- /dev/null +++ b/android/.idea/.name @@ -0,0 +1 @@ +PriceGuard \ No newline at end of file diff --git a/android/.idea/gradle.xml b/android/.idea/gradle.xml index de8896e..ae388c2 100644 --- a/android/.idea/gradle.xml +++ b/android/.idea/gradle.xml @@ -1,5 +1,6 @@ + diff --git a/android/.idea/misc.xml b/android/.idea/misc.xml index 9f71c83..8978d23 100644 --- a/android/.idea/misc.xml +++ b/android/.idea/misc.xml @@ -1,7 +1,6 @@ - - + diff --git a/android/app/build.gradle b/android/app/build.gradle index 592e61d..7029044 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -24,6 +24,16 @@ android { proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' } } + + signingConfigs { + release { + storeFile file("keystore.jks") + storePassword System.getenv("SIGNING_PASSWORD") + keyAlias System.getenv("SIGNING_KEY_ALIAS") + keyPassword System.getenv("SIGNING_PASSWORD") + } + } + compileOptions { sourceCompatibility JavaVersion.VERSION_1_8 targetCompatibility JavaVersion.VERSION_1_8 diff --git a/android/app/src/androidTest/java/app/priceguard/ExampleInstrumentedTest.kt b/android/app/src/androidTest/java/app/priceguard/ExampleInstrumentedTest.kt deleted file mode 100644 index 7c2adbc..0000000 --- a/android/app/src/androidTest/java/app/priceguard/ExampleInstrumentedTest.kt +++ /dev/null @@ -1,24 +0,0 @@ -package app.priceguard - -import androidx.test.platform.app.InstrumentationRegistry -import androidx.test.ext.junit.runners.AndroidJUnit4 - -import org.junit.Test -import org.junit.runner.RunWith - -import org.junit.Assert.* - -/** - * Instrumented test, which will execute on an Android device. - * - * See [testing documentation](http://d.android.com/tools/testing). - */ -@RunWith(AndroidJUnit4::class) -class ExampleInstrumentedTest { - @Test - fun useAppContext() { - // Context of the app under test. - val appContext = InstrumentationRegistry.getInstrumentation().targetContext - assertEquals("app.priceguard", appContext.packageName) - } -} \ No newline at end of file diff --git a/android/app/src/main/AndroidManifest.xml b/android/app/src/main/AndroidManifest.xml index b32c3a8..61ce3a9 100644 --- a/android/app/src/main/AndroidManifest.xml +++ b/android/app/src/main/AndroidManifest.xml @@ -6,9 +6,9 @@ android:allowBackup="true" android:dataExtractionRules="@xml/data_extraction_rules" android:fullBackupContent="@xml/backup_rules" - android:icon="@mipmap/ic_launcher" + android:icon="@mipmap/ic_priceguard" android:label="@string/app_name" - android:roundIcon="@mipmap/ic_launcher_round" + android:roundIcon="@mipmap/ic_priceguard_round" android:supportsRtl="true" android:theme="@style/Theme.PriceGuard" tools:targetApi="31"> diff --git a/android/app/src/main/ic_priceguard-playstore.png b/android/app/src/main/ic_priceguard-playstore.png new file mode 100644 index 0000000..29a1d51 Binary files /dev/null and b/android/app/src/main/ic_priceguard-playstore.png differ diff --git a/android/app/src/main/res/drawable-v24/ic_launcher_foreground.xml b/android/app/src/main/res/drawable-v24/ic_launcher_foreground.xml deleted file mode 100644 index 2b068d1..0000000 --- a/android/app/src/main/res/drawable-v24/ic_launcher_foreground.xml +++ /dev/null @@ -1,30 +0,0 @@ - - - - - - - - - - - \ No newline at end of file diff --git a/android/app/src/main/res/drawable/ic_back.xml b/android/app/src/main/res/drawable/ic_back.xml new file mode 100644 index 0000000..8452791 --- /dev/null +++ b/android/app/src/main/res/drawable/ic_back.xml @@ -0,0 +1,5 @@ + + + diff --git a/android/app/src/main/res/drawable/ic_launcher_background.xml b/android/app/src/main/res/drawable/ic_launcher_background.xml deleted file mode 100644 index 07d5da9..0000000 --- a/android/app/src/main/res/drawable/ic_launcher_background.xml +++ /dev/null @@ -1,170 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/android/app/src/main/res/drawable/ic_priceguard_foreground.xml b/android/app/src/main/res/drawable/ic_priceguard_foreground.xml new file mode 100644 index 0000000..11ded69 --- /dev/null +++ b/android/app/src/main/res/drawable/ic_priceguard_foreground.xml @@ -0,0 +1,23 @@ + + + + + + + \ No newline at end of file diff --git a/android/app/src/main/res/layout/activity_intro.xml b/android/app/src/main/res/layout/activity_intro.xml new file mode 100644 index 0000000..665c488 --- /dev/null +++ b/android/app/src/main/res/layout/activity_intro.xml @@ -0,0 +1,63 @@ + + + + + + + + + + + +