Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .env
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
ENVIRONMENT=qa
ENVIRONMENT=production
ANDROID_FIREBASE_CONFIG=ewogICJwcm9qZWN0X2luZm8iOiB7CiAgICAicHJvamVjdF9udW1iZXIiOiAiMzYzNTM0MTMzMDk1IiwKICAgICJwcm9qZWN0X2lkIjogInNjaG9vbHBpbG90LWRldmVsb3BtZW50IiwKICAgICJzdG9yYWdlX2J1Y2tldCI6ICJzY2hvb2xwaWxvdC1kZXZlbG9wbWVudC5hcHBzcG90LmNvbSIKICB9LAogICJjbGllbnQiOiBbCiAgICB7CiAgICAgICJjbGllbnRfaW5mbyI6IHsKICAgICAgICAibW9iaWxlc2RrX2FwcF9pZCI6ICIxOjM2MzUzNDEzMzA5NTphbmRyb2lkOjUzYTYwODI2NjZkMzc4MmM5MzMxYzIiLAogICAgICAgICJhbmRyb2lkX2NsaWVudF9pbmZvIjogewogICAgICAgICAgInBhY2thZ2VfbmFtZSI6ICJvbmxpbmUuYmluYXJhcHBzIgogICAgICAgIH0KICAgICAgfSwKICAgICAgIm9hdXRoX2NsaWVudCI6IFsKICAgICAgICB7CiAgICAgICAgICAiY2xpZW50X2lkIjogIjM2MzUzNDEzMzA5NS0zZGdvMmRnNnI0bzNmdDkyMHA0dTRtaGIwdG1vM25sbS5hcHBzLmdvb2dsZXVzZXJjb250ZW50LmNvbSIsCiAgICAgICAgICAiY2xpZW50X3R5cGUiOiAzCiAgICAgICAgfQogICAgICBdLAogICAgICAiYXBpX2tleSI6IFsKICAgICAgICB7CiAgICAgICAgICAiY3VycmVudF9rZXkiOiAiQUl6YVN5QUFjM2VvUTF4Z1RxSHNfZmdTSHZzSGlYeG5QdndoNVg4IgogICAgICAgIH0KICAgICAgXSwKICAgICAgInNlcnZpY2VzIjogewogICAgICAgICJhcHBpbnZpdGVfc2VydmljZSI6IHsKICAgICAgICAgICJvdGhlcl9wbGF0Zm9ybV9vYXV0aF9jbGllbnQiOiBbCiAgICAgICAgICAgIHsKICAgICAgICAgICAgICAiY2xpZW50X2lkIjogIjM2MzUzNDEzMzA5NS0zZGdvMmRnNnI0bzNmdDkyMHA0dTRtaGIwdG1vM25sbS5hcHBzLmdvb2dsZXVzZXJjb250ZW50LmNvbSIsCiAgICAgICAgICAgICAgImNsaWVudF90eXBlIjogMwogICAgICAgICAgICB9LAogICAgICAgICAgICB7CiAgICAgICAgICAgICAgImNsaWVudF9pZCI6ICIzNjM1MzQxMzMwOTUtYm1maG9tM2NrMjdpdWRyZmJnMnI3MWNlZTUwMDc4bTIuYXBwcy5nb29nbGV1c2VyY29udGVudC5jb20iLAogICAgICAgICAgICAgICJjbGllbnRfdHlwZSI6IDIsCiAgICAgICAgICAgICAgImlvc19pbmZvIjogewogICAgICAgICAgICAgICAgImJ1bmRsZV9pZCI6ICJvbmxpbmUuYmluYXJhcHBzIgogICAgICAgICAgICAgIH0KICAgICAgICAgICAgfQogICAgICAgICAgXQogICAgICAgIH0KICAgICAgfQogICAgfQogIF0sCiAgImNvbmZpZ3VyYXRpb25fdmVyc2lvbiI6ICIxIgp9
IOS_FIREBASE_CONFIG=PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPCFET0NUWVBFIHBsaXN0IFBVQkxJQyAiLS8vQXBwbGUvL0RURCBQTElTVCAxLjAvL0VOIiAiaHR0cDovL3d3dy5hcHBsZS5jb20vRFREcy9Qcm9wZXJ0eUxpc3QtMS4wLmR0ZCI+CjxwbGlzdCB2ZXJzaW9uPSIxLjAiPgo8ZGljdD4KCTxrZXk+Q0xJRU5UX0lEPC9rZXk+Cgk8c3RyaW5nPjM2MzUzNDEzMzA5NS1ibWZob20zY2syN2l1ZHJmYmcycjcxY2VlNTAwNzhtMi5hcHBzLmdvb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RyaW5nPjE6MzYzNTM0MTMzMDk1OmlvczpiZDM2N2E3ZDExMTQxYTIwOTMzMWMyPC9zdHJpbmc+CjwvZGljdD4KPC9wbGlzdD4=
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,6 @@ dist/
# native files
/android
/ios

