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

Commit

Permalink
Updated android configs
Browse files Browse the repository at this point in the history
  • Loading branch information
hmziqrs committed Nov 19, 2024
1 parent 18c8507 commit 2e20783
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 10 deletions.
28 changes: 23 additions & 5 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,18 @@ def enableProguardInReleaseBuilds = (findProperty('android.enableProguardInRelea
*/
def jscFlavor = 'org.webkit:android-jsc:+'

def devStore = new Properties()
def devStoreFile = rootProject.file('dev.properties')
if (devStoreFile.exists()) {
devStore.load(new FileInputStream(devStoreFile))
}

def prodStore = new Properties()
def prodStoreFile = rootProject.file('prod.properties')
if (prodStoreFile.exists()) {
prodStore.load(new FileInputStream(prodStoreFile))
}

android {
ndkVersion rootProject.ext.ndkVersion

Expand All @@ -96,10 +108,16 @@ android {
}
signingConfigs {
debug {
storeFile file('debug.keystore')
storePassword 'android'
keyAlias 'androiddebugkey'
keyPassword 'android'
keyAlias devStore['keyAlias']
keyPassword devStore['keyPassword']
storeFile file(devStore['storeFile'])
storePassword devStore['storePassword']
}
release {
keyAlias prodStore['keyAlias']
keyPassword prodStore['keyPassword']
storeFile file(prodStore['storeFile'])
storePassword prodStore['storePassword']
}
}
buildTypes {
Expand All @@ -109,7 +127,7 @@ android {
release {
// Caution! In production, you need to generate your own keystore file.
// see https://reactnative.dev/docs/signed-apk-android.
signingConfig signingConfigs.debug
signingConfig signingConfigs.release
shrinkResources (findProperty('android.enableShrinkResourcesInReleaseBuilds')?.toBoolean() ?: false)
minifyEnabled enableProguardInReleaseBuilds
proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
"web": "expo start --web",
"test": "jest --watchAll",
"lint": "expo lint",
"lint:fix": "expo lint --fix"
"lint:fix": "expo lint --fix",
"keys": "bun scripts/keys-n-stuff.ts"
},
"jest": {
"preset": "jest-expo"
Expand Down
9 changes: 5 additions & 4 deletions scripts/keys-n-stuff.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ async function copyFile(source: string, destination: string): Promise<void> {
fs.copyFileSync(source, destination);
console.log(`Successfully copied: ${destination}`);
} catch (e) {

throw new Error(`Failed to copy ${source} to ${destination}: ${e}`);
}
}
Expand Down Expand Up @@ -62,11 +63,9 @@ async function main(): Promise<void> {
console.log('Successfully pulled latest changes');
} else {
console.log('Cloning repository...');
const { stderr: cloneError } = await execAsync(`git clone ${repo} ${keysDir}`);
await execAsync(`git clone ${repo} ${keysDir}`);

if (cloneError) {
throw new Error(`Failed to clone repository: ${cloneError}`);
}

console.log('Successfully cloned repository');
}

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

console.log('Setup completed successfully');
} catch (e) {
console.log(e);

console.error('Error:', e);
process.exit(1);
}
Expand Down

0 comments on commit 2e20783

Please sign in to comment.