allow creating profileable builds
This commit is contained in:
@@ -289,6 +289,7 @@ module.exports = function (_config) {
|
||||
'./plugins/withAndroidNoJitpackPlugin.js',
|
||||
'./plugins/shareExtension/withShareExtensions.js',
|
||||
'./plugins/notificationsExtension/withNotificationsExtension.js',
|
||||
'./plugins/withProfileableAndroid.js',
|
||||
[
|
||||
'expo-font',
|
||||
{
|
||||
|
||||
@@ -22,6 +22,7 @@
|
||||
"prepare": "is-ci || husky install",
|
||||
"postinstall": "patch-package && yarn intl:compile-if-needed",
|
||||
"prebuild": "EXPO_NO_GIT_STATUS=1 expo prebuild --clean",
|
||||
"prebuild:profile": "BSKY_PROFILE=1 EXPO_NO_GIT_STATUS=1 expo prebuild --clean",
|
||||
"android": "expo run:android",
|
||||
"android:prod": "expo run:android --variant release",
|
||||
"android:profile": "BSKY_PROFILE=1 expo run:android --variant release",
|
||||
|
||||
@@ -0,0 +1,32 @@
|
||||
const {withAndroidManifest} = require('@expo/config-plugins')
|
||||
|
||||
module.exports = function withProfileableAndroid(config) {
|
||||
return withAndroidManifest(config, mod => {
|
||||
if (process.env.BSKY_PROFILE !== '1') return mod
|
||||
|
||||
const manifest = mod.modResults.manifest
|
||||
|
||||
// Ensure <manifest xmlns:tools="...">
|
||||
manifest.$ = manifest.$ || {}
|
||||
manifest.$['xmlns:tools'] =
|
||||
manifest.$['xmlns:tools'] || 'http://schemas.android.com/tools'
|
||||
|
||||
const app = manifest.application?.[0]
|
||||
if (!app) return mod
|
||||
|
||||
app.profileable = app.profileable || []
|
||||
const already = app.profileable.some(
|
||||
p => p.$ && p.$['android:shell'] === 'true',
|
||||
)
|
||||
if (!already) {
|
||||
app.profileable.push({
|
||||
$: {
|
||||
'android:shell': 'true',
|
||||
'tools:targetApi': 'q',
|
||||
},
|
||||
})
|
||||
}
|
||||
|
||||
return mod
|
||||
})
|
||||
}
|
||||
Reference in New Issue
Block a user