Skip to content
This repository was archived by the owner on Nov 20, 2024. It is now read-only.

Commit 2e20783

Browse files
committed
Updated android configs
1 parent 18c8507 commit 2e20783

File tree

3 files changed

+30
-10
lines changed

3 files changed

+30
-10
lines changed

android/app/build.gradle

+23-5
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,18 @@ def enableProguardInReleaseBuilds = (findProperty('android.enableProguardInRelea
8080
*/
8181
def jscFlavor = 'org.webkit:android-jsc:+'
8282

83+
def devStore = new Properties()
84+
def devStoreFile = rootProject.file('dev.properties')
85+
if (devStoreFile.exists()) {
86+
devStore.load(new FileInputStream(devStoreFile))
87+
}
88+
89+
def prodStore = new Properties()
90+
def prodStoreFile = rootProject.file('prod.properties')
91+
if (prodStoreFile.exists()) {
92+
prodStore.load(new FileInputStream(prodStoreFile))
93+
}
94+
8395
android {
8496
ndkVersion rootProject.ext.ndkVersion
8597

@@ -96,10 +108,16 @@ android {
96108
}
97109
signingConfigs {
98110
debug {
99-
storeFile file('debug.keystore')
100-
storePassword 'android'
101-
keyAlias 'androiddebugkey'
102-
keyPassword 'android'
111+
keyAlias devStore['keyAlias']
112+
keyPassword devStore['keyPassword']
113+
storeFile file(devStore['storeFile'])
114+
storePassword devStore['storePassword']
115+
}
116+
release {
117+
keyAlias prodStore['keyAlias']
118+
keyPassword prodStore['keyPassword']
119+
storeFile file(prodStore['storeFile'])
120+
storePassword prodStore['storePassword']
103121
}
104122
}
105123
buildTypes {
@@ -109,7 +127,7 @@ android {
109127
release {
110128
// Caution! In production, you need to generate your own keystore file.
111129
// see https://reactnative.dev/docs/signed-apk-android.
112-
signingConfig signingConfigs.debug
130+
signingConfig signingConfigs.release
113131
shrinkResources (findProperty('android.enableShrinkResourcesInReleaseBuilds')?.toBoolean() ?: false)
114132
minifyEnabled enableProguardInReleaseBuilds
115133
proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"

package.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@
1010
"web": "expo start --web",
1111
"test": "jest --watchAll",
1212
"lint": "expo lint",
13-
"lint:fix": "expo lint --fix"
13+
"lint:fix": "expo lint --fix",
14+
"keys": "bun scripts/keys-n-stuff.ts"
1415
},
1516
"jest": {
1617
"preset": "jest-expo"

scripts/keys-n-stuff.ts

+5-4
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ async function copyFile(source: string, destination: string): Promise<void> {
2121
fs.copyFileSync(source, destination);
2222
console.log(`Successfully copied: ${destination}`);
2323
} catch (e) {
24+
2425
throw new Error(`Failed to copy ${source} to ${destination}: ${e}`);
2526
}
2627
}
@@ -62,11 +63,9 @@ async function main(): Promise<void> {
6263
console.log('Successfully pulled latest changes');
6364
} else {
6465
console.log('Cloning repository...');
65-
const { stderr: cloneError } = await execAsync(`git clone ${repo} ${keysDir}`);
66+
await execAsync(`git clone ${repo} ${keysDir}`);
6667

67-
if (cloneError) {
68-
throw new Error(`Failed to clone repository: ${cloneError}`);
69-
}
68+
7069
console.log('Successfully cloned repository');
7170
}
7271

@@ -124,6 +123,8 @@ async function main(): Promise<void> {
124123

125124
console.log('Setup completed successfully');
126125
} catch (e) {
126+
console.log(e);
127+
127128
console.error('Error:', e);
128129
process.exit(1);
129130
}

0 commit comments

Comments
 (0)