@@ -2,7 +2,17 @@ import type { PluginConfigType as BuildPropertiesConfig } from "expo-build-prope
22import type withCamera from "expo-camera/plugin/build/withCamera" ;
33import type { FontProps } from "expo-font/plugin/build/withFonts" ;
44
5- import { AndroidConfig , withAndroidManifest , withAppBuildGradle , type ConfigPlugin } from "expo/config-plugins" ;
5+ import {
6+ AndroidConfig ,
7+ IOSConfig ,
8+ withAndroidManifest ,
9+ withAppBuildGradle ,
10+ withDangerousMod ,
11+ withXcodeProject ,
12+ type ConfigPlugin ,
13+ } from "expo/config-plugins" ;
14+ import { copyFileSync , existsSync , mkdirSync , readFileSync , writeFileSync } from "node:fs" ;
15+ import path from "node:path" ;
616import { env } from "node:process" ;
717
818import metadata from "./package.json" ;
@@ -45,6 +55,7 @@ export default {
4555 associatedDomains : [ `webcredentials:${ env . APP_DOMAIN ?? "sandbox.exactly.app" } ` ] ,
4656 supportsTablet : false ,
4757 buildNumber : String ( versionCode ) ,
58+ entitlements : { "com.apple.developer.payment-pass-provisioning" : true } ,
4859 infoPlist : {
4960 ITSAppUsesNonExemptEncryption : false ,
5061 NSCameraUsageDescription : "This app uses the camera to verify your identity." ,
@@ -116,6 +127,54 @@ export default {
116127 } satisfies OneSignalPlugin . OneSignalPluginProps ,
117128 ] ,
118129 // @ts -expect-error inline plugin
130+ ( ( config ) => {
131+ const withAndroid = withDangerousMod ( config , [
132+ "android" ,
133+ ( c ) => {
134+ const source = path . join ( c . modRequest . projectRoot , "src/assets/mea_config" ) ;
135+ const destination = path . join ( c . modRequest . projectRoot , "android/app/src/main/assets/mea_config" ) ;
136+ mkdirSync ( path . dirname ( destination ) , { recursive : true } ) ;
137+ if ( existsSync ( source ) ) copyFileSync ( source , destination ) ;
138+ return c ;
139+ } ,
140+ ] ) ;
141+ return withXcodeProject ( withAndroid , ( c ) => {
142+ const source = path . join ( c . modRequest . projectRoot , "src/assets/mea_config" ) ;
143+ const destination = path . join ( c . modRequest . projectRoot , "ios" , c . modRequest . projectName ?? "" , "mea_config" ) ;
144+ if ( existsSync ( source ) ) {
145+ copyFileSync ( source , destination ) ;
146+ c . modResults = IOSConfig . XcodeUtils . addResourceFileToGroup ( {
147+ filepath : `${ c . modRequest . projectName ?? "" } /mea_config` ,
148+ groupName : c . modRequest . projectName ?? "" ,
149+ project : c . modResults ,
150+ isBuildFile : true ,
151+ } ) ;
152+ }
153+ return c ;
154+ } ) ;
155+ } ) satisfies ConfigPlugin ,
156+ // @ts -expect-error inline plugin
157+ ( ( config ) =>
158+ withDangerousMod ( config , [
159+ "android" ,
160+ ( c ) => {
161+ const buildGradle = path . join ( c . modRequest . projectRoot , "android/build.gradle" ) ;
162+ const meaRepo = ` maven {
163+ url "https://nexus.ext.meawallet.com/repository/mpp-android-group/"
164+ credentials {
165+ username = "${ env . MEAWALLET_ANDROID_USER } "
166+ password = "${ env . MEAWALLET_ANDROID_PASS } "
167+ }
168+ }` ;
169+ let contents = readFileSync ( buildGradle , "utf8" ) ;
170+ if ( ! contents . includes ( "nexus.ext.meawallet.com" ) ) {
171+ contents = contents . replace ( / ( a l l p r o j e c t s [ \s \S ] * ?r e p o s i t o r i e s \s * \{ ) / , `$1\n${ meaRepo } ` ) ;
172+ writeFileSync ( buildGradle , contents ) ;
173+ }
174+ return c ;
175+ } ,
176+ ] ) ) satisfies ConfigPlugin ,
177+ // @ts -expect-error inline plugin
119178 ( ( config ) =>
120179 withAndroidManifest (
121180 withAppBuildGradle ( config , ( c ) => {
0 commit comments