Fix debug key store (#645)

* remove production staging build flavours

* fix: support for debug keystore
This commit is contained in:
Yogesh Choudhary Paliyal
2023-07-30 13:28:21 +05:30
committed by GitHub
parent 83ab5d0255
commit d3614ccd68
45 changed files with 16 additions and 35 deletions

View File

@@ -25,7 +25,7 @@ jobs:
uses: ./.github/actions/setup
- name: Build APK ⚙️🛠
run: bash ./gradlew assembleStagingDebug
run: bash ./gradlew assembleDebug
- uses: "marvinpinto/action-automatic-releases@latest"
@@ -34,4 +34,4 @@ jobs:
automatic_release_tag: "latest-master"
prerelease: true
title: "Staging Build"
files: app/build/outputs/apk/staging/debug/*.apk
files: app/build/outputs/apk/debug/*.apk

View File

@@ -32,11 +32,11 @@ jobs:
run: ./gradlew test
- name: 🏗 Build APK
run: bash ./gradlew assembleProductionDebug
run: bash ./gradlew assembleDebug
- name: 🚀 Upload APK to Artifacts 📱
uses: actions/upload-artifact@v3
with:
name: app
path: app/build/outputs/apk/production/debug/*.apk
path: app/build/outputs/apk/debug/*.apk
retention-days: 3

View File

@@ -23,13 +23,13 @@ jobs:
- name: Build Release AAB
id: buildRelease
run: ./gradlew bundleProductionRelease
run: ./gradlew bundleRelease
- name: Sign AAB
id: sign
uses: r0adkll/sign-android-release@fix/bundle-signing
with:
releaseDirectory: app/build/outputs/bundle/productionRelease
releaseDirectory: app/build/outputs/bundle/release
signingKeyBase64: ${{ secrets.SIGNING_KEY }}
alias: ${{ secrets.ALIAS }}
keyStorePassword: ${{ secrets.KEY_STORE_PASSWORD }}
@@ -47,7 +47,7 @@ jobs:
with:
serviceAccountJson: service_account.json
packageName: com.yogeshpaliyal.keypass
releaseFiles: app/build/outputs/bundle/productionRelease/*.aab
releaseFiles: app/build/outputs/bundle/release/*.aab
track: production
userFraction: 0.01
status: inProgress

View File

@@ -25,6 +25,8 @@ android {
vectorDrawables {
useSupportLibrary = true
}
missingDimensionStrategy("buildTypes", "release")
}
buildTypes {
@@ -35,8 +37,8 @@ android {
}
debug {
productFlavors.findByName("production")?.signingConfig = signingConfigs.findByName("myDebugConfig")
productFlavors.findByName("staging")?.signingConfig = signingConfigs.findByName("myDebugConfig")
applicationIdSuffix = ".staging"
signingConfig = signingConfigs.getByName("debug")
}
}
@@ -59,20 +61,7 @@ android {
flavorDimensions("default")
productFlavors {
create("production") {
}
create("staging") {
applicationIdSuffix = ".staging"
signingConfig = signingConfigs.findByName("myDebugConfig")
}
}
sourceSets {
getByName("main") {
res.srcDirs("src/main/res", "src/staging/res")
}
}
composeOptions {
kotlinCompilerExtensionVersion = "1.4.4"
@@ -84,16 +73,8 @@ android {
}
namespace = appPackageId
/*sourceSets {
main {
res {
srcDirs 'src\\main\\res', 'src\\staging\\res', '..\\common\\src\\staging\\res'
}
}
}*/
signingConfigs {
create("myDebugConfig") {
getByName("debug") {
storeFile = file("../keystores/debug.keystore")
storePassword = "android"
keyAlias = "androiddebugkey"

View File

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 1.5 KiB

View File

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 1.5 KiB

View File

Before

Width:  |  Height:  |  Size: 2.7 KiB

After

Width:  |  Height:  |  Size: 2.7 KiB

View File

Before

Width:  |  Height:  |  Size: 1.0 KiB

After

Width:  |  Height:  |  Size: 1.0 KiB

View File

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

View File

Before

Width:  |  Height:  |  Size: 1.7 KiB

After

Width:  |  Height:  |  Size: 1.7 KiB

View File

Before

Width:  |  Height:  |  Size: 1.9 KiB

After

Width:  |  Height:  |  Size: 1.9 KiB

View File

Before

Width:  |  Height:  |  Size: 2.1 KiB

After

Width:  |  Height:  |  Size: 2.1 KiB

View File

Before

Width:  |  Height:  |  Size: 3.6 KiB

After

Width:  |  Height:  |  Size: 3.6 KiB

View File

Before

Width:  |  Height:  |  Size: 2.8 KiB

After

Width:  |  Height:  |  Size: 2.8 KiB

View File

Before

Width:  |  Height:  |  Size: 3.4 KiB

After

Width:  |  Height:  |  Size: 3.4 KiB

View File

Before

Width:  |  Height:  |  Size: 5.8 KiB

After

Width:  |  Height:  |  Size: 5.8 KiB

View File

Before

Width:  |  Height:  |  Size: 4.1 KiB

After

Width:  |  Height:  |  Size: 4.1 KiB

View File

Before

Width:  |  Height:  |  Size: 4.8 KiB

After

Width:  |  Height:  |  Size: 4.8 KiB

View File

Before

Width:  |  Height:  |  Size: 8.3 KiB

After

Width:  |  Height:  |  Size: 8.3 KiB

View File

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 1.5 KiB

View File

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 1.5 KiB

View File

Before

Width:  |  Height:  |  Size: 3.4 KiB

After

Width:  |  Height:  |  Size: 3.4 KiB

View File

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

View File

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

View File

Before

Width:  |  Height:  |  Size: 2.1 KiB

After

Width:  |  Height:  |  Size: 2.1 KiB

View File

Before

Width:  |  Height:  |  Size: 2.0 KiB

After

Width:  |  Height:  |  Size: 2.0 KiB

View File

Before

Width:  |  Height:  |  Size: 2.1 KiB

After

Width:  |  Height:  |  Size: 2.1 KiB

View File

Before

Width:  |  Height:  |  Size: 4.6 KiB

After

Width:  |  Height:  |  Size: 4.6 KiB

View File

Before

Width:  |  Height:  |  Size: 3.0 KiB

After

Width:  |  Height:  |  Size: 3.0 KiB

View File

Before

Width:  |  Height:  |  Size: 3.4 KiB

After

Width:  |  Height:  |  Size: 3.4 KiB

View File

Before

Width:  |  Height:  |  Size: 7.4 KiB

After

Width:  |  Height:  |  Size: 7.4 KiB

View File

Before

Width:  |  Height:  |  Size: 4.4 KiB

After

Width:  |  Height:  |  Size: 4.4 KiB

View File

Before

Width:  |  Height:  |  Size: 4.8 KiB

After

Width:  |  Height:  |  Size: 4.8 KiB

View File

Before

Width:  |  Height:  |  Size: 11 KiB

After

Width:  |  Height:  |  Size: 11 KiB

View File

@@ -32,7 +32,7 @@ fun getRandomString(sizeOfRandomString: Int): String {
suspend fun Context?.canUserAccessBackupDirectory(): Boolean {
if (this != null) {
val backupDirectoryUri = getUri(getUserSettings()?.backupDirectory)
val backupDirectoryUri = getUri(getUserSettings().backupDirectory)
if (backupDirectoryUri != null) {
val backupDirectory = DocumentFile.fromTreeUri(this, backupDirectoryUri)
val listOfConditions = arrayListOf<Boolean?>()

View File

@@ -113,7 +113,7 @@ const val BACKUP_KEY_LENGTH = 16
*/
suspend fun Context.getOrCreateBackupKey(reset: Boolean = false): Pair<Boolean, String> {
val userSettings = getUserSettings()
return if (userSettings?.backupKey != null && reset.not()) {
return if (userSettings.backupKey != null && reset.not()) {
Pair(false, userSettings.backupKey)
} else {
val randomKey = getRandomString(BACKUP_KEY_LENGTH)

View File

@@ -7,13 +7,13 @@ import com.yogeshpaliyal.common.data.UserSettings
class UserSettingsDataStore(val context: Context) {
private fun getSerializer(context: Context): Serializer<UserSettings> {
private fun getSerializer(): Serializer<UserSettings> {
return UserSettingsSerializer(CryptoManager())
}
private val Context.dataStoreSerializer by dataStore(
fileName = "user-settings.json",
serializer = getSerializer(context)
serializer = getSerializer()
)
fun getDataStore() = context.dataStoreSerializer