html2apk 0.3.0 → 0.4.0
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/README.md +27 -22
- package/examples/minimal/dist/MeuApp-1.0.0-debug.apk +0 -0
- package/package.json +1 -1
- package/src/cordova/project.js +19 -1
- package/src/core/build-apk.js +257 -30
- package/src/desktop/main.js +132 -1
- package/src/desktop/preload.js +13 -0
- package/src/desktop/renderer/index.html +3 -2
- package/src/desktop/renderer/renderer.js +908 -35
- package/src/desktop/renderer/styles.css +60 -2
- package/src/templates/cordova-plugin-html2apk-bridge/src/android/Html2ApkBridge.java +312 -32
- package/src/templates/cordova-plugin-html2apk-bridge/www/html2apk-bridge.js +31 -2
- package/src/templates/html2apk-onesignal.js +1 -1
- package/src/utils/command-runner.js +3 -0
package/src/desktop/preload.js
CHANGED
|
@@ -7,9 +7,12 @@ contextBridge.exposeInMainWorld("html2apkDesktop", {
|
|
|
7
7
|
selectFolder: () => ipcRenderer.invoke("dialog:select-folder"),
|
|
8
8
|
selectIcon: () => ipcRenderer.invoke("dialog:select-icon"),
|
|
9
9
|
inspectProject: (projectRoot) => ipcRenderer.invoke("project:inspect", projectRoot),
|
|
10
|
+
watchProject: (projectRoot) => ipcRenderer.invoke("project:watch", projectRoot),
|
|
11
|
+
unwatchProject: () => ipcRenderer.invoke("project:unwatch"),
|
|
10
12
|
runDoctor: (projectRoot) => ipcRenderer.invoke("doctor:run", projectRoot),
|
|
11
13
|
installAndroidRequirements: () => ipcRenderer.invoke("install:android-requirements"),
|
|
12
14
|
runBuild: (options) => ipcRenderer.invoke("build:run", options),
|
|
15
|
+
runUsbDebugBuild: (options) => ipcRenderer.invoke("build:run-usb-debug", options),
|
|
13
16
|
openPath: (targetPath) => ipcRenderer.invoke("shell:open-path", targetPath),
|
|
14
17
|
showItem: (targetPath) => ipcRenderer.invoke("shell:show-item", targetPath),
|
|
15
18
|
openExternalUrl: (targetUrl) => ipcRenderer.invoke("shell:open-external", targetUrl),
|
|
@@ -27,5 +30,15 @@ contextBridge.exposeInMainWorld("html2apkDesktop", {
|
|
|
27
30
|
const handler = (_event, payload) => listener(payload);
|
|
28
31
|
ipcRenderer.on("install:log", handler);
|
|
29
32
|
return () => ipcRenderer.removeListener("install:log", handler);
|
|
33
|
+
},
|
|
34
|
+
onProjectChanged: (listener) => {
|
|
35
|
+
const handler = (_event, payload) => listener(payload);
|
|
36
|
+
ipcRenderer.on("project:changed", handler);
|
|
37
|
+
return () => ipcRenderer.removeListener("project:changed", handler);
|
|
38
|
+
},
|
|
39
|
+
onProjectWatchError: (listener) => {
|
|
40
|
+
const handler = (_event, payload) => listener(payload);
|
|
41
|
+
ipcRenderer.on("project:watch-error", handler);
|
|
42
|
+
return () => ipcRenderer.removeListener("project:watch-error", handler);
|
|
30
43
|
}
|
|
31
44
|
});
|
|
@@ -287,6 +287,7 @@
|
|
|
287
287
|
</div>
|
|
288
288
|
<section class="action-strip">
|
|
289
289
|
<button id="buildButton" class="primary-action" type="button" disabled data-i18n="startBuild">Gerar APK</button>
|
|
290
|
+
<button id="usbDebugButton" class="secondary-action" type="button" disabled data-i18n="startUsbDebug">Testar no USB</button>
|
|
290
291
|
</section>
|
|
291
292
|
<div id="resultPanel" class="result-panel hidden">
|
|
292
293
|
<div>
|
|
@@ -304,8 +305,8 @@
|
|
|
304
305
|
<div class="success-panel">
|
|
305
306
|
<img src="../../../html2apk.png" alt="" class="success-icon">
|
|
306
307
|
<p class="eyebrow" data-i18n="successEyebrow">Concluido</p>
|
|
307
|
-
<h1 data-i18n="successTitle">APK gerado com sucesso</h1>
|
|
308
|
-
<p data-i18n="successText">Seu arquivo Android esta pronto na pasta dist.</p>
|
|
308
|
+
<h1 id="successTitle" data-i18n="successTitle">APK gerado com sucesso</h1>
|
|
309
|
+
<p id="successText" data-i18n="successText">Seu arquivo Android esta pronto na pasta dist.</p>
|
|
309
310
|
<code id="successApkPath">-</code>
|
|
310
311
|
<div class="result-actions">
|
|
311
312
|
<button id="successOpenDistButton" class="secondary-action" type="button" data-i18n="openDist">Abrir dist</button>
|