google-services.json
GoogleService-Info.plist
4 changes: 2 additions & 2 deletions app.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ const faviconPath = './assets/icons/web/favicon-'

// APP_CONFIG_START
export const APP_CONFIG = {
androidPackageName: 'your_android_package_name', // CONFIG: Add your android package name here
androidPackageName: 'online.binarapps', // CONFIG: Add your android package name here
appName: 'Template', // CONFIG: Add your app name here
easProjectId: 'ac562c27-4a4e-4532-869f-fe6f9447bee6', // CONFIG: Add your eas project ID here
iosBundleIdentifier: 'your.ios.bundle.identifier', // CONFIG: Add your ios bundle identifier here
iosBundleIdentifier: 'online.binarapps', // CONFIG: Add your ios bundle identifier here
scheme: 'yourUrlScheme', // CONFIG: Add your url scheme to link to your app
adaptiveIconBackgroundColor: '#2E7AF0CC', // CONFIG: Add your android adaptive icon background color here
} as const
Expand Down
24 changes: 19 additions & 5 deletions app.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,19 @@
{
"expo": {
"android": {
"jsEngine": "hermes"
"jsEngine": "hermes",
"versionCode": 10,
"softwareKeyboardLayoutMode": "pan",
"googleServicesFile": "./google-services.json"
},
"assetBundlePatterns": ["**/*"],
"assetBundlePatterns": [
"**/*"
],
"ios": {
"jsEngine": "hermes",
"supportsTablet": true
"buildNumber": "10",
"supportsTablet": true,
"googleServicesFile": "./GoogleService-Info.plist"
},
"name": "Template",
"orientation": "portrait",
Expand All @@ -22,9 +29,16 @@
},
"userInterfaceStyle": "automatic",
"version": "2.1.0",
"plugins": ["expo-font", "expo-localization", "expo-secure-store", "expo-router"],
"plugins": [
"@react-native-google-signin/google-signin",
"expo-font",
"expo-localization",
"expo-secure-store",
"expo-router",
"./plugin/withDebugKeystore.js"
],
"web": {
"bundler": "metro"
}
}
}
}
16 changes: 11 additions & 5 deletions eas.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@
},
"channel": "production",
"distribution": "store",
"ios": { "autoIncrement": "buildNumber" }
"ios": {
"autoIncrement": "buildNumber"
}
},
"staging": {
"android": {
Expand All @@ -16,7 +18,9 @@
},
"channel": "staging",
"distribution": "store",
"ios": { "autoIncrement": "buildNumber" }
"ios": {
"autoIncrement": "buildNumber"
}
},
"qa": {
"android": {
Expand All @@ -25,11 +29,13 @@
},
"channel": "qa",
"distribution": "store",
"ios": { "autoIncrement": "buildNumber" }
"ios": {
"autoIncrement": "buildNumber"
}
}
},
"cli": {
"appVersionSource": "remote",
"appVersionSource": "local",
"version": ">= 0.53.1"
},
// CONFIG: Add submitting to store logic - more info (https://docs.expo.dev/submit/eas-json/)
Expand Down Expand Up @@ -57,4 +63,4 @@
"ios": {}
}
}
}
}
3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
"author": "BinarApps",
"license": "MIT",
"scripts": {
"eas-build-pre-install": "base64 --help && echo $ANDROID_FIREBASE_CONFIG | base64 --decode > google-services.json && cat google-services.json && echo $IOS_FIREBASE_CONFIG | base64 --decode > GoogleService-Info.plist && cat GoogleService-Info.plist",
"android:dev-client": "IS_DEV=1 npx expo run:android",
"android": "expo run:android",
"bootstrap:new_app": "yarn && node ./scripts/bootstrap.js",
Expand Down Expand Up @@ -51,6 +52,7 @@
"generate:env:qa": "scripts/generate_dotenv.sh qa",
"generate:env:staging": "scripts/generate_dotenv.sh staging",
"generate:icon:types": "node ./scripts/generate_icon_types.js",
"generate:google-services-config": "./scripts/generate_firebase_config.sh",
"generate:screen": "node ./scripts/create_new_screen.js && yarn eslint src --fix && yarn tsc",
"ios": "expo run:ios",
"lint": "eslint src && yarn tsc",
Expand Down Expand Up @@ -97,6 +99,7 @@
"@motify/skeleton": "^0.18.0",
"@react-native-async-storage/async-storage": "1.21.0",
"@react-native-community/netinfo": "11.1.0",
"@react-native-google-signin/google-signin": "^11.0.0",
"@react-navigation/bottom-tabs": "^6.5.11",
"@react-navigation/native": "^6.1.9",
"@react-navigation/native-stack": "^6.9.17",
Expand Down
47 changes: 47 additions & 0 deletions plugin/withDebugKeystore.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
/* eslint-disable @typescript-eslint/no-var-requires */
const { withAppBuildGradle } = require('@expo/config-plugins')
const fs = require('fs')

module.exports = function withDebugKeystore(mainConfig, props) {
const { storePassword, keyAlias, keyPassword } = props || {}
const appBuildGradle = withAppBuildGradle(mainConfig, async (config) => {
config.modResults.contents = config.modResults.contents.replace(
"storeFile file('debug.keystore')",
"storeFile file('debug.jks')"
)

if (storePassword) {
config.modResults.contents = config.modResults.contents.replace(
"storePassword 'android'",
`storePassword '2d4a995df1b18f0e16f1352eb227bee1'`
)
}

if (keyAlias) {
config.modResults.contents = config.modResults.contents.replace(
"keyAlias 'androiddebugkey'",
`keyAlias 'd163cbc4fe503964637c6dc4601a56ab'`
)
}

if (keyPassword) {
config.modResults.contents = config.modResults.contents.replace(
"keyPassword 'android'",
`keyPassword '9139334a6da1fcd2fdba63dfa74967f'`
)
}

return config
})

const exist = fs.existsSync('./android/app/')

// Plugins script is running couple of times so eventualy the file exist
// if there will be some issues with moving this file, please add this to package json sripts
// "eas-build-post-install": "mv agconnect-services.json android/app/agconnect-services.json",
if (exist) {
fs.copyFileSync('./debug.jks', './android/app/debug.jks')
}

return appBuildGradle
}
37 changes: 37 additions & 0 deletions scripts/generate_firebase_config.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
#!/bin/bash

# Program for signing to firebase app.

# Variables
# Global colors
normal=$'\e[0m' # (works better sometimes)
bold=$(tput bold) # make colors bold/bright
red="$bold$(tput setaf 1)" # bright red text
green=$(tput setaf 2) # dim green text
fawn=$(tput setaf 3); beige="$fawn" # dark yellow text
yellow="$bold$fawn" # bright yellow text
darkblue=$(tput setaf 4) # dim blue text
blue="$bold$darkblue" # bright blue text
purple=$(tput setaf 5); magenta="$purple" # magenta text
pink="$bold$purple" # bright magenta text
darkcyan=$(tput setaf 6) # dim cyan text
cyan="$bold$darkcyan" # bright cyan text
gray=$(tput setaf 7) # dim white text
darkgray="$bold"$(tput setaf 0) # bold black = dark gray text
white="$bold$gray"

set -o allexport
[[ -f .env ]] && source .env
set +o allexport

# FILE NAMES
androidConfig=google-services.json
iosConfig=GoogleService-Info.plist

cat .env
echo "${normal}[START] Saving google services files"
base64 --help
echo $ANDROID_FIREBASE_CONFIG | base64 -d > $androidConfig
echo $IOS_FIREBASE_CONFIG | base64 -d > $iosConfig

echo "${green}[SUCCESS] Saving google services json ${normal}"
5 changes: 5 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2796,6 +2796,11 @@
resolved "https://registry.yarnpkg.com/@react-native-community/netinfo/-/netinfo-11.1.0.tgz#b3b2ab741a5d935e445685ade8a53d48775e082b"
integrity sha512-pIbCuqgrY7SkngAcjUs9fMzNh1h4soQMVw1IeGp1HN5//wox3fUVOuvyIubTscUbdLFKiltJAiuQek7Nhx1bqA==

"@react-native-google-signin/google-signin@^11.0.0":
version "11.0.0"
resolved "https://registry.yarnpkg.com/@react-native-google-signin/google-signin/-/google-signin-11.0.0.tgz#b1732cf61758f8c6554adefd8cdc9a9f640df9b1"
integrity sha512-J8BFFGr5HcEWE2gRaVSJ0rQN8ztxYIr2wdWMG4PS1vhQZJqUzmRr6vpu12O1GppItq8ai7AA0rl/ja7hSytSXA==

"@react-native/assets-registry@0.73.1", "@react-native/assets-registry@~0.73.1":
version "0.73.1"
resolved "https://registry.yarnpkg.com/@react-native/assets-registry/-/assets-registry-0.73.1.tgz#e2a6b73b16c183a270f338dc69c36039b3946e85"
Expand Down