aboutsummaryrefslogtreecommitdiffstats
path: root/android/app/build.gradle
blob: 532db83b3d78bb62e8654e5e0340c8b725fc8d7c (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
apply plugin: 'com.android.application'

def keystoreProps = new Properties()
def keystoreFile = rootProject.file('keystore.properties')
if (keystoreFile.exists()) keystoreProps.load(new FileInputStream(keystoreFile))

android {
  namespace 'io.coinos.app'
  compileSdk 35
  defaultConfig {
    applicationId 'io.coinos.app'
    minSdk 24
    targetSdk 35
    versionCode 7
    versionName '1.6'
  }
  // Two builds of the same wallet.
  //
  //  twa      — Chrome renders the site (the better browser, and the one
  //             people already have installed). Its storage is Chrome's, so
  //             nothing outside Chrome can wake the wallet, and on a phone
  //             without Google Play Services nothing inside it can either.
  //  webview  — the wallet runs in the app, so a UnifiedPush message can
  //             start it off-screen and let it answer. A separate app id,
  //             because it is a separate wallet: its storage is its own.
  flavorDimensions += 'shell'
  productFlavors {
    twa {
      dimension 'shell'
      isDefault = true
    }
    webview {
      dimension 'shell'
      applicationId 'io.coinos.webview'
      versionNameSuffix '-webview'
      resValue 'string', 'app_name', 'Coinos (UnifiedPush)'
    }
  }
  signingConfigs {
    release {
      if (keystoreFile.exists()) {
        storeFile rootProject.file(keystoreProps['storeFile'])
        storePassword keystoreProps['storePassword']
        keyAlias keystoreProps['keyAlias']
        keyPassword keystoreProps['keyPassword']
      }
    }
  }
  buildTypes {
    release {
      minifyEnabled false
      if (keystoreFile.exists()) signingConfig signingConfigs.release
    }
  }
}
dependencies {
  // only the TWA shell needs Chrome's helper; the WebView build carries none
  twaImplementation 'com.google.androidbrowserhelper:androidbrowserhelper:2.5.0'
}