@@ -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+ withAndroidManifest ,
8+ withAppBuildGradle ,
9+ withDangerousMod ,
10+ withSettingsGradle ,
11+ withXcodeProject ,
12+ type ConfigPlugin ,
13+ } from "expo/config-plugins" ;
14+ import { copyFileSync , existsSync , mkdirSync } 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,49 @@ 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 ) ) copyFileSync ( source , destination ) ;
145+ // eslint-disable-next-line @typescript-eslint/no-unsafe-call, @typescript-eslint/no-unsafe-member-access
146+ c . modResults . addResourceFile (
147+ "mea_config" ,
148+ { target : c . modResults . getFirstTarget ( ) . uuid } , // eslint-disable-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-call, @typescript-eslint/no-unsafe-member-access
149+ c . modRequest . projectName ?? "" ,
150+ ) ;
151+ return c ;
152+ } ) ;
153+ } ) satisfies ConfigPlugin ,
154+ // @ts -expect-error inline plugin
155+ ( ( config ) =>
156+ withSettingsGradle ( config , ( c ) => {
157+ const meaRepo = `maven {
158+ url "https://nexus.ext.meawallet.com/repository/mpp-android-group/"
159+ credentials {
160+ username = "${ env . MEAWALLET_ANDROID_USER } "
161+ password = "${ env . MEAWALLET_ANDROID_PASS } "
162+ }
163+ }` ;
164+ if ( ! c . modResults . contents . includes ( "nexus.ext.meawallet.com" ) ) {
165+ c . modResults . contents = c . modResults . contents . replace (
166+ / d e p e n d e n c y R e s o l u t i o n M a n a g e m e n t \s * \{ [ ^ } ] * r e p o s i t o r i e s \s * \{ / ,
167+ `$&\n ${ meaRepo } ` ,
168+ ) ;
169+ }
170+ return c ;
171+ } ) ) satisfies ConfigPlugin ,
172+ // @ts -expect-error inline plugin
119173 ( ( config ) =>
120174 withAndroidManifest (
121175 withAppBuildGradle ( config , ( c ) => {
0 commit comments