-
Notifications
You must be signed in to change notification settings - Fork 3
/
wass.js
executable file
·43 lines (34 loc) · 998 Bytes
/
wass.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
const {withAndroidManifest} = require("@expo/config-plugins")
const attrs = {
"resizeable": false,
"smallScreens": false,
"normalScreens": true,
"largeScreens": true,
"xlargeScreens": false,
"anyDensity": true,
"requiresSmallestWidthDp": 320,
"compatibleWidthLimitDp": 480,
"largestWidthLimitDp": 575,
}
function namespacedAttributes(attributes) {
let namespacedObj = {}
for (const [key, value] of Object.entries(attributes)) {
namespacedObj[`android:${key}`] = value
}
return namespacedObj
}
function addSupportsScreens(androidManifest) {
const {manifest} = androidManifest
manifest["supports-screens"] = [
{
$: namespacedAttributes(attrs),
},
]
return androidManifest
}
module.exports = function withAndroidSupportsScreens(config) {
return withAndroidManifest(config, (config) => {
config.modResults = addSupportsScreens(config.modResults)
return config
})
}