@bubblewrap/core 1.13.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +203 -0
- package/README.md +63 -0
- package/dist/index.d.ts +17 -0
- package/dist/index.js +56 -0
- package/dist/lib/BufferedLog.d.ts +20 -0
- package/dist/lib/BufferedLog.js +83 -0
- package/dist/lib/Config.d.ts +9 -0
- package/dist/lib/Config.js +50 -0
- package/dist/lib/DigitalAssetLinks.d.ts +3 -0
- package/dist/lib/DigitalAssetLinks.js +37 -0
- package/dist/lib/FetchUtils.d.ts +17 -0
- package/dist/lib/FetchUtils.js +79 -0
- package/dist/lib/GooglePlay.d.ts +41 -0
- package/dist/lib/GooglePlay.js +92 -0
- package/dist/lib/GradleWrapper.d.ts +31 -0
- package/dist/lib/GradleWrapper.js +62 -0
- package/dist/lib/ImageHelper.d.ts +37 -0
- package/dist/lib/ImageHelper.js +112 -0
- package/dist/lib/Log.d.ts +88 -0
- package/dist/lib/Log.js +114 -0
- package/dist/lib/Result.d.ts +46 -0
- package/dist/lib/Result.js +97 -0
- package/dist/lib/ShortcutInfo.d.ts +32 -0
- package/dist/lib/ShortcutInfo.js +84 -0
- package/dist/lib/TwaGenerator.d.ts +39 -0
- package/dist/lib/TwaGenerator.js +362 -0
- package/dist/lib/TwaManifest.d.ts +234 -0
- package/dist/lib/TwaManifest.js +384 -0
- package/dist/lib/androidSdk/AndroidSdkTools.d.ts +87 -0
- package/dist/lib/androidSdk/AndroidSdkTools.js +226 -0
- package/dist/lib/errors/ValidatePathError.d.ts +9 -0
- package/dist/lib/errors/ValidatePathError.js +16 -0
- package/dist/lib/features/AppsFlyerFeature.d.ts +8 -0
- package/dist/lib/features/AppsFlyerFeature.js +70 -0
- package/dist/lib/features/EmptyFeature.d.ts +28 -0
- package/dist/lib/features/EmptyFeature.js +44 -0
- package/dist/lib/features/Feature.d.ts +120 -0
- package/dist/lib/features/Feature.js +17 -0
- package/dist/lib/features/FeatureManager.d.ts +36 -0
- package/dist/lib/features/FeatureManager.js +137 -0
- package/dist/lib/features/FirstRunFlagFeature.d.ts +8 -0
- package/dist/lib/features/FirstRunFlagFeature.js +43 -0
- package/dist/lib/features/LocationDelegationFeature.d.ts +7 -0
- package/dist/lib/features/LocationDelegationFeature.js +32 -0
- package/dist/lib/features/PlayBillingFeature.d.ts +7 -0
- package/dist/lib/features/PlayBillingFeature.js +53 -0
- package/dist/lib/jdk/JarSigner.d.ts +13 -0
- package/dist/lib/jdk/JarSigner.js +55 -0
- package/dist/lib/jdk/JdkHelper.d.ts +55 -0
- package/dist/lib/jdk/JdkHelper.js +127 -0
- package/dist/lib/jdk/KeyTool.d.ts +57 -0
- package/dist/lib/jdk/KeyTool.js +136 -0
- package/dist/lib/mock/MockLog.d.ts +37 -0
- package/dist/lib/mock/MockLog.js +70 -0
- package/dist/lib/types/WebManifest.d.ts +44 -0
- package/dist/lib/types/WebManifest.js +17 -0
- package/dist/lib/util.d.ts +82 -0
- package/dist/lib/util.js +279 -0
- package/dist/lib/wrappers/svg2img.d.ts +14 -0
- package/dist/lib/wrappers/svg2img.js +39 -0
- package/package.json +58 -0
- package/template_project/app/.gitignore +1 -0
- package/template_project/app/build.gradle +211 -0
- package/template_project/app/src/main/AndroidManifest.xml +204 -0
- package/template_project/app/src/main/java/Application.java +35 -0
- package/template_project/app/src/main/java/DelegationService.java +18 -0
- package/template_project/app/src/main/java/LauncherActivity.java +62 -0
- package/template_project/app/src/main/res/drawable-anydpi/shortcut_legacy_background.xml +25 -0
- package/template_project/app/src/main/res/drawable-anydpi/shortcut_monochrome.xml +27 -0
- package/template_project/app/src/main/res/drawable-anydpi-v26/shortcut_maskable.xml +32 -0
- package/template_project/app/src/main/res/drawable-anydpi-v26/shortcut_monochrome.xml +26 -0
- package/template_project/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml +33 -0
- package/template_project/app/src/main/res/values/colors.xml +18 -0
- package/template_project/app/src/main/res/values/strings.xml +50 -0
- package/template_project/app/src/main/res/xml/filepaths.xml +18 -0
- package/template_project/app/src/main/res/xml/shortcuts.xml +16 -0
- package/template_project/build.gradle +42 -0
- package/template_project/enable-debug.sh +27 -0
- package/template_project/gradle/wrapper/gradle-wrapper.jar +0 -0
- package/template_project/gradle/wrapper/gradle-wrapper.properties +5 -0
- package/template_project/gradle.properties +14 -0
- package/template_project/gradlew +188 -0
- package/template_project/gradlew.bat +100 -0
- package/template_project/settings.gradle +1 -0
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
export declare enum Format {
|
|
3
|
+
jpeg = "jpeg",
|
|
4
|
+
jpg = "jpg",
|
|
5
|
+
png = "png"
|
|
6
|
+
}
|
|
7
|
+
export interface Svg2imgOptions {
|
|
8
|
+
width?: number;
|
|
9
|
+
height?: number;
|
|
10
|
+
preserveAspectRatio?: boolean | string;
|
|
11
|
+
format?: Format;
|
|
12
|
+
quality?: number;
|
|
13
|
+
}
|
|
14
|
+
export declare function svg2img(svg: string, options?: Svg2imgOptions): Promise<Buffer>;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*
|
|
3
|
+
* Copyright 2020 Google Inc. All Rights Reserved.
|
|
4
|
+
*
|
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
* you may not use this file except in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
16
|
+
*/
|
|
17
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
+
exports.svg2img = exports.Format = void 0;
|
|
19
|
+
// This class is needed because svg2img's typescript type definitions didn't work.
|
|
20
|
+
// once it will, there is no need for this class.
|
|
21
|
+
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
|
22
|
+
const _svg2img = require('svg2img');
|
|
23
|
+
var Format;
|
|
24
|
+
(function (Format) {
|
|
25
|
+
Format["jpeg"] = "jpeg";
|
|
26
|
+
Format["jpg"] = "jpg";
|
|
27
|
+
Format["png"] = "png";
|
|
28
|
+
})(Format = exports.Format || (exports.Format = {}));
|
|
29
|
+
function svg2img(svg, options = {}) {
|
|
30
|
+
return new Promise((resolve, reject) => {
|
|
31
|
+
_svg2img(svg, options, (error, buffer) => {
|
|
32
|
+
if (error) {
|
|
33
|
+
return reject(error);
|
|
34
|
+
}
|
|
35
|
+
return resolve(buffer);
|
|
36
|
+
});
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
exports.svg2img = svg2img;
|
package/package.json
ADDED
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@bubblewrap/core",
|
|
3
|
+
"version": "1.13.6",
|
|
4
|
+
"description": "Core Library to generate, build and sign TWA projects",
|
|
5
|
+
"scripts": {
|
|
6
|
+
"build": "tsc",
|
|
7
|
+
"clean": "del dist",
|
|
8
|
+
"lint": "eslint \"src/**/*.{js,ts}\"",
|
|
9
|
+
"test": "tsc && jasmine --config=jasmine.json"
|
|
10
|
+
},
|
|
11
|
+
"main": "./dist/index.js",
|
|
12
|
+
"types": "./dist/index.d.ts",
|
|
13
|
+
"keywords": [
|
|
14
|
+
"twa",
|
|
15
|
+
"trusted-web-activities",
|
|
16
|
+
"pwa",
|
|
17
|
+
"progressive-web-apps",
|
|
18
|
+
"android"
|
|
19
|
+
],
|
|
20
|
+
"files": [
|
|
21
|
+
"dist/lib",
|
|
22
|
+
"dist/index.d.ts",
|
|
23
|
+
"dist/index.js",
|
|
24
|
+
"template_project"
|
|
25
|
+
],
|
|
26
|
+
"repository": {
|
|
27
|
+
"type": "git",
|
|
28
|
+
"url": "git+https://github.com/GoogleChromeLabs/bubblewrap.git"
|
|
29
|
+
},
|
|
30
|
+
"author": "",
|
|
31
|
+
"license": "Apache-2.0",
|
|
32
|
+
"dependencies": {
|
|
33
|
+
"@types/color": "^3.0.0",
|
|
34
|
+
"@types/extract-zip": "^1.6.2",
|
|
35
|
+
"@types/gapi.client.androidpublisher": "^3.0.0",
|
|
36
|
+
"@types/inquirer": "^6.5.0",
|
|
37
|
+
"@types/lodash.template": "^4.5.0",
|
|
38
|
+
"@types/mime-types": "^2.1.0",
|
|
39
|
+
"@types/node": "^12.20.1",
|
|
40
|
+
"@types/node-fetch": "^2.5.10",
|
|
41
|
+
"@types/tar": "^4.0.4",
|
|
42
|
+
"@types/valid-url": "^1.0.3",
|
|
43
|
+
"canvg": "3.0.7",
|
|
44
|
+
"color": "^3.1.3",
|
|
45
|
+
"extract-zip": "^1.7.0",
|
|
46
|
+
"fetch-h2": "^2.5.1",
|
|
47
|
+
"googleapis": "^81.0.0",
|
|
48
|
+
"inquirer": "^7.3.3",
|
|
49
|
+
"jimp": "^0.14.0",
|
|
50
|
+
"lodash.template": "^4.5.0",
|
|
51
|
+
"mime-types": "^2.1.28",
|
|
52
|
+
"node-fetch": "^2.6.1",
|
|
53
|
+
"svg2img": "^0.9.3",
|
|
54
|
+
"tar": "^6.1.0",
|
|
55
|
+
"valid-url": "^1.0.9"
|
|
56
|
+
},
|
|
57
|
+
"gitHead": "e38824581fa305852d3c1651e2b99bbc56b88f6d"
|
|
58
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
/build
|
|
@@ -0,0 +1,211 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright 2019 Google Inc.
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
import groovy.xml.MarkupBuilder
|
|
18
|
+
|
|
19
|
+
plugins {
|
|
20
|
+
id 'com.android.application'
|
|
21
|
+
<% if (serviceAccountJsonFile) { %>
|
|
22
|
+
id("com.github.triplet.play") version "3.4.0"
|
|
23
|
+
<% } %>
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
def twaManifest = [
|
|
27
|
+
applicationId: '<%= packageId %>',
|
|
28
|
+
hostName: '<%= host %>', // The domain being opened in the TWA.
|
|
29
|
+
launchUrl: '<%= startUrl %>', // The start path for the TWA. Must be relative to the domain.
|
|
30
|
+
name: '<%= escapeGradleString(name) %>', // The application name.
|
|
31
|
+
launcherName: '<%= escapeGradleString(launcherName) %>', // The name shown on the Android Launcher.
|
|
32
|
+
themeColor: '<%= themeColor.hex() %>', // The color used for the status bar.
|
|
33
|
+
navigationColor: '<%= navigationColor.hex() %>', // The color used for the navigation bar.
|
|
34
|
+
navigationColorDark: '<%= navigationColorDark.hex() %>', // The color used for the dark navbar.
|
|
35
|
+
navigationDividerColor: '<%= navigationDividerColor.hex() %>', // The navbar divider color.
|
|
36
|
+
navigationDividerColorDark: '<%= navigationDividerColorDark.hex() %>', // The dark navbar divider color.
|
|
37
|
+
backgroundColor: '<%= backgroundColor.hex() %>', // The color used for the splash screen background.
|
|
38
|
+
enableNotifications: <%= enableNotifications %>, // Set to true to enable notification delegation.
|
|
39
|
+
// Every shortcut must include the following fields:
|
|
40
|
+
// - name: String that will show up in the shortcut.
|
|
41
|
+
// - short_name: Shorter string used if |name| is too long.
|
|
42
|
+
// - url: Absolute path of the URL to launch the app with (e.g '/create').
|
|
43
|
+
// - icon: Name of the resource in the drawable folder to use as an icon.
|
|
44
|
+
shortcuts: <%= generateShortcuts() %>,
|
|
45
|
+
// The duration of fade out animation in milliseconds to be played when removing splash screen.
|
|
46
|
+
splashScreenFadeOutDuration: <%= splashScreenFadeOutDuration %>,
|
|
47
|
+
generatorApp: '<%= generatorApp %>', // Application that generated the Android Project
|
|
48
|
+
// The fallback strategy for when Trusted Web Activity is not avilable. Possible values are
|
|
49
|
+
// 'customtabs' and 'webview'.
|
|
50
|
+
fallbackType: '<%= fallbackType %>',
|
|
51
|
+
enableSiteSettingsShortcut: '<%= enableSiteSettingsShortcut %>',
|
|
52
|
+
orientation: '<%= orientation %>',
|
|
53
|
+
]
|
|
54
|
+
|
|
55
|
+
android {
|
|
56
|
+
compileSdkVersion 30
|
|
57
|
+
defaultConfig {
|
|
58
|
+
applicationId "<%= packageId %>"
|
|
59
|
+
minSdkVersion 19
|
|
60
|
+
targetSdkVersion 30
|
|
61
|
+
versionCode <%= appVersionCode %>
|
|
62
|
+
versionName "<%= appVersionName %>"
|
|
63
|
+
|
|
64
|
+
// The name for the application
|
|
65
|
+
resValue "string", "appName", twaManifest.name
|
|
66
|
+
|
|
67
|
+
// The name for the application on the Android Launcher
|
|
68
|
+
resValue "string", "launcherName", twaManifest.launcherName
|
|
69
|
+
|
|
70
|
+
// The URL that will be used when launching the TWA from the Android Launcher
|
|
71
|
+
def launchUrl = "https://" + twaManifest.hostName + twaManifest.launchUrl
|
|
72
|
+
resValue "string", "launchUrl", launchUrl
|
|
73
|
+
|
|
74
|
+
<% if (webManifestUrl) { %>
|
|
75
|
+
// The URL the Web Manifest for the Progressive Web App that the TWA points to. This
|
|
76
|
+
// is used by Chrome OS to open the Web version of the PWA instead of the TWA, as it
|
|
77
|
+
// will probably give a better user experience for non-mobile devices.
|
|
78
|
+
resValue "string", "webManifestUrl", '<%= webManifestUrl %>'
|
|
79
|
+
<% } %>
|
|
80
|
+
|
|
81
|
+
<% if (shareTarget) { %>
|
|
82
|
+
// The data for the app to support web share target.
|
|
83
|
+
resValue "string", "shareTarget", '<%= escapeJsonString(JSON.stringify(shareTarget)) %>'
|
|
84
|
+
<% } %>
|
|
85
|
+
|
|
86
|
+
// The hostname is used when building the intent-filter, so the TWA is able to
|
|
87
|
+
// handle Intents to open https://svgomg.firebaseapp.com.
|
|
88
|
+
resValue "string", "hostName", twaManifest.hostName
|
|
89
|
+
|
|
90
|
+
// This attribute sets the status bar color for the TWA. It can be either set here or in
|
|
91
|
+
// `res/values/colors.xml`. Setting in both places is an error and the app will not
|
|
92
|
+
// compile. If not set, the status bar color defaults to #FFFFFF - white.
|
|
93
|
+
resValue "color", "colorPrimary", twaManifest.themeColor
|
|
94
|
+
|
|
95
|
+
// This attribute sets the navigation bar color for the TWA. It can be either set here or
|
|
96
|
+
// in `res/values/colors.xml`. Setting in both places is an error and the app will not
|
|
97
|
+
// compile. If not set, the navigation bar color defaults to #FFFFFF - white.
|
|
98
|
+
resValue "color", "navigationColor", twaManifest.navigationColor
|
|
99
|
+
|
|
100
|
+
// This attribute sets the dark navigation bar color for the TWA. It can be either set here
|
|
101
|
+
// or in `res/values/colors.xml`. Setting in both places is an error and the app will not
|
|
102
|
+
// compile. If not set, the navigation bar color defaults to #000000 - black.
|
|
103
|
+
resValue "color", "navigationColorDark", twaManifest.navigationColorDark
|
|
104
|
+
|
|
105
|
+
// This attribute sets the navbar divider color for the TWA. It can be either
|
|
106
|
+
// set here or in `res/values/colors.xml`. Setting in both places is an error and the app
|
|
107
|
+
// will not compile. If not set, the divider color defaults to #00000000 - transparent.
|
|
108
|
+
resValue "color", "navigationDividerColor", twaManifest.navigationDividerColor
|
|
109
|
+
|
|
110
|
+
// This attribute sets the dark navbar divider color for the TWA. It can be either
|
|
111
|
+
// set here or in `res/values/colors.xml`. Setting in both places is an error and the
|
|
112
|
+
//app will not compile. If not set, the divider color defaults to #000000 - black.
|
|
113
|
+
resValue "color", "navigationDividerColorDark", twaManifest.navigationDividerColorDark
|
|
114
|
+
|
|
115
|
+
// Sets the color for the background used for the splash screen when launching the
|
|
116
|
+
// Trusted Web Activity.
|
|
117
|
+
resValue "color", "backgroundColor", twaManifest.backgroundColor
|
|
118
|
+
|
|
119
|
+
// Defines a provider authority fot the Splash Screen
|
|
120
|
+
resValue "string", "providerAuthority", twaManifest.applicationId + '.fileprovider'
|
|
121
|
+
|
|
122
|
+
// The enableNotification resource is used to enable or disable the
|
|
123
|
+
// TrustedWebActivityService, by changing the android:enabled and android:exported
|
|
124
|
+
// attributes
|
|
125
|
+
resValue "bool", "enableNotification", twaManifest.enableNotifications.toString()
|
|
126
|
+
|
|
127
|
+
twaManifest.shortcuts.eachWithIndex { shortcut, index ->
|
|
128
|
+
resValue "string", "shortcut_name_$index", "$shortcut.name"
|
|
129
|
+
resValue "string", "shortcut_short_name_$index", "$shortcut.short_name"
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
// The splashScreenFadeOutDuration resource is used to set the duration of fade out animation in milliseconds
|
|
133
|
+
// to be played when removing splash screen. The default is 0 (no animation).
|
|
134
|
+
resValue "integer", "splashScreenFadeOutDuration", twaManifest.splashScreenFadeOutDuration.toString()
|
|
135
|
+
|
|
136
|
+
resValue "string", "generatorApp", twaManifest.generatorApp
|
|
137
|
+
|
|
138
|
+
resValue "string", "fallbackType", twaManifest.fallbackType
|
|
139
|
+
|
|
140
|
+
resValue "bool", "enableSiteSettingsShortcut", twaManifest.enableSiteSettingsShortcut
|
|
141
|
+
resValue "string", "orientation", twaManifest.orientation
|
|
142
|
+
}
|
|
143
|
+
buildTypes {
|
|
144
|
+
release {
|
|
145
|
+
minifyEnabled true
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
compileOptions {
|
|
149
|
+
sourceCompatibility JavaVersion.VERSION_1_8
|
|
150
|
+
targetCompatibility JavaVersion.VERSION_1_8
|
|
151
|
+
}
|
|
152
|
+
lintOptions {
|
|
153
|
+
checkReleaseBuilds false
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
<% if (serviceAccountJsonFile) { %>
|
|
158
|
+
play {
|
|
159
|
+
serviceAccountCredentials.set(file("<%= serviceAccountJsonFile %>"))
|
|
160
|
+
}
|
|
161
|
+
<% } %>
|
|
162
|
+
|
|
163
|
+
task generateShorcutsFile {
|
|
164
|
+
assert twaManifest.shortcuts.size() < 5, "You can have at most 4 shortcuts."
|
|
165
|
+
twaManifest.shortcuts.eachWithIndex { s, i ->
|
|
166
|
+
assert s.name != null, 'Missing `name` in shortcut #' + i
|
|
167
|
+
assert s.short_name != null, 'Missing `short_name` in shortcut #' + i
|
|
168
|
+
assert s.url != null, 'Missing `icon` in shortcut #' + i
|
|
169
|
+
assert s.icon != null, 'Missing `url` in shortcut #' + i
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
def shortcutsFile = new File("$projectDir/src/main/res/xml", "shortcuts.xml")
|
|
173
|
+
|
|
174
|
+
def xmlWriter = new StringWriter()
|
|
175
|
+
def xmlMarkup = new MarkupBuilder(new IndentPrinter(xmlWriter, " ", true))
|
|
176
|
+
|
|
177
|
+
xmlMarkup
|
|
178
|
+
.'shortcuts'('xmlns:android': 'http://schemas.android.com/apk/res/android') {
|
|
179
|
+
twaManifest.shortcuts.eachWithIndex { s, i ->
|
|
180
|
+
'shortcut'(
|
|
181
|
+
'android:shortcutId': 'shortcut' + i,
|
|
182
|
+
'android:enabled': 'true',
|
|
183
|
+
'android:icon': '@drawable/' + s.icon,
|
|
184
|
+
'android:shortcutShortLabel': '@string/shortcut_short_name_' + i,
|
|
185
|
+
'android:shortcutLongLabel': '@string/shortcut_name_' + i) {
|
|
186
|
+
'intent'(
|
|
187
|
+
'android:action': 'android.intent.action.MAIN',
|
|
188
|
+
'android:targetPackage': twaManifest.applicationId,
|
|
189
|
+
'android:targetClass': twaManifest.applicationId + '.LauncherActivity',
|
|
190
|
+
'android:data': s.url)
|
|
191
|
+
'categories'('android:name': 'android.intent.category.LAUNCHER')
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
shortcutsFile.text = xmlWriter.toString() + '\n'
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
preBuild.dependsOn(generateShorcutsFile)
|
|
199
|
+
|
|
200
|
+
repositories {
|
|
201
|
+
<% for(const rep of buildGradle.repositories) { %>
|
|
202
|
+
<%= rep %>
|
|
203
|
+
<% } %>
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
dependencies {
|
|
207
|
+
implementation fileTree(include: ['*.jar'], dir: 'libs')
|
|
208
|
+
<% for(const dep of buildGradle.dependencies) { %>
|
|
209
|
+
implementation '<%= dep %>'
|
|
210
|
+
<% } %>
|
|
211
|
+
}
|
|
@@ -0,0 +1,204 @@
|
|
|
1
|
+
<!--
|
|
2
|
+
Copyright 2019 Google Inc. All Rights Reserved.
|
|
3
|
+
|
|
4
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
you may not use this file except in compliance with the License.
|
|
6
|
+
You may obtain a copy of the License at
|
|
7
|
+
|
|
8
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
|
|
10
|
+
Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
See the License for the specific language governing permissions and
|
|
14
|
+
limitations under the License.
|
|
15
|
+
-->
|
|
16
|
+
|
|
17
|
+
<!-- The "package" attribute is rewritten by the Gradle build with the value of applicationId.
|
|
18
|
+
It is still required here, as it is used to derive paths, for instance when referring
|
|
19
|
+
to an Activity by ".MyActivity" instead of the full name. If more Activities are added to the
|
|
20
|
+
application, the package attribute will need to reflect the correct path in order to use
|
|
21
|
+
the abbreviated format. -->
|
|
22
|
+
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
|
23
|
+
package="<%= packageId %>">
|
|
24
|
+
|
|
25
|
+
<% for(const permission of androidManifest.permissions) { %>
|
|
26
|
+
<uses-permission android:name="<%= permission %>"/>
|
|
27
|
+
<% } %>
|
|
28
|
+
|
|
29
|
+
<% if (isChromeOSOnly) { %>
|
|
30
|
+
<uses-feature android:name="org.chromium.arc" android:required="true" />
|
|
31
|
+
<% } %>
|
|
32
|
+
|
|
33
|
+
<application
|
|
34
|
+
android:name="Application"
|
|
35
|
+
android:allowBackup="true"
|
|
36
|
+
android:icon="@mipmap/ic_launcher"
|
|
37
|
+
android:label="@string/appName"
|
|
38
|
+
<% if (enableSiteSettingsShortcut) { %>
|
|
39
|
+
android:manageSpaceActivity="com.google.androidbrowserhelper.trusted.ManageDataLauncherActivity"
|
|
40
|
+
<% } %>
|
|
41
|
+
android:supportsRtl="true"
|
|
42
|
+
android:theme="@android:style/Theme.Translucent.NoTitleBar">
|
|
43
|
+
|
|
44
|
+
<meta-data
|
|
45
|
+
android:name="asset_statements"
|
|
46
|
+
android:resource="@string/assetStatements" />
|
|
47
|
+
|
|
48
|
+
<% if (webManifestUrl) { %>
|
|
49
|
+
<meta-data
|
|
50
|
+
android:name="web_manifest_url"
|
|
51
|
+
android:value="@string/webManifestUrl" />
|
|
52
|
+
<% } %>
|
|
53
|
+
|
|
54
|
+
<meta-data
|
|
55
|
+
android:name="twa_generator"
|
|
56
|
+
android:value="@string/generatorApp" />
|
|
57
|
+
|
|
58
|
+
<% if (enableSiteSettingsShortcut) { %>
|
|
59
|
+
<activity android:name="com.google.androidbrowserhelper.trusted.ManageDataLauncherActivity">
|
|
60
|
+
<meta-data
|
|
61
|
+
android:name="android.support.customtabs.trusted.MANAGE_SPACE_URL"
|
|
62
|
+
android:value="@string/launchUrl" />
|
|
63
|
+
</activity>
|
|
64
|
+
<% } %>
|
|
65
|
+
|
|
66
|
+
<activity android:name="LauncherActivity"
|
|
67
|
+
android:alwaysRetainTaskState="true"
|
|
68
|
+
android:label="@string/launcherName">
|
|
69
|
+
<meta-data android:name="android.support.customtabs.trusted.DEFAULT_URL"
|
|
70
|
+
android:value="@string/launchUrl" />
|
|
71
|
+
|
|
72
|
+
<meta-data
|
|
73
|
+
android:name="android.support.customtabs.trusted.STATUS_BAR_COLOR"
|
|
74
|
+
android:resource="@color/colorPrimary" />
|
|
75
|
+
|
|
76
|
+
<meta-data
|
|
77
|
+
android:name="android.support.customtabs.trusted.NAVIGATION_BAR_COLOR"
|
|
78
|
+
android:resource="@color/navigationColor" />
|
|
79
|
+
|
|
80
|
+
<meta-data
|
|
81
|
+
android:name="android.support.customtabs.trusted.NAVIGATION_BAR_COLOR_DARK"
|
|
82
|
+
android:resource="@color/navigationColorDark" />
|
|
83
|
+
|
|
84
|
+
<meta-data
|
|
85
|
+
android:name="androix.browser.trusted.NAVIGATION_BAR_DIVIDER_COLOR"
|
|
86
|
+
android:resource="@color/navigationDividerColor" />
|
|
87
|
+
|
|
88
|
+
<meta-data
|
|
89
|
+
android:name="androix.browser.trusted.NAVIGATION_BAR_DIVIDER_COLOR_DARK"
|
|
90
|
+
android:resource="@color/navigationDividerColorDark" />
|
|
91
|
+
|
|
92
|
+
<meta-data android:name="android.support.customtabs.trusted.SPLASH_IMAGE_DRAWABLE"
|
|
93
|
+
android:resource="@drawable/splash"/>
|
|
94
|
+
|
|
95
|
+
<meta-data android:name="android.support.customtabs.trusted.SPLASH_SCREEN_BACKGROUND_COLOR"
|
|
96
|
+
android:resource="@color/backgroundColor"/>
|
|
97
|
+
|
|
98
|
+
<meta-data android:name="android.support.customtabs.trusted.SPLASH_SCREEN_FADE_OUT_DURATION"
|
|
99
|
+
android:value="@integer/splashScreenFadeOutDuration"/>
|
|
100
|
+
|
|
101
|
+
<meta-data android:name="android.support.customtabs.trusted.FILE_PROVIDER_AUTHORITY"
|
|
102
|
+
android:value="@string/providerAuthority"/>
|
|
103
|
+
|
|
104
|
+
<meta-data android:name="android.app.shortcuts" android:resource="@xml/shortcuts" />
|
|
105
|
+
|
|
106
|
+
<meta-data android:name="android.support.customtabs.trusted.FALLBACK_STRATEGY"
|
|
107
|
+
android:value="@string/fallbackType" />
|
|
108
|
+
|
|
109
|
+
<% if (shareTarget) { %>
|
|
110
|
+
<meta-data
|
|
111
|
+
android:name="android.support.customtabs.trusted.METADATA_SHARE_TARGET"
|
|
112
|
+
android:resource="@string/shareTarget"/>
|
|
113
|
+
<% } %>
|
|
114
|
+
|
|
115
|
+
<% if (display === 'fullscreen') { %>
|
|
116
|
+
<meta-data android:name="android.support.customtabs.trusted.DISPLAY_MODE"
|
|
117
|
+
android:value="immersive" />
|
|
118
|
+
<% } else if (display === 'fullscreen-sticky') { %>
|
|
119
|
+
<meta-data android:name="android.support.customtabs.trusted.DISPLAY_MODE"
|
|
120
|
+
android:value="sticky-immersive" />
|
|
121
|
+
<% } %>
|
|
122
|
+
|
|
123
|
+
<meta-data android:name="android.support.customtabs.trusted.SCREEN_ORIENTATION"
|
|
124
|
+
android:value="@string/orientation"/>
|
|
125
|
+
|
|
126
|
+
<% if (additionalTrustedOrigins.length > 0) { %>
|
|
127
|
+
<meta-data
|
|
128
|
+
android:name="android.support.customtabs.trusted.ADDITIONAL_TRUSTED_ORIGINS"
|
|
129
|
+
android:resource="@array/additional_trusted_origins" />
|
|
130
|
+
<% } %>
|
|
131
|
+
|
|
132
|
+
<% if (shareTargetIntentFilter) { %>
|
|
133
|
+
<intent-filter>
|
|
134
|
+
<% for (const action of shareTargetIntentFilter.actions) { %>
|
|
135
|
+
<action android:name="<%= action %>" />
|
|
136
|
+
<% } %>
|
|
137
|
+
<category android:name="android.intent.category.DEFAULT" />
|
|
138
|
+
<% for (const mimeType of shareTargetIntentFilter.mimeTypes) { %>
|
|
139
|
+
<data android:mimeType="<%= mimeType %>" />
|
|
140
|
+
<% } %>
|
|
141
|
+
</intent-filter>
|
|
142
|
+
<% } %>
|
|
143
|
+
|
|
144
|
+
<intent-filter>
|
|
145
|
+
<action android:name="android.intent.action.MAIN" />
|
|
146
|
+
<category android:name="android.intent.category.LAUNCHER" />
|
|
147
|
+
</intent-filter>
|
|
148
|
+
|
|
149
|
+
<intent-filter android:autoVerify="true">
|
|
150
|
+
<action android:name="android.intent.action.VIEW"/>
|
|
151
|
+
<category android:name="android.intent.category.DEFAULT" />
|
|
152
|
+
<category android:name="android.intent.category.BROWSABLE"/>
|
|
153
|
+
<data android:scheme="https"
|
|
154
|
+
android:host="@string/hostName"/>
|
|
155
|
+
</intent-filter>
|
|
156
|
+
|
|
157
|
+
<% for (const additionalOrigin of additionalTrustedOrigins) { %>
|
|
158
|
+
<intent-filter android:autoVerify="true">
|
|
159
|
+
<action android:name="android.intent.action.VIEW"/>
|
|
160
|
+
<category android:name="android.intent.category.DEFAULT" />
|
|
161
|
+
<category android:name="android.intent.category.BROWSABLE"/>
|
|
162
|
+
<data android:scheme="https"
|
|
163
|
+
android:host="<%= additionalOrigin %>"/>
|
|
164
|
+
</intent-filter>
|
|
165
|
+
<% } %>
|
|
166
|
+
</activity>
|
|
167
|
+
|
|
168
|
+
<activity android:name="com.google.androidbrowserhelper.trusted.FocusActivity" />
|
|
169
|
+
|
|
170
|
+
<activity android:name="com.google.androidbrowserhelper.trusted.WebViewFallbackActivity"
|
|
171
|
+
android:configChanges="orientation|screenSize" />
|
|
172
|
+
|
|
173
|
+
<provider
|
|
174
|
+
android:name="androidx.core.content.FileProvider"
|
|
175
|
+
android:authorities="@string/providerAuthority"
|
|
176
|
+
android:grantUriPermissions="true"
|
|
177
|
+
android:exported="false">
|
|
178
|
+
<meta-data
|
|
179
|
+
android:name="android.support.FILE_PROVIDER_PATHS"
|
|
180
|
+
android:resource="@xml/filepaths" />
|
|
181
|
+
</provider>
|
|
182
|
+
|
|
183
|
+
<service
|
|
184
|
+
android:name=".DelegationService"
|
|
185
|
+
android:enabled="@bool/enableNotification"
|
|
186
|
+
android:exported="@bool/enableNotification">
|
|
187
|
+
|
|
188
|
+
<% if (enableNotifications && (monochromeIconUrl || iconUrl)) { %>
|
|
189
|
+
<meta-data
|
|
190
|
+
android:name="android.support.customtabs.trusted.SMALL_ICON"
|
|
191
|
+
android:resource="@drawable/ic_notification_icon" />
|
|
192
|
+
<% } %>
|
|
193
|
+
|
|
194
|
+
<intent-filter>
|
|
195
|
+
<action android:name="android.support.customtabs.trusted.TRUSTED_WEB_ACTIVITY_SERVICE"/>
|
|
196
|
+
<category android:name="android.intent.category.DEFAULT"/>
|
|
197
|
+
</intent-filter>
|
|
198
|
+
</service>
|
|
199
|
+
|
|
200
|
+
<% for(const component of androidManifest.components) { %>
|
|
201
|
+
<%= component %>
|
|
202
|
+
<% } %>
|
|
203
|
+
</application>
|
|
204
|
+
</manifest>
|