Update shared Gaia workflows and Sargo development tooling
Fix camera switching and Contacts/SMS activity routing across shared hosts. Integrate Marketplace installation and native standalone recovery tools, Bluetooth runtime packages and trusted certificates. Update English/French READMEs and the shared changelog with tested scope and remaining radio/audio/Bluetooth limitations. Preview17 remains the existing APK; no new native image is released. Validation: shared JavaScript and native Python tests; Android packaging and payload parity from an isolated publication checkout.
This commit is contained in:
parent
d04824ec89
commit
0041cd9660
101 changed files with 3883 additions and 335 deletions
3
.gitignore
vendored
3
.gitignore
vendored
|
|
@ -19,3 +19,6 @@ __pycache__/
|
||||||
|
|
||||||
# Old B2G registry is unused by the modern host and contains historical paths.
|
# Old B2G registry is unused by the modern host and contains historical paths.
|
||||||
/assets/webapps/webapps.json
|
/assets/webapps/webapps.json
|
||||||
|
|
||||||
|
# Local issue tracking and roadmap; not included in publication.
|
||||||
|
/tickets/
|
||||||
|
|
|
||||||
21
README.fr.md
21
README.fr.md
|
|
@ -3,7 +3,7 @@
|
||||||
<h1 align="center">Vulpes OS</h1>
|
<h1 align="center">Vulpes OS</h1>
|
||||||
<p align="center"><strong>L'esprit de Firefox OS. Un Gecko moderne. Une base Gaia commune.</strong><br>Un projet communautaire pour retrouver une expérience mobile fondée sur le Web, sur PC, Android et téléphone natif.</p>
|
<p align="center"><strong>L'esprit de Firefox OS. Un Gecko moderne. Une base Gaia commune.</strong><br>Un projet communautaire pour retrouver une expérience mobile fondée sur le Web, sur PC, Android et téléphone natif.</p>
|
||||||
<p align="center">
|
<p align="center">
|
||||||
<img src="https://img.shields.io/badge/Vulpes-2.7_preview.15-0755be?style=flat-square" alt="Vulpes Preview 15">
|
<img src="https://img.shields.io/badge/Vulpes-2.7_preview.17-0755be?style=flat-square" alt="Vulpes Preview 17">
|
||||||
<img src="https://img.shields.io/badge/Gecko_bureau-156.0.1-0099cc?style=flat-square" alt="Gecko bureau 156.0.1">
|
<img src="https://img.shields.io/badge/Gecko_bureau-156.0.1-0099cc?style=flat-square" alt="Gecko bureau 156.0.1">
|
||||||
<img src="https://img.shields.io/badge/Statut-Expérimental-f3a712?style=flat-square" alt="Expérimental">
|
<img src="https://img.shields.io/badge/Statut-Expérimental-f3a712?style=flat-square" alt="Expérimental">
|
||||||
</p>
|
</p>
|
||||||
|
|
@ -26,9 +26,9 @@ Ce dépôt contient désormais l'interface commune, l'hôte PC, l'application An
|
||||||
| **APK Android** | Preview installable ; Android et ses permissions restent en dessous | GeckoView **156.0** |
|
| **APK Android** | Preview installable ; Android et ses permissions restent en dessous | GeckoView **156.0** |
|
||||||
| **Pixel 3a · Sargo** | Sources Tundra ; build natif de développement testé sur notre appareil | Gecko **156.0.1** ARM64 |
|
| **Pixel 3a · Sargo** | Sources Tundra ; build natif de développement testé sur notre appareil | Gecko **156.0.1** ARM64 |
|
||||||
|
|
||||||
### Android — Preview 15
|
### Android — Preview 17
|
||||||
|
|
||||||
Téléchargez l'APK et `SHA256SUMS.txt` depuis [la release Preview 15](https://nnsprod.com/git/oversu/VulpesOS/releases/tag/v2.7-preview.15). Une installation par-dessus une ancienne Preview Vulpes signée conserve ses données.
|
Téléchargez l'APK et `SHA256SUMS.txt` depuis [la release Preview 17](https://nnsprod.com/git/oversu/VulpesOS/releases/tag/v2.7-preview.17). Une installation par-dessus une ancienne Preview Vulpes signée conserve ses données.
|
||||||
|
|
||||||
- Minimum déclaré : **Android 8 / API 26**. Cible : **API 37**.
|
- Minimum déclaré : **Android 8 / API 26**. Cible : **API 37**.
|
||||||
- APK universel : **ARM64, ARMv7 et x86_64** ; environ **600 Mio**, moteur GeckoView inclus.
|
- APK universel : **ARM64, ARMv7 et x86_64** ; environ **600 Mio**, moteur GeckoView inclus.
|
||||||
|
|
@ -56,9 +56,20 @@ cd VulpesOS
|
||||||
|
|
||||||
Notre image de développement Sargo installée a passé les contrôles de démarrage et de persistance. Des appels réels et des SMS dans les deux sens ont été observés ; les derniers essais couvrent les conversations, les bascules de capteur photo, la capture JPEG pleine résolution, le focus tactile, le zoom numérique et l'arrêt du vibreur.
|
Notre image de développement Sargo installée a passé les contrôles de démarrage et de persistance. Des appels réels et des SMS dans les deux sens ont été observés ; les derniers essais couvrent les conversations, les bascules de capteur photo, la capture JPEG pleine résolution, le focus tactile, le zoom numérique et l'arrêt du vibreur.
|
||||||
|
|
||||||
**Cette release ne contient pas d'image générique à flasher.** Le boot privé dépend encore de la disposition du stockage du téléphone inventorié, d'images système/données déjà déployées et d'accès de maintenance. Publier ce fichier ne fournirait pas une installation fonctionnelle à un autre Pixel. Les recettes Tundra sont incluses pour les contributeurs ; elles nécessitent un inventaire, des sauvegardes vérifiées et des composants matériels fournis localement. Ne réutilisez pas la sauvegarde d'un autre appareil et ne considérez pas un boot isolé comme une ROM complète.
|
**Une installation autonome est maintenant testée localement.** Le paquet Fastboot fournit le système, un espace de données vierge et les composants matériels associés au noyau. Il remplace `userdata`, `boot_a`, `dtbo_a` et `vbmeta_a` : il n’utilise plus les fichiers d’une ancienne installation Droidian et ne nécessite pas de session Android ni d’ADB. Deux démarrages depuis le stockage interne ont passé chacun onze contrôles Gaia et dix contrôles natifs, avec conservation des réglages.
|
||||||
|
|
||||||
Les outils de préparation prennent désormais un dossier privé par appareil : inventaire, sauvegardes, construction RAM, transfert SSH et secours. La procédure reste réservée au noyau qualifié et à un stockage ext4/LVM compatible ; elle ne permet pas encore de partir directement d’Android d’origine.
|
L’installation demande un **Pixel 3a (Sargo) déverrouillé** et efface toutes les données de `userdata`. Le bootloader et les calibrations propres au téléphone restent en place. Ce candidat réserve actuellement 8 Gio au volume, dont 1 Gio de données modifiables ; l’extension automatique n’est pas encore implémentée. Il a été testé sur notre Pixel, pas sur chaque combinaison de firmware existante.
|
||||||
|
|
||||||
|
**Le paquet autonome n’est pas encore proposé en téléchargement dans cette release.** Les recettes et l’installateur sont préparés ; la revue de provenance et de redistribution des composants matériels reste à terminer. Les sauvegardes et les clés de maintenance du téléphone de développement ne font pas partie du paquet générique.
|
||||||
|
|
||||||
|
## 🛠️ Dernières évolutions des sources · 8 octobre 2026
|
||||||
|
|
||||||
|
- **Photo :** bascule des capteurs séquencée, libération fiable et transport des images corrigé. Capture avant/arrière, focus, zoom et ouverture dans Galerie testés sur notre Pixel 3a.
|
||||||
|
- **Contacts :** fiche actualisée après édition, parcours SMS/sélecteur/Téléphone rétablis et sélection d’une photo dans Galerie. Les tests PC couvrent recherche, recadrage, favoris et suppression ; les tests natifs couvrent création, édition et navigation entre applications.
|
||||||
|
- **Marketplace :** installation d’applications intégrée, permissions restreintes et retour contrôlé vers Gaia.
|
||||||
|
- **Tundra :** outils de build autonome et de restauration, paquets Bluetooth verrouillés et certificats natifs. La découverte matérielle Bluetooth fonctionne ; l’appairage Gaia et les profils restent à terminer.
|
||||||
|
|
||||||
|
**Ces changements de sources sont postérieurs à l’APK Preview 17 publié.** Les ressources Android sont préparées, mais aucun nouvel APK ni image native contenant tous ces correctifs n’est publié. Le dernier candidat natif est testé en RAM ; l’enregistrement cellulaire reste en cours d’analyse et l’audio des appels dans les deux sens n’est pas encore qualifié. L’historique commun PC/Android/Tundra se trouve dans [`changelog.json`](changelog.json).
|
||||||
|
|
||||||
## ✨ Ce que nous partageons
|
## ✨ Ce que nous partageons
|
||||||
|
|
||||||
|
|
|
||||||
21
README.md
21
README.md
|
|
@ -3,7 +3,7 @@
|
||||||
<h1 align="center">Vulpes OS</h1>
|
<h1 align="center">Vulpes OS</h1>
|
||||||
<p align="center"><strong>The spirit of Firefox OS. A modern Gecko. One shared Gaia.</strong><br>A community project bringing a web-based phone experience to desktop, Android and native hardware.</p>
|
<p align="center"><strong>The spirit of Firefox OS. A modern Gecko. One shared Gaia.</strong><br>A community project bringing a web-based phone experience to desktop, Android and native hardware.</p>
|
||||||
<p align="center">
|
<p align="center">
|
||||||
<img src="https://img.shields.io/badge/Vulpes-2.7_preview.15-0755be?style=flat-square" alt="Vulpes Preview 15">
|
<img src="https://img.shields.io/badge/Vulpes-2.7_preview.17-0755be?style=flat-square" alt="Vulpes Preview 17">
|
||||||
<img src="https://img.shields.io/badge/Desktop_Gecko-156.0.1-0099cc?style=flat-square" alt="Desktop Gecko 156.0.1">
|
<img src="https://img.shields.io/badge/Desktop_Gecko-156.0.1-0099cc?style=flat-square" alt="Desktop Gecko 156.0.1">
|
||||||
<img src="https://img.shields.io/badge/Status-Experimental-f3a712?style=flat-square" alt="Experimental">
|
<img src="https://img.shields.io/badge/Status-Experimental-f3a712?style=flat-square" alt="Experimental">
|
||||||
</p>
|
</p>
|
||||||
|
|
@ -26,9 +26,9 @@ This repository now contains the shared interface, desktop host, Android applica
|
||||||
| **Android APK** | Installable Preview; keeps Android and its permissions underneath | GeckoView **156.0** |
|
| **Android APK** | Installable Preview; keeps Android and its permissions underneath | GeckoView **156.0** |
|
||||||
| **Pixel 3a · Sargo** | Tundra sources; native development build tested on our device | Gecko **156.0.1** ARM64 |
|
| **Pixel 3a · Sargo** | Tundra sources; native development build tested on our device | Gecko **156.0.1** ARM64 |
|
||||||
|
|
||||||
### Android — Preview 15
|
### Android — Preview 17
|
||||||
|
|
||||||
Download the APK and `SHA256SUMS.txt` from [the Preview 15 release](https://nnsprod.com/git/oversu/VulpesOS/releases/tag/v2.7-preview.15). Installing over an earlier signed Vulpes Preview preserves its data.
|
Download the APK and `SHA256SUMS.txt` from [the Preview 17 release](https://nnsprod.com/git/oversu/VulpesOS/releases/tag/v2.7-preview.17). Installing over an earlier signed Vulpes Preview preserves its data.
|
||||||
|
|
||||||
- Minimum declared: **Android 8 / API 26**. Target: **API 37**.
|
- Minimum declared: **Android 8 / API 26**. Target: **API 37**.
|
||||||
- Universal APK: **ARM64, ARMv7 and x86_64**; approximately **600 MiB** including GeckoView.
|
- Universal APK: **ARM64, ARMv7 and x86_64**; approximately **600 MiB** including GeckoView.
|
||||||
|
|
@ -56,9 +56,20 @@ cd VulpesOS
|
||||||
|
|
||||||
Our installed Sargo development image has passed startup and persistence checks. Real calls and two-way SMS have been observed; the latest checks cover conversation rendering, camera sensor switching, full-resolution JPEG capture, touch focus, digital zoom and bounded vibration.
|
Our installed Sargo development image has passed startup and persistence checks. Real calls and two-way SMS have been observed; the latest checks cover conversation rendering, camera sensor switching, full-resolution JPEG capture, touch focus, digital zoom and bounded vibration.
|
||||||
|
|
||||||
**A generic flashable image is not included in this release.** The current private boot depends on the inventoried phone's storage layout, staged system/data images and maintenance credentials. Publishing that file would not give another Pixel a working installation. Tundra's source recipes are included for contributors; they require device inventory, verified backups and locally supplied hardware components. Do not use another device's backup or treat a boot image as a complete ROM.
|
**A standalone installation has now been tested locally.** The Fastboot package provides the system, fresh writable storage and the hardware components paired with the kernel. It replaces `userdata`, `boot_a`, `dtbo_a` and `vbmeta_a`: startup no longer uses files from an old Droidian installation and requires neither an Android session nor ADB. Two boots from internal storage passed eleven Gaia and ten native checks each and retained settings.
|
||||||
|
|
||||||
Preparation tools now accept a private workspace per device: inventory, backups, RAM builds, SSH transfers and recovery. The procedure remains limited to the qualified kernel and compatible ext4/LVM storage; it does not yet install directly from stock Android.
|
Installation requires an **unlocked Pixel 3a (Sargo)** and erases all existing `userdata`. The bootloader and device-specific calibration remain in place. This candidate currently reserves an 8 GiB volume, including 1 GiB of writable data; automatic expansion is not implemented yet. It has been tested on our Pixel, not every existing firmware combination.
|
||||||
|
|
||||||
|
**The standalone package is not yet available as a download in this release.** Build recipes and the installer are prepared; hardware component provenance and redistribution review are still pending. Development-phone backups and maintenance keys are excluded from the generic package.
|
||||||
|
|
||||||
|
## 🛠️ Latest source improvements · 8 October 2026
|
||||||
|
|
||||||
|
- **Camera:** serialized sensor switching, reliable release and binary photo transport. Front/rear capture, focus, zoom and Gallery opening tested on our Pixel 3a.
|
||||||
|
- **Contacts:** refreshed details after editing, restored SMS/number-picker/dialer flows, and Gallery photo selection. Desktop tests cover search, cropping, favourites and deletion; native tests cover creation, editing and cross-app navigation.
|
||||||
|
- **Marketplace:** integrated application installation with permission restrictions and controlled return to Gaia.
|
||||||
|
- **Tundra:** standalone build/recovery tools, pinned Bluetooth runtime packages and native trusted certificates. Bluetooth hardware discovery works; Gaia pairing and profiles remain unfinished.
|
||||||
|
|
||||||
|
**These are source updates, newer than the published Preview 17 APK.** Updated Android assets are prepared, but no new APK or native image containing all these fixes is published. The latest native candidate is tested in RAM; cellular registration remains under investigation and two-way call audio is not yet qualified. See [`changelog.json`](changelog.json) for the shared desktop/Android/Tundra history.
|
||||||
|
|
||||||
## ✨ What is shared
|
## ✨ What is shared
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -14,11 +14,13 @@ import java.util.zip.*;
|
||||||
final class GaiaServer implements Closeable {
|
final class GaiaServer implements Closeable {
|
||||||
|
|
||||||
static final int PORT = 18765;
|
static final int PORT = 18765;
|
||||||
|
final InstalledApps installed;
|
||||||
private final ZipFile zip;
|
private final ZipFile zip;
|
||||||
private final ServerSocket socket;
|
private final ServerSocket socket;
|
||||||
private final ExecutorService workers = Executors.newFixedThreadPool(4);
|
private final ExecutorService workers = Executors.newFixedThreadPool(4);
|
||||||
|
|
||||||
GaiaServer(Context context) throws IOException {
|
GaiaServer(Context context) throws IOException {
|
||||||
|
try {installed=new InstalledApps(context);}catch(Exception e){throw new IOException(e);}
|
||||||
File archive = new File(context.getCacheDir(), "gaia.zip");
|
File archive = new File(context.getCacheDir(), "gaia.zip");
|
||||||
// Atomic refresh on every process start; the APK is the source of truth.
|
// Atomic refresh on every process start; the APK is the source of truth.
|
||||||
File temp = new File(context.getCacheDir(), "gaia.zip.tmp");
|
File temp = new File(context.getCacheDir(), "gaia.zip.tmp");
|
||||||
|
|
@ -94,7 +96,7 @@ final class GaiaServer implements Closeable {
|
||||||
}
|
}
|
||||||
String app = host.substring(0, host.indexOf('.'));
|
String app = host.substring(0, host.indexOf('.'));
|
||||||
if (app.equals("theme")) app = "default_theme";
|
if (app.equals("theme")) app = "default_theme";
|
||||||
if (zip.getEntry(app + "/manifest.webapp") == null) {
|
if (!InstalledApps.valid(app) && zip.getEntry(app + "/manifest.webapp") == null) {
|
||||||
error(out, 404);
|
error(out, 404);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
@ -109,6 +111,16 @@ final class GaiaServer implements Closeable {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (path.endsWith("/")) path += "index.html";
|
if (path.endsWith("/")) path += "index.html";
|
||||||
|
if (InstalledApps.valid(app)) {
|
||||||
|
byte[] body=installed.read(app,path.substring(1));
|
||||||
|
if(body==null){error(out,404);return;}
|
||||||
|
String ext=path.substring(path.lastIndexOf('.')+1).toLowerCase(Locale.ROOT);
|
||||||
|
String mime=MimeTypeMap.getSingleton().getMimeTypeFromExtension(ext);
|
||||||
|
if(ext.equals("js"))mime="text/javascript";
|
||||||
|
if(ext.equals("webapp"))mime="application/json";
|
||||||
|
if(mime==null)mime="application/octet-stream";
|
||||||
|
out.write(("HTTP/1.1 200 OK\r\nContent-Type: "+mime+"\r\nContent-Length: "+body.length+"\r\nConnection: close\r\nX-Content-Type-Options: nosniff\r\nCache-Control: no-store\r\nAccess-Control-Allow-Origin: *\r\nContent-Security-Policy: object-src 'none'; frame-ancestors http://*.localhost:"+PORT+"\r\n\r\n").getBytes(StandardCharsets.US_ASCII));out.write(body);return;
|
||||||
|
}
|
||||||
String key = path.startsWith("/_vulpes/") ? path.substring(1) : app + path;
|
String key = path.startsWith("/_vulpes/") ? path.substring(1) : app + path;
|
||||||
ZipEntry entry = zip.getEntry(key);
|
ZipEntry entry = zip.getEntry(key);
|
||||||
if (entry == null && path.startsWith("/shared/")) entry = zip.getEntry(
|
if (entry == null && path.startsWith("/shared/")) entry = zip.getEntry(
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,37 @@
|
||||||
|
package org.vulpes_os.preview;
|
||||||
|
|
||||||
|
import android.content.Context;
|
||||||
|
import java.io.*;
|
||||||
|
import java.nio.charset.StandardCharsets;
|
||||||
|
import java.nio.file.*;
|
||||||
|
import java.util.*;
|
||||||
|
import org.json.*;
|
||||||
|
|
||||||
|
final class InstalledApps {
|
||||||
|
private final File root;
|
||||||
|
private final Map<String,JSONObject> items = new HashMap<>();
|
||||||
|
InstalledApps(Context context) throws Exception {
|
||||||
|
root=new File(context.getFilesDir(),"installed-apps");root.mkdirs();
|
||||||
|
File[] files=root.listFiles((d,n)->n.matches("user-[a-f0-9]{24}\\.json"));
|
||||||
|
if(files!=null)for(File file:files){JSONObject item=new JSONObject(new String(Files.readAllBytes(file.toPath()),StandardCharsets.UTF_8));items.put(item.getString("id"),item);}
|
||||||
|
}
|
||||||
|
static boolean valid(String id){return id!=null && id.matches("user-[a-f0-9]{24}");}
|
||||||
|
private JSONObject record(JSONObject item) throws Exception {
|
||||||
|
String id=item.getString("id"),origin="http://"+id+".localhost:"+GaiaServer.PORT;
|
||||||
|
JSONObject manifest=new JSONObject(item.getJSONObject("manifest").toString());manifest.put("permissions",new JSONObject());manifest.put("type","web");
|
||||||
|
return new JSONObject().put("id",id).put("origin",origin).put("manifestURL",origin+"/manifest.webapp").put("manifest",manifest).put("removable",true).put("installed",true);
|
||||||
|
}
|
||||||
|
synchronized JSONArray list() throws Exception {JSONArray result=new JSONArray();for(JSONObject item:items.values())result.put(record(item));return result;}
|
||||||
|
synchronized void save(JSONObject item) throws Exception {
|
||||||
|
String id=item.getString("id");if(!valid(id) || !item.has("files"))throw new IOException("INVALID_PACKAGE");
|
||||||
|
byte[] data=item.toString().getBytes(StandardCharsets.UTF_8);if(data.length>70*1024*1024)throw new IOException("PACKAGE_TOO_LARGE");
|
||||||
|
File stage=new File(root,id+".tmp");try(FileOutputStream out=new FileOutputStream(stage)){out.write(data);out.getFD().sync();}
|
||||||
|
Files.move(stage.toPath(),new File(root,id+".json").toPath(),StandardCopyOption.REPLACE_EXISTING);items.put(id,item);
|
||||||
|
}
|
||||||
|
synchronized void remove(String id) throws Exception {if(!valid(id))throw new IOException("NOT_REMOVABLE");Files.deleteIfExists(new File(root,id+".json").toPath());items.remove(id);}
|
||||||
|
synchronized byte[] read(String id,String path) throws Exception {
|
||||||
|
JSONObject item=items.get(id);if(item==null)return null;
|
||||||
|
if(path.equals("manifest.webapp"))return record(item).getJSONObject("manifest").toString().getBytes(StandardCharsets.UTF_8);
|
||||||
|
String data=item.getJSONObject("files").optString(path,null);return data==null?null:android.util.Base64.decode(data,android.util.Base64.DEFAULT);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -45,8 +45,7 @@ public final class MainActivity extends Activity {
|
||||||
root.setOnApplyWindowInsetsListener((v, insets) -> {
|
root.setOnApplyWindowInsetsListener((v, insets) -> {
|
||||||
if (Build.VERSION.SDK_INT >= 30) {
|
if (Build.VERSION.SDK_INT >= 30) {
|
||||||
android.graphics.Insets bars = insets.getInsets(
|
android.graphics.Insets bars = insets.getInsets(
|
||||||
WindowInsets.Type.systemBars() |
|
WindowInsets.Type.ime() |
|
||||||
WindowInsets.Type.ime() |
|
|
||||||
WindowInsets.Type.displayCutout()
|
WindowInsets.Type.displayCutout()
|
||||||
);
|
);
|
||||||
v.setPadding(bars.left, bars.top, bars.right, bars.bottom);
|
v.setPadding(bars.left, bars.top, bars.right, bars.bottom);
|
||||||
|
|
@ -54,11 +53,12 @@ public final class MainActivity extends Activity {
|
||||||
insets.getSystemWindowInsetLeft(),
|
insets.getSystemWindowInsetLeft(),
|
||||||
insets.getSystemWindowInsetTop(),
|
insets.getSystemWindowInsetTop(),
|
||||||
insets.getSystemWindowInsetRight(),
|
insets.getSystemWindowInsetRight(),
|
||||||
insets.getSystemWindowInsetBottom()
|
insets.getSystemWindowInsetBottom() > dp(100) ? insets.getSystemWindowInsetBottom() : 0
|
||||||
);
|
);
|
||||||
return insets;
|
return insets;
|
||||||
});
|
});
|
||||||
setContentView(root);
|
setContentView(root);
|
||||||
|
immersive();
|
||||||
// Respect Android's screen timeout; Gaia must not keep the phone awake indefinitely.
|
// Respect Android's screen timeout; Gaia must not keep the phone awake indefinitely.
|
||||||
float brightness = app.getSharedPreferences("android", 0).getFloat("brightness", -1);
|
float brightness = app.getSharedPreferences("android", 0).getFloat("brightness", -1);
|
||||||
if (brightness >= 0) {
|
if (brightness >= 0) {
|
||||||
|
|
@ -166,6 +166,28 @@ public final class MainActivity extends Activity {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void immersive() {
|
||||||
|
if (Build.VERSION.SDK_INT >= 30) {
|
||||||
|
getWindow().setDecorFitsSystemWindows(false);
|
||||||
|
WindowInsetsController controller = getWindow().getInsetsController();
|
||||||
|
if (controller != null) {
|
||||||
|
controller.setSystemBarsBehavior(WindowInsetsController.BEHAVIOR_SHOW_TRANSIENT_BARS_BY_SWIPE);
|
||||||
|
controller.hide(WindowInsets.Type.systemBars());
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
getWindow().getDecorView().setSystemUiVisibility(
|
||||||
|
View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY | View.SYSTEM_UI_FLAG_FULLSCREEN |
|
||||||
|
View.SYSTEM_UI_FLAG_HIDE_NAVIGATION | View.SYSTEM_UI_FLAG_LAYOUT_STABLE |
|
||||||
|
View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN | View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onWindowFocusChanged(boolean focused) {
|
||||||
|
super.onWindowFocusChanged(focused);
|
||||||
|
if (focused) immersive();
|
||||||
|
}
|
||||||
|
|
||||||
private int dp(int value) {
|
private int dp(int value) {
|
||||||
return Math.round(value * getResources().getDisplayMetrics().density);
|
return Math.round(value * getResources().getDisplayMetrics().density);
|
||||||
}
|
}
|
||||||
|
|
@ -274,7 +296,7 @@ public final class MainActivity extends Activity {
|
||||||
setHomeSurface(app.homeVisible);
|
setHomeSurface(app.homeVisible);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void closeBrowser() {
|
void closeBrowser() {
|
||||||
webPanel.setVisibility(View.GONE);
|
webPanel.setVisibility(View.GONE);
|
||||||
gaiaView.setVisibility(View.VISIBLE);
|
gaiaView.setVisibility(View.VISIBLE);
|
||||||
setHomeSurface(app.homeVisible);
|
setHomeSurface(app.homeVisible);
|
||||||
|
|
@ -356,6 +378,7 @@ public final class MainActivity extends Activity {
|
||||||
public void onResume() {
|
public void onResume() {
|
||||||
super.onResume();
|
super.onResume();
|
||||||
resumed = true;
|
resumed = true;
|
||||||
|
immersive();
|
||||||
app.activity = this;
|
app.activity = this;
|
||||||
if (recoverGaia) {
|
if (recoverGaia) {
|
||||||
recoverGaia = false;
|
recoverGaia = false;
|
||||||
|
|
|
||||||
|
|
@ -17,9 +17,32 @@ public final class VulpesApplication extends Application {
|
||||||
GeckoSession gaiaSession;
|
GeckoSession gaiaSession;
|
||||||
AndroidServices services;
|
AndroidServices services;
|
||||||
AndroidNotifications notifications;
|
AndroidNotifications notifications;
|
||||||
|
boolean pendingScreenLock;
|
||||||
boolean homeVisible;
|
boolean homeVisible;
|
||||||
boolean homeAtBottom;
|
boolean homeAtBottom;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onCreate() {
|
||||||
|
super.onCreate();
|
||||||
|
android.content.BroadcastReceiver receiver = new android.content.BroadcastReceiver() {
|
||||||
|
@Override public void onReceive(android.content.Context context, android.content.Intent intent) {
|
||||||
|
pendingScreenLock = true;
|
||||||
|
sendScreenLock();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
android.content.IntentFilter filter = new android.content.IntentFilter(android.content.Intent.ACTION_SCREEN_OFF);
|
||||||
|
if (android.os.Build.VERSION.SDK_INT >= 33) registerReceiver(receiver,filter,RECEIVER_NOT_EXPORTED);
|
||||||
|
else registerReceiver(receiver,filter);
|
||||||
|
}
|
||||||
|
|
||||||
|
void sendScreenLock() {
|
||||||
|
if (port == null || !pendingScreenLock) return;
|
||||||
|
try {
|
||||||
|
port.postMessage(new JSONObject().put("type","android-screen-off"));
|
||||||
|
pendingScreenLock = false;
|
||||||
|
} catch (Exception error) {Log.w("Vulpes","Screen lock pending",error);}
|
||||||
|
}
|
||||||
|
|
||||||
void prepare() throws IOException {
|
void prepare() throws IOException {
|
||||||
if (runtime != null) return;
|
if (runtime != null) return;
|
||||||
server = new GaiaServer(this);
|
server = new GaiaServer(this);
|
||||||
|
|
@ -58,6 +81,7 @@ public final class VulpesApplication extends Application {
|
||||||
@Override
|
@Override
|
||||||
public void onConnect(WebExtension.Port p) {
|
public void onConnect(WebExtension.Port p) {
|
||||||
port = p;
|
port = p;
|
||||||
|
sendScreenLock();
|
||||||
if (activity != null) notifications.click(activity.getIntent());
|
if (activity != null) notifications.click(activity.getIntent());
|
||||||
p.setDelegate(
|
p.setDelegate(
|
||||||
new WebExtension.PortDelegate() {
|
new WebExtension.PortDelegate() {
|
||||||
|
|
@ -80,6 +104,18 @@ public final class VulpesApplication extends Application {
|
||||||
return GeckoResult.fromException(new SecurityException("EXTENSION_REQUIRED"));
|
return GeckoResult.fromException(new SecurityException("EXTENSION_REQUIRED"));
|
||||||
}
|
}
|
||||||
JSONObject json = (JSONObject) message;
|
JSONObject json = (JSONObject) message;
|
||||||
|
if (json.optString("type").equals("marketplace.return") && activity!=null) {activity.runOnUiThread(()->activity.closeBrowser());return GeckoResult.fromValue(null);}
|
||||||
|
if (json.optString("type").startsWith("packages.")) {
|
||||||
|
GeckoResult<Object> result=new GeckoResult<>();
|
||||||
|
new Thread(()->{try {
|
||||||
|
String operation=json.getString("type");
|
||||||
|
if(operation.equals("packages.save"))server.installed.save(json.getJSONObject("item"));
|
||||||
|
else if(operation.equals("packages.remove"))server.installed.remove(json.getString("id"));
|
||||||
|
else if(!operation.equals("packages.list"))throw new IOException("INVALID_OPERATION");
|
||||||
|
result.complete(server.installed.list().toString());
|
||||||
|
}catch(Exception error){result.completeExceptionally(error);}},"Vulpes-packages").start();
|
||||||
|
return result;
|
||||||
|
}
|
||||||
if (json.optString("type").equals("homeScroll")) {
|
if (json.optString("type").equals("homeScroll")) {
|
||||||
homeAtBottom = json.optBoolean("bottom");
|
homeAtBottom = json.optBoolean("bottom");
|
||||||
if (activity != null) activity.setHomeSurface(homeVisible);
|
if (activity != null) activity.setHomeSurface(homeVisible);
|
||||||
|
|
@ -124,6 +160,7 @@ public final class VulpesApplication extends Application {
|
||||||
}
|
}
|
||||||
|
|
||||||
void resumed() {
|
void resumed() {
|
||||||
|
sendScreenLock();
|
||||||
if (port == null) return;
|
if (port == null) return;
|
||||||
try {
|
try {
|
||||||
port.postMessage(new JSONObject().put("type", "android-resume"));
|
port.postMessage(new JSONObject().put("type", "android-resume"));
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,5 @@
|
||||||
|
import { Packages, packageURL } from './services/packages.mjs';
|
||||||
|
import { Activities, isGaiaActivity } from './services/activities.mjs';
|
||||||
import { authorizePlatform } from './services/platform.mjs';
|
import { authorizePlatform } from './services/platform.mjs';
|
||||||
import { SettingsService } from './services/settings.mjs';
|
import { SettingsService } from './services/settings.mjs';
|
||||||
import { DataStoreService } from './services/datastores.mjs';
|
import { DataStoreService } from './services/datastores.mjs';
|
||||||
|
|
@ -7,6 +9,9 @@ import { Messages } from './Messages.mjs';
|
||||||
import { Connections } from './Connections.mjs';
|
import { Connections } from './Connections.mjs';
|
||||||
import { Alarms } from './Alarms.mjs';
|
import { Alarms } from './Alarms.mjs';
|
||||||
const peers = new Set();
|
const peers = new Set();
|
||||||
|
let activities, packages;
|
||||||
|
const nativePackages=(operation,data={})=>browser.runtime.sendNativeMessage('vulpes',{type:'packages.'+operation,...data}).then(JSON.parse);
|
||||||
|
async function refreshInstalled(){const installed=await nativePackages('list');apps.splice(0,apps.length,...apps.filter(a=>!a.installed),...installed);}
|
||||||
let apps, values, settings, dataStores, contacts, messages, connections, alarms, storage;
|
let apps, values, settings, dataStores, contacts, messages, connections, alarms, storage;
|
||||||
const identity = (peer) => peer.app;
|
const identity = (peer) => peer.app;
|
||||||
function notify(peer, type, data) {
|
function notify(peer, type, data) {
|
||||||
|
|
@ -26,7 +31,7 @@ function grants(app) {
|
||||||
function broadcast(type, data, target) {
|
function broadcast(type, data, target) {
|
||||||
for (const peer of peers) {
|
for (const peer of peers) {
|
||||||
if (target && peer.app.id !== target) continue;
|
if (target && peer.app.id !== target) continue;
|
||||||
if (type === 'settingchange' && !grants(peer.app).includes('settings.read')) continue;
|
if (type === 'settingchange' && data.key !== 'language.current' && !grants(peer.app).includes('settings.read')) continue;
|
||||||
if (
|
if (
|
||||||
type === 'contactchange' &&
|
type === 'contactchange' &&
|
||||||
!peer.app.manifest.permissions?.contacts?.access?.includes('read')
|
!peer.app.manifest.permissions?.contacts?.access?.includes('read')
|
||||||
|
|
@ -45,7 +50,7 @@ function broadcast(type, data, target) {
|
||||||
notify(peer, type, data);
|
notify(peer, type, data);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
function launch(target, entryPoint, path) {
|
function launch(target, entryPoint, path, reload = false) {
|
||||||
path ||=
|
path ||=
|
||||||
target.manifest.entry_points?.[entryPoint]?.launch_path ||
|
target.manifest.entry_points?.[entryPoint]?.launch_path ||
|
||||||
target.manifest.launch_path ||
|
target.manifest.launch_path ||
|
||||||
|
|
@ -53,7 +58,7 @@ function launch(target, entryPoint, path) {
|
||||||
const url = new URL(path, target.origin);
|
const url = new URL(path, target.origin);
|
||||||
if (url.origin !== target.origin) throw Error('INVALID_URL');
|
if (url.origin !== target.origin) throw Error('INVALID_URL');
|
||||||
broadcast(
|
broadcast(
|
||||||
'launch',
|
reload ? 'activity-launch' : 'launch',
|
||||||
{
|
{
|
||||||
manifestURL: target.manifestURL,
|
manifestURL: target.manifestURL,
|
||||||
origin: target.origin,
|
origin: target.origin,
|
||||||
|
|
@ -66,6 +71,8 @@ function launch(target, entryPoint, path) {
|
||||||
}
|
}
|
||||||
const ready = (async () => {
|
const ready = (async () => {
|
||||||
apps = await (await fetch('registry.json')).json();
|
apps = await (await fetch('registry.json')).json();
|
||||||
|
await refreshInstalled();
|
||||||
|
packages=new Packages({save:item=>nativePackages('save',{item}),changed:refreshInstalled});
|
||||||
const defaults = await (await fetch('defaults.json')).json();
|
const defaults = await (await fetch('defaults.json')).json();
|
||||||
const saved = await browser.storage.local.get('settings');
|
const saved = await browser.storage.local.get('settings');
|
||||||
values = { ...defaults, ...saved.settings };
|
values = { ...defaults, ...saved.settings };
|
||||||
|
|
@ -82,6 +89,8 @@ const ready = (async () => {
|
||||||
values['wallpaper.image.valid'] = false;
|
values['wallpaper.image.valid'] = false;
|
||||||
await browser.storage.local.set({ settings: values });
|
await browser.storage.local.set({ settings: values });
|
||||||
}
|
}
|
||||||
|
activities = new Activities({identity,apps:()=>apps,notify,uuid:()=>crypto.randomUUID(),
|
||||||
|
launch:(target,path,{reload=false,entryPoint}={})=>launch(target,entryPoint,path,reload)});
|
||||||
let writes = Promise.resolve();
|
let writes = Promise.resolve();
|
||||||
settings = new SettingsService(
|
settings = new SettingsService(
|
||||||
{
|
{
|
||||||
|
|
@ -123,6 +132,12 @@ const ready = (async () => {
|
||||||
// Java owns this port. Web pages have no access to native messaging.
|
// Java owns this port. Web pages have no access to native messaging.
|
||||||
let native;
|
let native;
|
||||||
let systemReady = false;
|
let systemReady = false;
|
||||||
|
let pendingScreenLock = false;
|
||||||
|
function deliverScreenLock() {
|
||||||
|
if (!systemReady || !pendingScreenLock) return;
|
||||||
|
pendingScreenLock = false;
|
||||||
|
broadcast('screen-off', {}, 'system');
|
||||||
|
}
|
||||||
let pendingNotification;
|
let pendingNotification;
|
||||||
function deliverNotification() {
|
function deliverNotification() {
|
||||||
if (!systemReady || !pendingNotification) return;
|
if (!systemReady || !pendingNotification) return;
|
||||||
|
|
@ -140,7 +155,15 @@ function connectNative() {
|
||||||
native.onMessage.addListener(async (message) => {
|
native.onMessage.addListener(async (message) => {
|
||||||
await ready;
|
await ready;
|
||||||
if (['home', 'holdhome'].includes(message.type)) broadcast(message.type, {}, 'system');
|
if (['home', 'holdhome'].includes(message.type)) broadcast(message.type, {}, 'system');
|
||||||
if (message.type === 'android-resume') await refreshAndroid().catch(console.warn);
|
if (message.type === 'android-screen-off') {
|
||||||
|
pendingScreenLock = true;
|
||||||
|
deliverScreenLock();
|
||||||
|
}
|
||||||
|
if (message.type === 'android-resume') {
|
||||||
|
deliverScreenLock();
|
||||||
|
broadcast('screen-on', {}, 'system');
|
||||||
|
await refreshAndroid().catch(console.warn);
|
||||||
|
}
|
||||||
if (message.type === 'notification-click') {
|
if (message.type === 'notification-click') {
|
||||||
pendingNotification = message.data;
|
pendingNotification = message.data;
|
||||||
deliverNotification();
|
deliverNotification();
|
||||||
|
|
@ -206,6 +229,7 @@ async function handle(peer, request) {
|
||||||
if (method === 'android.systemReady') {
|
if (method === 'android.systemReady') {
|
||||||
if (app.id !== 'system') throw Error('PERMISSION_DENIED');
|
if (app.id !== 'system') throw Error('PERMISSION_DENIED');
|
||||||
systemReady = true;
|
systemReady = true;
|
||||||
|
deliverScreenLock();
|
||||||
deliverNotification();
|
deliverNotification();
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
@ -278,6 +302,7 @@ async function handle(peer, request) {
|
||||||
}
|
}
|
||||||
if (!Object.keys(params.values).length) return null;
|
if (!Object.keys(params.values).length) return null;
|
||||||
}
|
}
|
||||||
|
if (method === 'locale.current') return values['language.current'] || 'en-US';
|
||||||
if (method === 'settings.snapshot') {
|
if (method === 'settings.snapshot') {
|
||||||
if (!grants(app).includes('settings.read')) throw Error('PERMISSION_DENIED');
|
if (!grants(app).includes('settings.read')) throw Error('PERMISSION_DENIED');
|
||||||
return { ...values };
|
return { ...values };
|
||||||
|
|
@ -287,6 +312,14 @@ async function handle(peer, request) {
|
||||||
if (reply.error) throw Error(reply.error.code);
|
if (reply.error) throw Error(reply.error.code);
|
||||||
return reply.result;
|
return reply.result;
|
||||||
}
|
}
|
||||||
|
if(method.startsWith('marketplace.')) {
|
||||||
|
if(app.id!=='marketplace')throw Error('PERMISSION_DENIED');
|
||||||
|
if(method==='marketplace.poll'){const url=marketplaceDownload;marketplaceDownload=null;return url;}
|
||||||
|
if(method==='marketplace.cancel'){packages.cancel();return true;}
|
||||||
|
if(method==='marketplace.prepare')return packages.prepare(params.url);
|
||||||
|
if(method==='marketplace.install'){const id=await packages.install(params.token);const installed=apps.find(a=>a.id===id);broadcast('apps-installed',installed);return installed;}
|
||||||
|
throw Error('METHOD_NOT_SUPPORTED');
|
||||||
|
}
|
||||||
if (method === 'apps.self') {
|
if (method === 'apps.self') {
|
||||||
console.info('VULPES app ready', app.id);
|
console.info('VULPES app ready', app.id);
|
||||||
return app;
|
return app;
|
||||||
|
|
@ -298,6 +331,10 @@ async function handle(peer, request) {
|
||||||
if (!manage) throw Error('PERMISSION_DENIED');
|
if (!manage) throw Error('PERMISSION_DENIED');
|
||||||
return apps;
|
return apps;
|
||||||
}
|
}
|
||||||
|
if(method==='apps.uninstall') {
|
||||||
|
const installed=apps.find(a=>a.id===params.id && a.installed);if(!manage || !installed)throw Error('PERMISSION_DENIED');
|
||||||
|
await nativePackages('remove',{id:params.id});await refreshInstalled();broadcast('apps-uninstalled',installed);return true;
|
||||||
|
}
|
||||||
if (method === 'apps.launch') {
|
if (method === 'apps.launch') {
|
||||||
const target = apps.find((a) => a.manifestURL === params.manifestURL);
|
const target = apps.find((a) => a.manifestURL === params.manifestURL);
|
||||||
if (!target || (!manage && app.id !== target.id)) throw Error('PERMISSION_DENIED');
|
if (!target || (!manage && app.id !== target.id)) throw Error('PERMISSION_DENIED');
|
||||||
|
|
@ -319,9 +356,13 @@ async function handle(peer, request) {
|
||||||
connections.close(peer, params.id);
|
connections.close(peer, params.id);
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
if (method === 'activities.cancel') return activities.cancel(peer);
|
||||||
|
if (method === 'activities.subscribe') return activities.subscribe(peer);
|
||||||
|
if (method === 'activities.finish') return activities.finish(peer,params);
|
||||||
|
if (method === 'activities.start' && isGaiaActivity(params)) return activities.start(peer,params);
|
||||||
if (method === 'activities.start') {
|
if (method === 'activities.start') {
|
||||||
if (params.name === 'record' && params.data?.type === 'photos') {
|
if (params.name === 'record' && params.data?.type === 'photos') {
|
||||||
if (app.id === 'gallery') {
|
if (['gallery', 'system'].includes(app.id)) {
|
||||||
const camera = apps.find((a) => a.id === 'camera');
|
const camera = apps.find((a) => a.id === 'camera');
|
||||||
if (!camera) throw Error('ACTIVITY_NOT_SUPPORTED');
|
if (!camera) throw Error('ACTIVITY_NOT_SUPPORTED');
|
||||||
launch(camera);
|
launch(camera);
|
||||||
|
|
@ -430,9 +471,21 @@ browser.runtime.onConnect.addListener((port) => {
|
||||||
peers.delete(peer);
|
peers.delete(peer);
|
||||||
if (peer.app.id === 'system' && ![...peers].some((p) => p.app.id === 'system'))
|
if (peer.app.id === 'system' && ![...peers].some((p) => p.app.id === 'system'))
|
||||||
systemReady = false;
|
systemReady = false;
|
||||||
|
activities.cleanup(peer);
|
||||||
connections.cleanup(peer);
|
connections.cleanup(peer);
|
||||||
alarms.cleanup(peer);
|
alarms.cleanup(peer);
|
||||||
})
|
})
|
||||||
.catch(() => {});
|
.catch(() => {});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
let marketplaceDownload=null;
|
||||||
|
browser.runtime.onMessage.addListener(async (message,sender)=>{
|
||||||
|
if(!message.marketplaceDownload)return;
|
||||||
|
const origin=new URL(sender.url);
|
||||||
|
if(origin.origin!=='https://vulpes-os.org' || !origin.pathname.startsWith('/marketplace/'))throw Error('PERMISSION_DENIED');
|
||||||
|
await ready;marketplaceDownload=packageURL(message.marketplaceDownload);
|
||||||
|
const app=apps.find(a=>a.id==='marketplace');launch(app);
|
||||||
|
await browser.runtime.sendNativeMessage('vulpes',{type:'marketplace.return'});
|
||||||
|
return true;
|
||||||
|
});
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
/* Extension world: the browser provides origin/tab/frame identity, never Gaia. */
|
/* Extension world: the browser provides origin/tab/frame identity, never Gaia. */
|
||||||
(() => {
|
(() => {
|
||||||
if (location.port !== '18765') return;
|
if (location.port !== '18765' || location.hostname.startsWith('user-')) return;
|
||||||
const win = window.wrappedJSObject;
|
const win = window.wrappedJSObject;
|
||||||
console.info('VULPES Android bridge', location.origin);
|
console.info('VULPES Android bridge', location.origin);
|
||||||
let port;
|
let port;
|
||||||
|
|
|
||||||
|
|
@ -1 +1,45 @@
|
||||||
{"manifest_version":2,"name":"Vulpes Android host","version":"1.1","browser_specific_settings":{"gecko":{"id":"android-host@vulpes-os.org"}},"permissions":["storage","unlimitedStorage","nativeMessaging","geckoViewAddons","http://*.localhost/*"],"background":{"page":"background.html","persistent":true},"content_scripts":[{"matches":["http://*.localhost/*"],"js":["content.js"],"all_frames":true,"run_at":"document_start"}]}
|
{
|
||||||
|
"manifest_version": 2,
|
||||||
|
"name": "Vulpes Android host",
|
||||||
|
"version": "1.1",
|
||||||
|
"browser_specific_settings": {
|
||||||
|
"gecko": {
|
||||||
|
"id": "android-host@vulpes-os.org"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"permissions": [
|
||||||
|
"storage",
|
||||||
|
"unlimitedStorage",
|
||||||
|
"nativeMessaging",
|
||||||
|
"geckoViewAddons",
|
||||||
|
"http://*.localhost/*",
|
||||||
|
"https://vulpes-os.org/*"
|
||||||
|
],
|
||||||
|
"background": {
|
||||||
|
"page": "background.html",
|
||||||
|
"persistent": true
|
||||||
|
},
|
||||||
|
"content_scripts": [
|
||||||
|
{
|
||||||
|
"matches": [
|
||||||
|
"http://*.localhost/*"
|
||||||
|
],
|
||||||
|
"js": [
|
||||||
|
"content.js"
|
||||||
|
],
|
||||||
|
"all_frames": true,
|
||||||
|
"run_at": "document_start"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"matches": [
|
||||||
|
"https://vulpes-os.org/marketplace/*"
|
||||||
|
],
|
||||||
|
"js": [
|
||||||
|
"marketplace-page.js",
|
||||||
|
"marketplace-content.js"
|
||||||
|
],
|
||||||
|
"all_frames": true,
|
||||||
|
"run_at": "document_end"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
|
||||||
1
android/extension/marketplace-content.js
Normal file
1
android/extension/marketplace-content.js
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
installMarketplacePage(window,url=>browser.runtime.sendMessage({marketplaceDownload:url}).catch(console.error));
|
||||||
|
|
@ -5,10 +5,10 @@ import { SettingsService } from '../../services/settings.mjs';
|
||||||
|
|
||||||
const context = vm.createContext({ window: {}, Blob, Uint8Array, btoa, atob });
|
const context = vm.createContext({ window: {}, Blob, Uint8Array, btoa, atob });
|
||||||
vm.runInContext(
|
vm.runInContext(
|
||||||
await readFile(new URL('../ui/settings-codec.js', import.meta.url), 'utf8'),
|
await readFile(new URL('../../host/settings-codec.js', import.meta.url), 'utf8'),
|
||||||
context,
|
context,
|
||||||
);
|
);
|
||||||
const { encode, decode } = context.window.VulpesAndroidSettingsCodec;
|
const { encode, decode } = context.window.VulpesSettingsCodec;
|
||||||
// A binary wallpaper larger than the original 1 MiB JSON ceiling, including
|
// A binary wallpaper larger than the original 1 MiB JSON ceiling, including
|
||||||
// every byte value. Exercise the actual service, JSON storage and observer path.
|
// every byte value. Exercise the actual service, JSON storage and observer path.
|
||||||
const pixels = Uint8Array.from({ length: 1200000 }, (_, i) => i % 256);
|
const pixels = Uint8Array.from({ length: 1200000 }, (_, i) => i % 256);
|
||||||
|
|
|
||||||
|
|
@ -12,7 +12,7 @@ from pathlib import Path
|
||||||
|
|
||||||
ROOT = Path(__file__).resolve().parents[2]
|
ROOT = Path(__file__).resolve().parents[2]
|
||||||
sys.path.insert(0, str(ROOT / "tools"))
|
sys.path.insert(0, str(ROOT / "tools"))
|
||||||
from project import build_info, validate_assets, release_info
|
from project import build_info, validate_assets, release_info, application_manifest
|
||||||
|
|
||||||
validate_assets()
|
validate_assets()
|
||||||
OUT = ROOT / "android/app/src/main/assets"
|
OUT = ROOT / "android/app/src/main/assets"
|
||||||
|
|
@ -39,7 +39,7 @@ for manifest in sorted(APPS.glob("*/manifest.webapp")):
|
||||||
id=name,
|
id=name,
|
||||||
origin=origin,
|
origin=origin,
|
||||||
manifestURL=origin + "/manifest.webapp",
|
manifestURL=origin + "/manifest.webapp",
|
||||||
manifest=json.loads(translate(manifest.read_text())),
|
manifest=application_manifest(name, json.loads(translate(manifest.read_text())), "--include-dev-apps" in sys.argv),
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
info = build_info()
|
info = build_info()
|
||||||
|
|
@ -126,7 +126,7 @@ if "--bridge-only" not in sys.argv or not (OUT / "gaia.zip").exists():
|
||||||
.read_text()
|
.read_text()
|
||||||
)
|
)
|
||||||
put("_vulpes/" + name, translate(text).encode())
|
put("_vulpes/" + name, translate(text).encode())
|
||||||
put("_vulpes/settings-codec.js", (ROOT / "android/ui/settings-codec.js").read_bytes())
|
put("_vulpes/settings-codec.js", (ROOT / "host/settings-codec.js").read_bytes())
|
||||||
put("_vulpes/android-ui.js", (ROOT / "android/ui/android-ui.js").read_bytes())
|
put("_vulpes/android-ui.js", (ROOT / "android/ui/android-ui.js").read_bytes())
|
||||||
put(
|
put(
|
||||||
"_vulpes/android.css",
|
"_vulpes/android.css",
|
||||||
|
|
@ -145,6 +145,7 @@ for name in ["Connections", "Contacts", "Messages"]:
|
||||||
)
|
)
|
||||||
(ext / f"{name}.mjs").write_text(text)
|
(ext / f"{name}.mjs").write_text(text)
|
||||||
shutil.copy2(ROOT / "host/Alarms.sys.mjs", ext / "Alarms.mjs")
|
shutil.copy2(ROOT / "host/Alarms.sys.mjs", ext / "Alarms.mjs")
|
||||||
|
shutil.copy2(ROOT / "host/marketplace-page.js", ext / "marketplace-page.js")
|
||||||
(ext / "release.json").write_text(json.dumps(release))
|
(ext / "release.json").write_text(json.dumps(release))
|
||||||
(ext / "registry.json").write_text(json.dumps(registry, ensure_ascii=False))
|
(ext / "registry.json").write_text(json.dumps(registry, ensure_ascii=False))
|
||||||
settings = json.loads(translate((ROOT / "assets/settings-defaults.json").read_text()))
|
settings = json.loads(translate((ROOT / "assets/settings-defaults.json").read_text()))
|
||||||
|
|
|
||||||
|
|
@ -19,7 +19,7 @@ const VCARD_MIME_TYPES = [
|
||||||
var ActivityHandler = {
|
var ActivityHandler = {
|
||||||
_currentActivity: null,
|
_currentActivity: null,
|
||||||
|
|
||||||
_launchedAsInlineActivity: (window.location.search == '?pick'),
|
_launchedAsInlineActivity: new URLSearchParams(window.location.search).has('pick'),
|
||||||
|
|
||||||
mozContactParam: null,
|
mozContactParam: null,
|
||||||
|
|
||||||
|
|
@ -124,6 +124,7 @@ var ActivityHandler = {
|
||||||
this.launch_activity(activity, 'add-parameters');
|
this.launch_activity(activity, 'add-parameters');
|
||||||
break;
|
break;
|
||||||
case 'pick':
|
case 'pick':
|
||||||
|
if (window.VulpesCompat) this._launchedAsInlineActivity = true;
|
||||||
if (!this._launchedAsInlineActivity) {
|
if (!this._launchedAsInlineActivity) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
@ -356,15 +357,18 @@ var ActivityHandler = {
|
||||||
postNewSuccess: function ah_postNewSuccess(contact) {
|
postNewSuccess: function ah_postNewSuccess(contact) {
|
||||||
this._currentActivity.postResult({ contact: contact });
|
this._currentActivity.postResult({ contact: contact });
|
||||||
this._currentActivity = null;
|
this._currentActivity = null;
|
||||||
|
if (window.VulpesCompat) this._launchedAsInlineActivity = false;
|
||||||
},
|
},
|
||||||
|
|
||||||
postPickSuccess: function ah_postPickSuccess(result) {
|
postPickSuccess: function ah_postPickSuccess(result) {
|
||||||
this._currentActivity.postResult(result);
|
this._currentActivity.postResult(result);
|
||||||
this._currentActivity = null;
|
this._currentActivity = null;
|
||||||
|
if (window.VulpesCompat) this._launchedAsInlineActivity = false;
|
||||||
},
|
},
|
||||||
|
|
||||||
postCancel: function ah_postCancel() {
|
postCancel: function ah_postCancel() {
|
||||||
this._currentActivity.postError('canceled');
|
this._currentActivity.postError('canceled');
|
||||||
this._currentActivity = null;
|
this._currentActivity = null;
|
||||||
|
if (window.VulpesCompat) this._launchedAsInlineActivity = false;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -655,7 +655,9 @@ var Contacts = (function() {
|
||||||
utils.PerformanceHelper.contentInteractive();
|
utils.PerformanceHelper.contentInteractive();
|
||||||
utils.PerformanceHelper.chromeInteractive();
|
utils.PerformanceHelper.chromeInteractive();
|
||||||
window.setTimeout(Contacts && Contacts.onLocalized);
|
window.setTimeout(Contacts && Contacts.onLocalized);
|
||||||
if (window.navigator.mozSetMessageHandler && window.self == window.top) {
|
// Vulpes embeds each app in its own permission-checked frame.
|
||||||
|
if (window.navigator.mozSetMessageHandler &&
|
||||||
|
(window.self == window.top || window.VulpesCompat)) {
|
||||||
LazyLoader.load(['/shared/js/contacts/import/utilities/misc.js',
|
LazyLoader.load(['/shared/js/contacts/import/utilities/misc.js',
|
||||||
'/shared/js/contacts/import/utilities/vcard_reader.js',
|
'/shared/js/contacts/import/utilities/vcard_reader.js',
|
||||||
'/shared/js/contacts/import/utilities/vcard_parser.js'],
|
'/shared/js/contacts/import/utilities/vcard_parser.js'],
|
||||||
|
|
|
||||||
|
|
@ -1038,6 +1038,8 @@ contacts.Form = (function() {
|
||||||
// (Bug 1041455).
|
// (Bug 1041455).
|
||||||
if (editingContact) {
|
if (editingContact) {
|
||||||
Contacts.setCurrent(contact);
|
Contacts.setCurrent(contact);
|
||||||
|
// The change event may arrive while the edit form is still visible.
|
||||||
|
Contacts.updateContactDetail(contact.id);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
|
||||||
|
|
@ -846,7 +846,7 @@ Apps.prototype={get iconSize(){if(!this._iconSize){var children=this.icons.child
|
||||||
return this._iconSize;},toggleSmall:function(small){if(this.icons.classList.contains('small')===small){return;}
|
return this._iconSize;},toggleSmall:function(small){if(this.icons.classList.contains('small')===small){return;}
|
||||||
this.icons.classList.toggle('small',small);this.icons.synchronise();this.refreshGridSize();this.snapScrollPosition();},toggleScrollSnapping:function(scrollSnapping){if(this.scrollable.classList.contains('snapping')===scrollSnapping){return;}
|
this.icons.classList.toggle('small',small);this.icons.synchronise();this.refreshGridSize();this.snapScrollPosition();},toggleScrollSnapping:function(scrollSnapping){if(this.scrollable.classList.contains('snapping')===scrollSnapping){return;}
|
||||||
this.scrollable.classList.toggle('snapping',scrollSnapping);this.snapScrollPosition();},onVisualLoad:function(){this.visualLoadComplete=true;this.icons.thaw();this.icons.classList.remove('loading');window.performance.mark('visuallyLoaded');window.performance.mark('contentInteractive');},addApp:function(app){var manifest=app.manifest||app.updateManifest;if(!manifest){return;}
|
this.scrollable.classList.toggle('snapping',scrollSnapping);this.snapScrollPosition();},onVisualLoad:function(){this.visualLoadComplete=true;this.icons.thaw();this.icons.classList.remove('loading');window.performance.mark('visuallyLoaded');window.performance.mark('contentInteractive');},addApp:function(app){var manifest=app.manifest||app.updateManifest;if(!manifest){return;}
|
||||||
if(BLACKLIST.includes(app.origin)){return;}
|
if(HIDDEN_ROLES.includes(manifest.role)||BLACKLIST.includes(app.origin)){return;}
|
||||||
if(manifest.entry_points){for(var entryPoint in manifest.entry_points){this.addAppIcon(app,entryPoint);}}else{this.addAppIcon(app);}},addIconContainer:function(icon,entry){var container=document.createElement('div');container.classList.add('icon-container');container.order=-1;container.appendChild(icon);if(entry!==-1&&this.startupMetadata[entry].order>=0){container.order=this.startupMetadata[entry].order;var children=this.icons.children;for(var i=0,iLen=children.length;i<iLen;i++){var child=children[i];if(child.order!==-1&&child.order<container.order){continue;}
|
if(manifest.entry_points){for(var entryPoint in manifest.entry_points){this.addAppIcon(app,entryPoint);}}else{this.addAppIcon(app);}},addIconContainer:function(icon,entry){var container=document.createElement('div');container.classList.add('icon-container');container.order=-1;container.appendChild(icon);if(entry!==-1&&this.startupMetadata[entry].order>=0){container.order=this.startupMetadata[entry].order;var children=this.icons.children;for(var i=0,iLen=children.length;i<iLen;i++){var child=children[i];if(child.order!==-1&&child.order<container.order){continue;}
|
||||||
this.icons.insertBefore(container,child);if(this.startupMetadata===null){this.iconAdded(container);}
|
this.icons.insertBefore(container,child);if(this.startupMetadata===null){this.iconAdded(container);}
|
||||||
break;}}
|
break;}}
|
||||||
|
|
|
||||||
BIN
assets/webapps/marketplace.gaiamobile.org/icon.png
Normal file
BIN
assets/webapps/marketplace.gaiamobile.org/icon.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 186 KiB |
5
assets/webapps/marketplace.gaiamobile.org/index.html
Normal file
5
assets/webapps/marketplace.gaiamobile.org/index.html
Normal file
|
|
@ -0,0 +1,5 @@
|
||||||
|
<!doctype html><html><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1"><title>Marketplace</title><link rel="stylesheet" href="/shared/style/confirm.css"><link rel="stylesheet" href="marketplace.css"><script defer src="marketplace.js"></script></head><body>
|
||||||
|
<iframe id="catalogue" mozbrowser title="Marketplace"></iframe>
|
||||||
|
<section id="message" hidden><img src="icon.png" alt="" width="96" height="96"><p id="status" role="status"></p><button id="browse" type="button"></button><button id="open" type="button" hidden></button></section>
|
||||||
|
<form id="confirm" role="dialog" data-type="confirm" hidden><section><h1 id="title"></h1><p id="question"></p><p id="permissions"></p></section><menu><button id="cancel" type="button"></button><button id="install" type="submit" class="recommend"></button></menu></form>
|
||||||
|
</body></html>
|
||||||
19
assets/webapps/marketplace.gaiamobile.org/manifest.webapp
Normal file
19
assets/webapps/marketplace.gaiamobile.org/manifest.webapp
Normal file
|
|
@ -0,0 +1,19 @@
|
||||||
|
{
|
||||||
|
"name": "Marketplace",
|
||||||
|
"description": "Vulpes OS application catalogue",
|
||||||
|
"launch_path": "/index.html",
|
||||||
|
"type": "certified",
|
||||||
|
"icons": {
|
||||||
|
"512": "/icon.png"
|
||||||
|
},
|
||||||
|
"permissions": {
|
||||||
|
"browser": {},
|
||||||
|
"webapps-manage": {}
|
||||||
|
},
|
||||||
|
"locales": {
|
||||||
|
"fr": {
|
||||||
|
"name": "Marketplace",
|
||||||
|
"description": "Catalogue des applications Vulpes OS"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue