Release Android Preview 21 and bilingual changelog
Add permission-based reading of Android contacts, SMS and call history. Include shared Gaia fixes and document device validation limits. Pixel image qualification remains pending.
This commit is contained in:
parent
1c20a0b6d5
commit
200d1fb235
43 changed files with 2271 additions and 65 deletions
|
|
@ -4,6 +4,31 @@
|
||||||
|
|
||||||
Updates by date and platform. Within each group: Add, Change, Fix, Note, Test. Entries describe the state at their date; a fix in development requires an updated installed version.
|
Updates by date and platform. Within each group: Add, Change, Fix, Note, Test. Entries describe the state at their date; a fix in development requires an updated installed version.
|
||||||
|
|
||||||
|
<a id="2.7-preview.21"></a>
|
||||||
|
|
||||||
|
## 14/10/2026 : 2.7-preview.21
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
### 
|
||||||
|
|
||||||
|
-   : Unavailable-feature messages are easier to read in light and dark themes.
|
||||||
|
-   : Contact names now appear when the call history first loads.
|
||||||
|
-   : Additional dictionaries available offline; improved Gaia keyboard activation and recovery. Verification on affected devices is still needed.
|
||||||
|
-   : Storage panels restored. A loading error no longer locks the other menus.
|
||||||
|
|
||||||
|
### 
|
||||||
|
|
||||||
|
-   : Read Android contacts, SMS and call history in Gaia after granting access. Existing local Vulpes data is preserved.
|
||||||
|
-   : Return to Vulpes without a persistent white overlay; a closed catalogue can be reopened.
|
||||||
|
-   : The reported blank keyboard still needs reproduction on the affected devices.
|
||||||
|
-   : First, read-only integration, excluding MMS. Sending and editing Android records use Android apps; new Gaia contacts stay local. SMS and call log access depend on ROM and installer permissions. Tested on Android 9; other versions need verification.
|
||||||
|
|
||||||
|
### 
|
||||||
|
|
||||||
|
-   : Shared Gaia fixes are included in full installation images and boot updates.
|
||||||
|
-   : New installation image built; Pixel boot and flashing must be tested before publication.
|
||||||
|
|
||||||
<a id="2.7-preview.20"></a>
|
<a id="2.7-preview.20"></a>
|
||||||
|
|
||||||
## 13/10/2026 : 2.7-preview.20
|
## 13/10/2026 : 2.7-preview.20
|
||||||
|
|
|
||||||
25
CHANGELOG.md
25
CHANGELOG.md
|
|
@ -4,6 +4,31 @@
|
||||||
|
|
||||||
Les nouveautés, par date et par plateforme. Dans chaque groupe : Add, Change, Fix, Note, Test. Les entrées décrivent la situation à leur date ; une correction en développement nécessite une nouvelle version installée.
|
Les nouveautés, par date et par plateforme. Dans chaque groupe : Add, Change, Fix, Note, Test. Les entrées décrivent la situation à leur date ; une correction en développement nécessite une nouvelle version installée.
|
||||||
|
|
||||||
|
<a id="2.7-preview.21"></a>
|
||||||
|
|
||||||
|
## 14/10/2026 : 2.7-preview.21
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
### 
|
||||||
|
|
||||||
|
-   : Messages des fonctions indisponibles plus lisibles en thèmes clair et sombre.
|
||||||
|
-   : Dictionnaires supplémentaires disponibles hors ligne ; activation et reprise du clavier Gaia fiabilisées. La vérification sur les appareils concernés reste nécessaire.
|
||||||
|
-   : Affichage du nom des contacts rétabli au premier chargement du journal.
|
||||||
|
-   : Panneaux Stockage rétablis. Une erreur de chargement ne bloque plus les autres menus.
|
||||||
|
|
||||||
|
### 
|
||||||
|
|
||||||
|
-   : Lecture des contacts, SMS et journaux Android dans Gaia, après autorisation. Les données locales de Vulpes sont conservées.
|
||||||
|
-   : Retour vers Vulpes sans écran blanc persistant ; un catalogue fermé peut être rouvert.
|
||||||
|
-   : Le rectangle blanc signalé reste à reproduire sur les appareils concernés.
|
||||||
|
-   : Première étape en lecture seule, hors MMS. Envoi et édition des données Android dans les applications Android ; les nouveaux contacts Gaia restent locaux. Accès SMS et journal selon les autorisations de la ROM et de l’installateur. Essais sur Android 9 ; autres versions à confirmer.
|
||||||
|
|
||||||
|
### 
|
||||||
|
|
||||||
|
-   : Les corrections communes de Gaia sont incluses dans les images complètes et les mises à jour de démarrage.
|
||||||
|
-   : Nouvelle image d’installation construite ; démarrage et flash sur Pixel à vérifier avant publication.
|
||||||
|
|
||||||
<a id="2.7-preview.20"></a>
|
<a id="2.7-preview.20"></a>
|
||||||
|
|
||||||
## 13/10/2026 : 2.7-preview.20
|
## 13/10/2026 : 2.7-preview.20
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,9 @@
|
||||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
|
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
<uses-permission android:name="android.permission.INTERNET" />
|
<uses-permission android:name="android.permission.INTERNET" />
|
||||||
|
<uses-permission android:name="android.permission.READ_CONTACTS" />
|
||||||
|
<uses-permission android:name="android.permission.READ_SMS" />
|
||||||
|
<uses-permission android:name="android.permission.READ_CALL_LOG" />
|
||||||
|
<uses-feature android:name="android.hardware.telephony" android:required="false" />
|
||||||
<uses-permission android:name="android.permission.CAMERA" />
|
<uses-permission android:name="android.permission.CAMERA" />
|
||||||
<uses-permission android:name="android.permission.RECORD_AUDIO" />
|
<uses-permission android:name="android.permission.RECORD_AUDIO" />
|
||||||
<uses-feature android:name="android.hardware.camera.any" android:required="false" />
|
<uses-feature android:name="android.hardware.camera.any" android:required="false" />
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,172 @@
|
||||||
|
package org.vulpes_os.preview;
|
||||||
|
|
||||||
|
import android.Manifest;
|
||||||
|
import android.content.ContentResolver;
|
||||||
|
import android.content.ContentUris;
|
||||||
|
import android.content.Context;
|
||||||
|
import android.content.Intent;
|
||||||
|
import android.content.pm.PackageManager;
|
||||||
|
import android.database.Cursor;
|
||||||
|
import android.database.ContentObserver;
|
||||||
|
import android.os.Handler;
|
||||||
|
import android.os.Looper;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.Map;
|
||||||
|
import android.net.Uri;
|
||||||
|
import android.provider.CallLog;
|
||||||
|
import android.provider.ContactsContract;
|
||||||
|
import android.provider.Telephony;
|
||||||
|
import org.json.JSONArray;
|
||||||
|
import org.json.JSONObject;
|
||||||
|
|
||||||
|
/** Read-through access. Android remains the owner of contacts and telephony records. */
|
||||||
|
final class AndroidPersonalData {
|
||||||
|
private final Context context;
|
||||||
|
private final Handler main = new Handler(Looper.getMainLooper());
|
||||||
|
private final Map<String, ContentObserver> observers = new HashMap<>();
|
||||||
|
private final Map<String, Runnable> pending = new HashMap<>();
|
||||||
|
void changed(String kind) {
|
||||||
|
Runnable previous = pending.remove(kind);
|
||||||
|
if (previous != null) main.removeCallbacks(previous);
|
||||||
|
Runnable next = () -> {
|
||||||
|
pending.remove(kind);
|
||||||
|
VulpesApplication app = (VulpesApplication) context;
|
||||||
|
if (app.port == null) return;
|
||||||
|
try { app.port.postMessage(new JSONObject().put("type", "android-data-changed").put("kind", kind)); }
|
||||||
|
catch (Exception ignored) { /* The resume event refreshes detached sessions. */ }
|
||||||
|
};
|
||||||
|
pending.put(kind, next);
|
||||||
|
main.postDelayed(next, 250);
|
||||||
|
}
|
||||||
|
void observe() {
|
||||||
|
for (String kind : new String[]{"contacts", "sms", "calls"}) {
|
||||||
|
if (granted(kind) && !observers.containsKey(kind)) {
|
||||||
|
ContentObserver observer = new ContentObserver(main) {
|
||||||
|
@Override public void onChange(boolean selfChange) { changed(kind); }
|
||||||
|
};
|
||||||
|
Uri uri = kind.equals("contacts") ? ContactsContract.Contacts.CONTENT_URI :
|
||||||
|
kind.equals("sms") ? Telephony.Sms.CONTENT_URI : CallLog.Calls.CONTENT_URI;
|
||||||
|
try {
|
||||||
|
context.getContentResolver().registerContentObserver(uri, true, observer);
|
||||||
|
observers.put(kind, observer);
|
||||||
|
} catch (SecurityException ignored) { /* Permission can be revoked during registration. */ }
|
||||||
|
} else if (!granted(kind) && observers.containsKey(kind)) {
|
||||||
|
context.getContentResolver().unregisterContentObserver(observers.remove(kind));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
AndroidPersonalData(Context context) { this.context = context; }
|
||||||
|
|
||||||
|
static String permission(String kind) {
|
||||||
|
switch (kind) {
|
||||||
|
case "contacts": return Manifest.permission.READ_CONTACTS;
|
||||||
|
case "sms": return Manifest.permission.READ_SMS;
|
||||||
|
case "calls": return Manifest.permission.READ_CALL_LOG;
|
||||||
|
default: throw new IllegalArgumentException("INVALID_DATA_KIND");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
boolean granted(String kind) {
|
||||||
|
return context.getSharedPreferences("personal-data", 0).getBoolean(kind, false) &&
|
||||||
|
context.checkSelfPermission(permission(kind)) == PackageManager.PERMISSION_GRANTED;
|
||||||
|
}
|
||||||
|
|
||||||
|
void enable(String kind, boolean value) {
|
||||||
|
permission(kind);
|
||||||
|
context.getSharedPreferences("personal-data", 0).edit().putBoolean(kind, value).apply();
|
||||||
|
observe();
|
||||||
|
changed(kind);
|
||||||
|
}
|
||||||
|
|
||||||
|
JSONObject status() throws Exception {
|
||||||
|
JSONObject result = new JSONObject();
|
||||||
|
for (String kind : new String[]{"contacts", "sms", "calls"}) result.put(kind, granted(kind));
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
JSONObject page(JSONObject params) throws Exception {
|
||||||
|
String kind = params.getString("kind");
|
||||||
|
if (!granted(kind)) throw new SecurityException("ANDROID_DATA_PERMISSION_DENIED");
|
||||||
|
long after = params.optLong("after", 0);
|
||||||
|
if (after < 0) throw new IllegalArgumentException("INVALID_CURSOR");
|
||||||
|
Uri uri;
|
||||||
|
String[] columns;
|
||||||
|
switch (kind) {
|
||||||
|
case "contacts":
|
||||||
|
uri = ContactsContract.Contacts.CONTENT_URI;
|
||||||
|
columns = new String[]{"_id", "display_name", "starred", "contact_last_updated_timestamp"};
|
||||||
|
break;
|
||||||
|
case "sms":
|
||||||
|
uri = Telephony.Sms.CONTENT_URI;
|
||||||
|
columns = new String[]{"_id", "thread_id", "address", "body", "date", "type", "read", "status"};
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
uri = CallLog.Calls.CONTENT_URI;
|
||||||
|
columns = new String[]{"_id", "number", "date", "duration", "type"};
|
||||||
|
}
|
||||||
|
JSONArray rows = new JSONArray();
|
||||||
|
long last = after;
|
||||||
|
boolean more = false;
|
||||||
|
ContentResolver resolver = context.getContentResolver();
|
||||||
|
// A key cursor avoids SQL LIMIT syntax differences between Android providers.
|
||||||
|
try (Cursor cursor = resolver.query(uri, columns, "_id > ?", new String[]{Long.toString(after)}, "_id ASC")) {
|
||||||
|
if (cursor == null) throw new IllegalStateException("ANDROID_PROVIDER_UNAVAILABLE");
|
||||||
|
int bytes = 0;
|
||||||
|
while (cursor.moveToNext()) {
|
||||||
|
if (rows.length() >= 100 || bytes > 512 * 1024) { more = true; break; }
|
||||||
|
JSONObject row = new JSONObject();
|
||||||
|
for (int i = 0; i < columns.length; i++) {
|
||||||
|
row.put(columns[i], cursor.isNull(i) ? JSONObject.NULL :
|
||||||
|
cursor.getType(i) == Cursor.FIELD_TYPE_INTEGER ? cursor.getLong(i) : cursor.getString(i));
|
||||||
|
}
|
||||||
|
last = cursor.getLong(0);
|
||||||
|
if (kind.equals("contacts")) contactDetails(last, row);
|
||||||
|
rows.put(row);
|
||||||
|
bytes += row.toString().length() * 2;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return new JSONObject().put("rows", rows).put("next", more ? last : JSONObject.NULL);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void contactDetails(long id, JSONObject contact) throws Exception {
|
||||||
|
JSONArray phones = new JSONArray(), emails = new JSONArray();
|
||||||
|
contact.put("tel", phones).put("email", emails);
|
||||||
|
try (Cursor c = context.getContentResolver().query(ContactsContract.Data.CONTENT_URI,
|
||||||
|
new String[]{"mimetype", "data1", "data2", "data3", "is_primary"},
|
||||||
|
"contact_id = ? AND mimetype IN (?, ?, ?)", new String[]{Long.toString(id),
|
||||||
|
ContactsContract.CommonDataKinds.StructuredName.CONTENT_ITEM_TYPE,
|
||||||
|
ContactsContract.CommonDataKinds.Phone.CONTENT_ITEM_TYPE,
|
||||||
|
ContactsContract.CommonDataKinds.Email.CONTENT_ITEM_TYPE}, "_id ASC")) {
|
||||||
|
if (c == null) throw new IllegalStateException("ANDROID_PROVIDER_UNAVAILABLE");
|
||||||
|
while (c.moveToNext()) {
|
||||||
|
String mime = c.getString(0);
|
||||||
|
if (mime.equals(ContactsContract.CommonDataKinds.StructuredName.CONTENT_ITEM_TYPE)) {
|
||||||
|
if (!contact.has("givenName")) contact.put("givenName", new JSONArray().put(c.getString(2)))
|
||||||
|
.put("familyName", new JSONArray().put(c.getString(3)));
|
||||||
|
} else {
|
||||||
|
boolean phone = mime.equals(ContactsContract.CommonDataKinds.Phone.CONTENT_ITEM_TYPE);
|
||||||
|
int type = c.getInt(2);
|
||||||
|
String label = type == 0 ? c.getString(3) : phone ?
|
||||||
|
(type == 2 ? "mobile" : type == 1 ? "home" : type == 3 ? "work" : "other") :
|
||||||
|
(type == 1 ? "home" : type == 2 ? "work" : "other");
|
||||||
|
(phone ? phones : emails).put(new JSONObject().put("value", c.getString(1))
|
||||||
|
.put("type", new JSONArray().put(label == null ? "other" : label)).put("pref", c.getInt(4) != 0));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Intent open(JSONObject params) {
|
||||||
|
String kind = params.optString("kind");
|
||||||
|
if (kind.equals("contacts")) {
|
||||||
|
String id = params.optString("id");
|
||||||
|
if (!id.matches("[1-9][0-9]{0,15}")) throw new IllegalArgumentException("INVALID_CONTACT");
|
||||||
|
if (!granted(kind)) throw new SecurityException("ANDROID_DATA_PERMISSION_DENIED");
|
||||||
|
return new Intent(Intent.ACTION_VIEW, ContentUris.withAppendedId(ContactsContract.Contacts.CONTENT_URI, Long.parseLong(id)));
|
||||||
|
}
|
||||||
|
if (kind.equals("sms")) return new Intent(Intent.ACTION_MAIN).addCategory(Intent.CATEGORY_APP_MESSAGING);
|
||||||
|
if (kind.equals("calls")) return new Intent(Intent.ACTION_VIEW, CallLog.Calls.CONTENT_URI);
|
||||||
|
throw new IllegalArgumentException("INVALID_DATA_KIND");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -24,6 +24,7 @@ final class AndroidServices {
|
||||||
CONTACT = 412;
|
CONTACT = 412;
|
||||||
static final long MAX_MEDIA = 32L * 1024 * 1024;
|
static final long MAX_MEDIA = 32L * 1024 * 1024;
|
||||||
final VulpesApplication app;
|
final VulpesApplication app;
|
||||||
|
final AndroidPersonalData personal;
|
||||||
final ExecutorService io = Executors.newSingleThreadExecutor();
|
final ExecutorService io = Executors.newSingleThreadExecutor();
|
||||||
final Handler main = new Handler(Looper.getMainLooper());
|
final Handler main = new Handler(Looper.getMainLooper());
|
||||||
GeckoResult<Object> pending;
|
GeckoResult<Object> pending;
|
||||||
|
|
@ -31,6 +32,7 @@ final class AndroidServices {
|
||||||
|
|
||||||
AndroidServices(VulpesApplication app) {
|
AndroidServices(VulpesApplication app) {
|
||||||
this.app = app;
|
this.app = app;
|
||||||
|
personal = new AndroidPersonalData(app);
|
||||||
}
|
}
|
||||||
|
|
||||||
GeckoResult<Object> request(JSONObject message) {
|
GeckoResult<Object> request(JSONObject message) {
|
||||||
|
|
@ -40,6 +42,30 @@ final class AndroidServices {
|
||||||
JSONObject p = message.optJSONObject("params");
|
JSONObject p = message.optJSONObject("params");
|
||||||
if (p == null) p = new JSONObject();
|
if (p == null) p = new JSONObject();
|
||||||
switch (op) {
|
switch (op) {
|
||||||
|
case "android.personal":
|
||||||
|
JSONObject personalParams = p;
|
||||||
|
String operation = p.optString("operation");
|
||||||
|
if (operation.equals("permission")) {
|
||||||
|
String kind = p.getString("kind");
|
||||||
|
activity().permission(new String[]{AndroidPersonalData.permission(kind)}, granted -> {
|
||||||
|
try { personal.enable(kind, granted); result.complete(personal.status()); } catch (Exception e) { fail(result, e); }
|
||||||
|
});
|
||||||
|
} else if (operation.equals("status")) result.complete(personal.status());
|
||||||
|
else if (operation.equals("disconnect")) {
|
||||||
|
personal.enable(p.getString("kind"), false);
|
||||||
|
result.complete(personal.status());
|
||||||
|
}
|
||||||
|
else if (operation.equals("open")) {
|
||||||
|
activity().startActivity(personal.open(p));
|
||||||
|
result.complete(null);
|
||||||
|
} else if (operation.equals("page")) io.execute(() -> {
|
||||||
|
try {
|
||||||
|
JSONObject data = personal.page(personalParams);
|
||||||
|
main.post(() -> result.complete(data));
|
||||||
|
} catch (Exception e) { fail(result, e); }
|
||||||
|
});
|
||||||
|
else throw new IllegalArgumentException("METHOD_NOT_SUPPORTED");
|
||||||
|
break;
|
||||||
case "android.notification":
|
case "android.notification":
|
||||||
JSONObject request = p;
|
JSONObject request = p;
|
||||||
if (p.optString("operation").equals("permission")) {
|
if (p.optString("operation").equals("permission")) {
|
||||||
|
|
|
||||||
|
|
@ -82,8 +82,8 @@ public final class MainActivity extends Activity {
|
||||||
webPanel.addView(nav, new LinearLayout.LayoutParams(-1, dp(52)));
|
webPanel.addView(nav, new LinearLayout.LayoutParams(-1, dp(52)));
|
||||||
Button back = new Button(this);
|
Button back = new Button(this);
|
||||||
back.setText("‹");
|
back.setText("‹");
|
||||||
back.setContentDescription("Retour au bureau");
|
back.setContentDescription("Retour");
|
||||||
back.setOnClickListener(v -> closeBrowser());
|
back.setOnClickListener(v -> back());
|
||||||
nav.addView(back, new LinearLayout.LayoutParams(dp(55), -1));
|
nav.addView(back, new LinearLayout.LayoutParams(dp(55), -1));
|
||||||
address = new EditText(this);
|
address = new EditText(this);
|
||||||
address.setSingleLine(true);
|
address.setSingleLine(true);
|
||||||
|
|
@ -99,6 +99,9 @@ public final class MainActivity extends Activity {
|
||||||
return true;
|
return true;
|
||||||
});
|
});
|
||||||
webView = new GeckoView(this);
|
webView = new GeckoView(this);
|
||||||
|
// The web panel is layered over Gaia and hidden when returning to an app.
|
||||||
|
// A TextureView follows that visibility without leaving a separate surface.
|
||||||
|
webView.setViewBackend(GeckoView.BACKEND_TEXTURE_VIEW);
|
||||||
webPanel.addView(webView, new LinearLayout.LayoutParams(-1, 0, 1));
|
webPanel.addView(webView, new LinearLayout.LayoutParams(-1, 0, 1));
|
||||||
home = new Button(this);
|
home = new Button(this);
|
||||||
home.setText("◯");
|
home.setText("◯");
|
||||||
|
|
@ -297,10 +300,12 @@ public final class MainActivity extends Activity {
|
||||||
}
|
}
|
||||||
|
|
||||||
void closeBrowser() {
|
void closeBrowser() {
|
||||||
|
boolean wasVisible = webPanel.getVisibility() == View.VISIBLE;
|
||||||
webPanel.setVisibility(View.GONE);
|
webPanel.setVisibility(View.GONE);
|
||||||
gaiaView.setVisibility(View.VISIBLE);
|
gaiaView.setVisibility(View.VISIBLE);
|
||||||
setHomeSurface(app.homeVisible);
|
setHomeSurface(app.homeVisible);
|
||||||
syncActive();
|
syncActive();
|
||||||
|
if (wasVisible) app.browserClosed();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void back() {
|
private void back() {
|
||||||
|
|
@ -470,7 +475,7 @@ public final class MainActivity extends Activity {
|
||||||
else callback.accept(granted);
|
else callback.accept(granted);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void permission(String[] names, java.util.function.Consumer<Boolean> callback) {
|
void permission(String[] names, java.util.function.Consumer<Boolean> callback) {
|
||||||
boolean granted = true;
|
boolean granted = true;
|
||||||
for (String name : names)
|
for (String name : names)
|
||||||
granted &= checkSelfPermission(name) == PackageManager.PERMISSION_GRANTED;
|
granted &= checkSelfPermission(name) == PackageManager.PERMISSION_GRANTED;
|
||||||
|
|
|
||||||
|
|
@ -150,6 +150,15 @@ public final class VulpesApplication extends Application {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void browserClosed() {
|
||||||
|
if (port == null) return;
|
||||||
|
try {
|
||||||
|
port.postMessage(new JSONObject().put("type", "browser-closed"));
|
||||||
|
} catch (Exception e) {
|
||||||
|
Log.w("Vulpes", "Browser close notification", e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void home(boolean held) {
|
void home(boolean held) {
|
||||||
if (port == null) return;
|
if (port == null) return;
|
||||||
try {
|
try {
|
||||||
|
|
@ -160,6 +169,7 @@ public final class VulpesApplication extends Application {
|
||||||
}
|
}
|
||||||
|
|
||||||
void resumed() {
|
void resumed() {
|
||||||
|
if (services != null) services.personal.observe();
|
||||||
sendScreenLock();
|
sendScreenLock();
|
||||||
if (port == null) return;
|
if (port == null) return;
|
||||||
try {
|
try {
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,4 @@
|
||||||
|
import {AndroidPersonalData, authorizePersonal} from './personal-data.mjs';
|
||||||
import {Input} from './services/input.mjs';
|
import {Input} from './services/input.mjs';
|
||||||
import { Packages, packageURL } from './services/packages.mjs';
|
import { Packages, packageURL } from './services/packages.mjs';
|
||||||
import { Activities, isGaiaActivity } from './services/activities.mjs';
|
import { Activities, isGaiaActivity } from './services/activities.mjs';
|
||||||
|
|
@ -15,7 +16,7 @@ const input = new Input({identity:peer=>peer.app,broadcast});
|
||||||
let editSequence=0;
|
let editSequence=0;
|
||||||
const nativePackages=(operation,data={})=>browser.runtime.sendNativeMessage('vulpes',{type:'packages.'+operation,...data}).then(JSON.parse);
|
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);}
|
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, personal;
|
||||||
const identity = (peer) => peer.app;
|
const identity = (peer) => peer.app;
|
||||||
function notify(peer, type, data) {
|
function notify(peer, type, data) {
|
||||||
try {
|
try {
|
||||||
|
|
@ -121,6 +122,7 @@ const ready = (async () => {
|
||||||
contacts = new Contacts(storage, (data) => broadcast('contactchange', data));
|
contacts = new Contacts(storage, (data) => broadcast('contactchange', data));
|
||||||
await contacts.init();
|
await contacts.init();
|
||||||
messages = new Messages(storage);
|
messages = new Messages(storage);
|
||||||
|
personal = new AndroidPersonalData(params=>android("personal",params), contacts, messages, storage);
|
||||||
dataStores = new DataStoreService(apps, storage, (data) => broadcast('datastorechange', data));
|
dataStores = new DataStoreService(apps, storage, (data) => broadcast('datastorechange', data));
|
||||||
connections = new Connections(identity, notify);
|
connections = new Connections(identity, notify);
|
||||||
alarms = new Alarms(
|
alarms = new Alarms(
|
||||||
|
|
@ -140,6 +142,7 @@ 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 activeWebView;
|
||||||
let systemReady = false;
|
let systemReady = false;
|
||||||
let pendingScreenLock = false;
|
let pendingScreenLock = false;
|
||||||
function deliverScreenLock() {
|
function deliverScreenLock() {
|
||||||
|
|
@ -163,15 +166,26 @@ function connectNative() {
|
||||||
native.onDisconnect.addListener(() => setTimeout(connectNative, 1000));
|
native.onDisconnect.addListener(() => setTimeout(connectNative, 1000));
|
||||||
native.onMessage.addListener(async (message) => {
|
native.onMessage.addListener(async (message) => {
|
||||||
await ready;
|
await ready;
|
||||||
|
if (message.type === 'browser-closed' && activeWebView) {
|
||||||
|
const {peer, contextId} = activeWebView;
|
||||||
|
activeWebView = null;
|
||||||
|
notify(peer, 'view', {contextId, type:'close', detail:{}});
|
||||||
|
}
|
||||||
if (['home', 'holdhome'].includes(message.type)) broadcast(message.type, {}, 'system');
|
if (['home', 'holdhome'].includes(message.type)) broadcast(message.type, {}, 'system');
|
||||||
if (message.type === 'android-screen-off') {
|
if (message.type === 'android-screen-off') {
|
||||||
pendingScreenLock = true;
|
pendingScreenLock = true;
|
||||||
deliverScreenLock();
|
deliverScreenLock();
|
||||||
}
|
}
|
||||||
|
if (message.type === 'android-data-changed') {
|
||||||
|
broadcast('android-data-changed', {kind:message.kind}, message.kind === 'sms' ? 'sms' : 'communications');
|
||||||
|
}
|
||||||
if (message.type === 'android-resume') {
|
if (message.type === 'android-resume') {
|
||||||
deliverScreenLock();
|
deliverScreenLock();
|
||||||
broadcast('screen-on', {}, 'system');
|
broadcast('screen-on', {}, 'system');
|
||||||
await refreshAndroid().catch(console.warn);
|
await refreshAndroid().catch(console.warn);
|
||||||
|
broadcast('android-data-changed', {kind:'contacts'}, 'communications');
|
||||||
|
broadcast('android-data-changed', {kind:'calls'}, 'communications');
|
||||||
|
broadcast('android-data-changed', {kind:'sms'}, 'sms');
|
||||||
}
|
}
|
||||||
if (message.type === 'notification-click') {
|
if (message.type === 'notification-click') {
|
||||||
pendingNotification = message.data;
|
pendingNotification = message.data;
|
||||||
|
|
@ -215,6 +229,12 @@ async function handle(peer, request) {
|
||||||
authorizePlatform(app, method.slice(9), params);
|
authorizePlatform(app, method.slice(9), params);
|
||||||
method = 'android.' + method.slice(9);
|
method = 'android.' + method.slice(9);
|
||||||
}
|
}
|
||||||
|
if (method === 'android.personal') {
|
||||||
|
authorizePersonal(app, params.kind, params.operation);
|
||||||
|
if (params.operation === 'page') return personal.rows(params.kind);
|
||||||
|
if (!['status','permission','disconnect','open'].includes(params.operation)) throw Error('METHOD_NOT_SUPPORTED');
|
||||||
|
return android('personal', params);
|
||||||
|
}
|
||||||
if (method === 'android.capabilities') {
|
if (method === 'android.capabilities') {
|
||||||
const release = await (await fetch('release.json')).json();
|
const release = await (await fetch('release.json')).json();
|
||||||
const device = app.id === 'settings' ? await android('snapshot') : {};
|
const device = app.id === 'settings' ? await android('snapshot') : {};
|
||||||
|
|
@ -355,8 +375,8 @@ async function handle(peer, request) {
|
||||||
}
|
}
|
||||||
if (method === 'datastores.list') return dataStores.list(app, params.name);
|
if (method === 'datastores.list') return dataStores.list(app, params.name);
|
||||||
if (method === 'datastores.run') return dataStores.run(app, params);
|
if (method === 'datastores.run') return dataStores.run(app, params);
|
||||||
if (method === 'contacts.request') return contacts.request(app, params);
|
if (method === 'contacts.request') return personal.contactRequest(app, params);
|
||||||
if (method === 'messages.request') return messages.request(app, params);
|
if (method === 'messages.request') return personal.messageRequest(app, params);
|
||||||
if (method === 'alarms.request') return alarms.request(peer, app, params);
|
if (method === 'alarms.request') return alarms.request(peer, app, params);
|
||||||
if (method === 'iac.subscribe') {
|
if (method === 'iac.subscribe') {
|
||||||
connections.subscribe(peer);
|
connections.subscribe(peer);
|
||||||
|
|
@ -397,6 +417,7 @@ async function handle(peer, request) {
|
||||||
throw Error('PERMISSION_DENIED');
|
throw Error('PERMISSION_DENIED');
|
||||||
if (params.operation === 'open') {
|
if (params.operation === 'open') {
|
||||||
await openWeb(params.url);
|
await openWeb(params.url);
|
||||||
|
activeWebView = {peer, contextId:params.contextId};
|
||||||
notify(peer, 'view', {
|
notify(peer, 'view', {
|
||||||
contextId: params.contextId,
|
contextId: params.contextId,
|
||||||
type: 'loadend',
|
type: 'loadend',
|
||||||
|
|
@ -502,6 +523,7 @@ browser.runtime.onConnect.addListener((port) => {
|
||||||
attached
|
attached
|
||||||
.then(() => {
|
.then(() => {
|
||||||
peers.delete(peer);
|
peers.delete(peer);
|
||||||
|
if (activeWebView?.peer === peer) activeWebView = null;
|
||||||
input.cleanup(peer);
|
input.cleanup(peer);
|
||||||
for(const edit of peer.edits.values()) {clearTimeout(edit.timer);edit.reject(Error('INPUT_CONTEXT_EXPIRED'));}
|
for(const edit of peer.edits.values()) {clearTimeout(edit.timer);edit.reject(Error('INPUT_CONTEXT_EXPIRED'));}
|
||||||
peer.edits.clear();
|
peer.edits.clear();
|
||||||
|
|
|
||||||
|
|
@ -37,10 +37,8 @@
|
||||||
}
|
}
|
||||||
if (message.event) {
|
if (message.event) {
|
||||||
if(message.event.type==='input-mode') {
|
if(message.event.type==='input-mode') {
|
||||||
gaiaKeyboard=message.event.data.enabled===true;
|
inputConfigurationRevision++;
|
||||||
if(!gaiaKeyboard) restoreMode();
|
configureInput(message.event.data.enabled===true);
|
||||||
win.VulpesNativeInput=gaiaKeyboard;
|
|
||||||
win.dispatchEvent(new window.Event('vulpes-input-configured'));
|
|
||||||
}
|
}
|
||||||
win.dispatchEvent(
|
win.dispatchEvent(
|
||||||
new window.CustomEvent('vulpes-service-event', { detail: cloneInto(message.event, win) }),
|
new window.CustomEvent('vulpes-service-event', { detail: cloneInto(message.event, win) }),
|
||||||
|
|
@ -53,6 +51,8 @@
|
||||||
callback.resolve(cloneInto(message.reply, win));
|
callback.resolve(cloneInto(message.reply, win));
|
||||||
}
|
}
|
||||||
function onDisconnect() {
|
function onDisconnect() {
|
||||||
|
inputConfigurationRevision++;
|
||||||
|
configureInput(false);
|
||||||
for (const callback of pending.values())
|
for (const callback of pending.values())
|
||||||
callback.reject(new window.Error('VULPES_HOST_CLOSED'));
|
callback.reject(new window.Error('VULPES_HOST_CLOSED'));
|
||||||
pending.clear();
|
pending.clear();
|
||||||
|
|
@ -60,14 +60,15 @@
|
||||||
reconnect = setTimeout(() => {
|
reconnect = setTimeout(() => {
|
||||||
try {
|
try {
|
||||||
connect();
|
connect();
|
||||||
|
refreshInputConfiguration();
|
||||||
} catch (_) {
|
} catch (_) {
|
||||||
onDisconnect();
|
onDisconnect();
|
||||||
}
|
}
|
||||||
}, 1000);
|
}, 1000);
|
||||||
}
|
}
|
||||||
connect();
|
|
||||||
const editor = new InputEditor(window);
|
const editor = new InputEditor(window);
|
||||||
let gaiaKeyboard = false;
|
let gaiaKeyboard = false;
|
||||||
|
let inputConfigurationRevision = 0;
|
||||||
const originalModes = new WeakMap();
|
const originalModes = new WeakMap();
|
||||||
function restoreMode() {
|
function restoreMode() {
|
||||||
const field = editor.inputElement;
|
const field = editor.inputElement;
|
||||||
|
|
@ -77,21 +78,27 @@
|
||||||
else field.setAttribute('inputmode', value);
|
else field.setAttribute('inputmode', value);
|
||||||
originalModes.delete(field);
|
originalModes.delete(field);
|
||||||
}
|
}
|
||||||
request({version:1,id:0,method:'input.config',params:{}}).then(reply => {
|
function configureInput(enabled) {
|
||||||
gaiaKeyboard = reply.result === true;
|
gaiaKeyboard = enabled;
|
||||||
|
if(!enabled) restoreMode();
|
||||||
win.VulpesNativeInput = gaiaKeyboard;
|
win.VulpesNativeInput = gaiaKeyboard;
|
||||||
win.dispatchEvent(new window.Event('vulpes-input-configured'));
|
win.dispatchEvent(new window.Event('vulpes-input-configured'));
|
||||||
|
if(enabled && !document.hidden && document.hasFocus()) reportFocus(document.activeElement);
|
||||||
|
}
|
||||||
|
function refreshInputConfiguration() {
|
||||||
|
const revision = inputConfigurationRevision;
|
||||||
|
request({version:1,id:0,method:'input.config',params:{}}).then(reply => {
|
||||||
|
if(revision===inputConfigurationRevision) configureInput(reply.result===true);
|
||||||
}).catch(error => console.error('Gaia input configuration:', error));
|
}).catch(error => console.error('Gaia input configuration:', error));
|
||||||
for (const type of ['focusin', 'pointerdown', 'click']) addEventListener(type, event => {
|
}
|
||||||
if (!gaiaKeyboard || editor.editing || location.hostname === 'keyboard.localhost') return;
|
function reportFocus(element) {
|
||||||
let element = event.target;
|
if (!gaiaKeyboard || editor.editing || location.hostname === 'keyboard.localhost') return false;
|
||||||
if (element?.isContentEditable) element=element.closest('[contenteditable=true]') || element;
|
if (element?.isContentEditable) element=element.closest('[contenteditable=true]') || element;
|
||||||
const editable = element?.isContentEditable ||
|
const editable = element?.isContentEditable ||
|
||||||
(['input','textarea'].includes(element?.localName) &&
|
(['input','textarea'].includes(element?.localName) &&
|
||||||
!['button','submit','range','checkbox','radio','date','time','datetime-local','file'].includes(element.type));
|
!['button','submit','range','checkbox','radio','date','time','datetime-local','file'].includes(element.type));
|
||||||
if (!editable || element.disabled || element.readOnly) {
|
if (!editable || element.disabled || element.readOnly) {
|
||||||
if (type === 'click' && !element?.closest?.('[data-vulpes-keep-input]')) port.postMessage({inputFocus:null});
|
return false;
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
if (element !== editor.inputElement) restoreMode();
|
if (element !== editor.inputElement) restoreMode();
|
||||||
editor.focus(element);
|
editor.focus(element);
|
||||||
|
|
@ -101,9 +108,18 @@
|
||||||
const state=editor.state();
|
const state=editor.state();
|
||||||
state.inputMode=originalModes.get(element) || (element.classList.contains('recipient')?'tel':'');
|
state.inputMode=originalModes.get(element) || (element.classList.contains('recipient')?'tel':'');
|
||||||
port.postMessage({inputFocus:state});
|
port.postMessage({inputFocus:state});
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
connect();
|
||||||
|
refreshInputConfiguration();
|
||||||
|
for (const type of ['focusin', 'pointerdown', 'click']) addEventListener(type, event => {
|
||||||
|
if (!gaiaKeyboard || editor.editing || location.hostname === 'keyboard.localhost') return;
|
||||||
|
if (!reportFocus(event.target) && type === 'click' &&
|
||||||
|
!event.target?.closest?.('[data-vulpes-keep-input]')) port.postMessage({inputFocus:null});
|
||||||
}, true);
|
}, true);
|
||||||
addEventListener('visibilitychange', () => {
|
addEventListener('visibilitychange', () => {
|
||||||
if (document.hidden && gaiaKeyboard) { restoreMode(); port.postMessage({inputFocus:null}); }
|
if (document.hidden && gaiaKeyboard) { restoreMode(); port.postMessage({inputFocus:null}); }
|
||||||
|
else if (gaiaKeyboard && document.hasFocus()) reportFocus(document.activeElement);
|
||||||
});
|
});
|
||||||
addEventListener('unload', () => clearTimeout(reconnect));
|
addEventListener('unload', () => clearTimeout(reconnect));
|
||||||
exportFunction(request, win.navigator, { defineAs: 'vulpesRequest' });
|
exportFunction(request, win.navigator, { defineAs: 'vulpesRequest' });
|
||||||
|
|
|
||||||
88
android/extension/personal-data.mjs
Normal file
88
android/extension/personal-data.mjs
Normal file
|
|
@ -0,0 +1,88 @@
|
||||||
|
import {Contacts} from './Contacts.mjs';
|
||||||
|
import {Messages} from './Messages.mjs';
|
||||||
|
|
||||||
|
export function authorizePersonal(app, kind, operation) {
|
||||||
|
if (app.installed || !['settings', 'communications', 'sms', 'system'].includes(app.id))
|
||||||
|
throw Error('PERMISSION_DENIED');
|
||||||
|
if (operation === 'status' && app.id === 'settings') return;
|
||||||
|
if (!['contacts', 'sms', 'calls'].includes(kind)) throw Error('INVALID_DATA_KIND');
|
||||||
|
if (['permission', 'disconnect'].includes(operation)) {
|
||||||
|
if (app.id !== 'settings') throw Error('PERMISSION_DENIED');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (kind === 'contacts' && !app.manifest.permissions?.contacts?.access?.includes('read')) throw Error('PERMISSION_DENIED');
|
||||||
|
if (kind === 'sms' && app.id !== 'sms') throw Error('PERMISSION_DENIED');
|
||||||
|
if (kind === 'calls' && app.id !== 'communications') throw Error('PERMISSION_DENIED');
|
||||||
|
}
|
||||||
|
|
||||||
|
export function contactFromAndroid(row) {
|
||||||
|
return {id:'android:'+row._id, name:[row.display_name || ''], givenName:row.givenName || [],
|
||||||
|
familyName:row.familyName || [], tel:row.tel || [], email:row.email || [],
|
||||||
|
category:row.starred ? ['favorite'] : [], updated:new Date(row.contact_last_updated_timestamp || 0).toISOString()};
|
||||||
|
}
|
||||||
|
export function smsFromAndroid(row) {
|
||||||
|
// Negative IDs keep Android provider rows separate from existing Vulpes messages.
|
||||||
|
if (![row._id, row.thread_id].every(n => Number.isSafeInteger(n) && n > 0)) throw Error('INVALID_ANDROID_ID');
|
||||||
|
const incoming = row.type === 1;
|
||||||
|
return {id:-row._id, threadId:-row.thread_id, type:'sms',
|
||||||
|
sender:incoming ? row.address : null, receiver:incoming ? null : row.address,
|
||||||
|
body:row.body || '', timestamp:row.date, read:!!row.read,
|
||||||
|
delivery:incoming ? 'received' : row.type === 2 ? 'sent' : row.type === 5 ? 'error' : 'sending',
|
||||||
|
deliveryStatus:row.status === 0 ? 'success' : row.status >= 64 ? 'error' : 'not-applicable'};
|
||||||
|
}
|
||||||
|
|
||||||
|
export class AndroidPersonalData {
|
||||||
|
constructor(native, contacts, messages, storage) {
|
||||||
|
Object.assign(this, {native, contacts, messages, storage});
|
||||||
|
}
|
||||||
|
async rows(kind) {
|
||||||
|
const status = await this.native({operation:'status'});
|
||||||
|
if (!status[kind]) return [];
|
||||||
|
const rows = [];
|
||||||
|
let after = 0;
|
||||||
|
do {
|
||||||
|
const page = await this.native({operation:'page', kind, after});
|
||||||
|
rows.push(...page.rows);
|
||||||
|
if (rows.length > 100000) throw Error('ANDROID_DATA_TOO_LARGE');
|
||||||
|
if (page.next === null) break;
|
||||||
|
if (!Number.isSafeInteger(page.next) || page.next <= after) throw Error('INVALID_CURSOR');
|
||||||
|
after = page.next;
|
||||||
|
} while (true);
|
||||||
|
return rows;
|
||||||
|
}
|
||||||
|
async contactRequest(app, params) {
|
||||||
|
const write = ['save', 'remove', 'clear'].includes(params.operation);
|
||||||
|
const access = app.manifest.permissions?.contacts?.access || '';
|
||||||
|
if (!access.includes(write ? 'write' : 'read')) throw Error('PERMISSION_DENIED');
|
||||||
|
// Third-party apps keep the local address book and never inherit Android's grant.
|
||||||
|
if (app.installed || !['communications','sms','system'].includes(app.id)) return this.contacts.request(app, params);
|
||||||
|
if (write) {
|
||||||
|
if (String(params.contact?.id || params.id || '').startsWith('android:') ||
|
||||||
|
params.operation === 'clear' && (await this.native({operation:'status'})).contacts)
|
||||||
|
throw Error('ANDROID_DATA_READ_ONLY');
|
||||||
|
return this.contacts.request(app, params);
|
||||||
|
}
|
||||||
|
const remote = (await this.rows('contacts')).map(contactFromAndroid);
|
||||||
|
const local = await this.contacts.request(app, {operation:'all'});
|
||||||
|
const view = new Contacts(null, ()=>{});
|
||||||
|
let revision = this.contacts.data.revision;
|
||||||
|
for (const c of remote) for (const character of JSON.stringify(c)) revision = (revision * 31 + character.charCodeAt(0)) >>> 0;
|
||||||
|
view.data = {revision, contacts:[...local, ...remote]};
|
||||||
|
return view.request(app, params);
|
||||||
|
}
|
||||||
|
async messageRequest(app, params) {
|
||||||
|
if (!app.manifest.permissions?.sms) throw Error('PERMISSION_DENIED');
|
||||||
|
if (app.installed || app.id !== 'sms') return this.messages.request(app, params);
|
||||||
|
const {operation, args=[]} = params;
|
||||||
|
if (['delete','markMessageRead'].includes(operation) && [args[0]].flat().some(id => id < 0))
|
||||||
|
throw Error('ANDROID_DATA_READ_ONLY');
|
||||||
|
if (!['getMessages','getThreads','getMessage'].includes(operation)) return this.messages.request(app, params);
|
||||||
|
const remote = (await this.rows('sms')).filter(row => row.type !== 3).map(smsFromAndroid);
|
||||||
|
const local = await this.messages.request(app, {operation:'getMessages'});
|
||||||
|
const view = new Messages({run:async(_store, op)=>{
|
||||||
|
if (op !== 'get') throw Error('ANDROID_DATA_READ_ONLY');
|
||||||
|
return {value:[...local, ...remote]};
|
||||||
|
}});
|
||||||
|
return view.request(app, params);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -3,14 +3,15 @@
|
||||||
import json,sys,time
|
import json,sys,time
|
||||||
from rdp import RDP
|
from rdp import RDP
|
||||||
|
|
||||||
def evaluate(host, script):
|
def evaluate(host, script, connection=None):
|
||||||
r=RDP()
|
hostname, _, path = host.partition('/')
|
||||||
|
r=connection or RDP()
|
||||||
try:
|
try:
|
||||||
for process in r.call('root','listProcesses')['processes']:
|
for process in r.call('root','listProcesses')['processes']:
|
||||||
if process['isParent']: continue
|
if process['isParent']: continue
|
||||||
target=r.call(process['actor'],'getTarget')['process']
|
target=r.call(process['actor'],'getTarget')['process']
|
||||||
if 'webIsolated' not in target.get('remoteType',''): continue
|
if 'webIsolated' not in target.get('remoteType',''): continue
|
||||||
text='''(() => { const w=[...Services.ww.getWindowEnumerator()].find(w=>w.location.hostname===%s); if(!w)return null; return w.wrappedJSObject.eval(%s); })()''' % (json.dumps(host+'.localhost'),json.dumps(script))
|
text='''(() => { const w=[...Services.ww.getWindowEnumerator()].find(w=>w.location.hostname===%s && (!%s || w.location.pathname.startsWith(%s))); if(!w)return null; return w.wrappedJSObject.eval(%s); })()''' % (json.dumps(hostname+'.localhost'),json.dumps(path),json.dumps('/'+path),json.dumps(script))
|
||||||
response=r.call(target['consoleActor'],'evaluateJSAsync',text=text)
|
response=r.call(target['consoleActor'],'evaluateJSAsync',text=text)
|
||||||
if 'resultID' not in response: continue
|
if 'resultID' not in response: continue
|
||||||
while True:
|
while True:
|
||||||
|
|
@ -20,24 +21,32 @@ def evaluate(host, script):
|
||||||
if value.get('result') is not None and value.get('result') != {'type':'null'}: return value.get('result')
|
if value.get('result') is not None and value.get('result') != {'type':'null'}: return value.get('result')
|
||||||
break
|
break
|
||||||
raise RuntimeError('App not open: '+host)
|
raise RuntimeError('App not open: '+host)
|
||||||
finally:r.s.close()
|
finally:
|
||||||
|
if connection is None:r.s.close()
|
||||||
|
|
||||||
def run(host,expression,timeout=30):
|
def _run(host,expression,timeout,connection):
|
||||||
start=time.monotonic()+timeout
|
start=time.monotonic()+timeout
|
||||||
while True:
|
while True:
|
||||||
try:
|
try:
|
||||||
evaluate(host,'window.__androidProbe=null; Promise.resolve().then(async()=>('+expression+')).then(value=>window.__androidProbe=JSON.stringify({value}),error=>window.__androidProbe=JSON.stringify({error:String(error),stack:error.stack})); "started"')
|
evaluate(host,'window.__androidProbe=null; Promise.resolve().then(async()=>('+expression+')).then(value=>window.__androidProbe=JSON.stringify({value}),error=>window.__androidProbe=JSON.stringify({error:String(error),stack:error.stack})); "started"',connection)
|
||||||
break
|
break
|
||||||
except (RuntimeError, EOFError, OSError) as e:
|
except RuntimeError as e:
|
||||||
if time.monotonic()>=start:raise
|
if time.monotonic()>=start:raise
|
||||||
if isinstance(e, RuntimeError) and not str(e).startswith('App not open:'):raise
|
if not str(e).startswith('App not open:'):raise
|
||||||
time.sleep(.3)
|
time.sleep(.3)
|
||||||
until=time.monotonic()+timeout
|
until=time.monotonic()+timeout
|
||||||
while time.monotonic()<until:
|
while time.monotonic()<until:
|
||||||
result=evaluate(host,'window.__androidProbe || "pending"')
|
result=evaluate(host,'window.__androidProbe || "pending"',connection)
|
||||||
if isinstance(result,str) and result != 'pending':return json.loads(result)
|
if isinstance(result,str) and result != 'pending':return json.loads(result)
|
||||||
time.sleep(.3)
|
time.sleep(.3)
|
||||||
raise TimeoutError(host)
|
raise TimeoutError(host)
|
||||||
|
|
||||||
|
def run(host,expression,timeout=30):
|
||||||
|
connection=RDP()
|
||||||
|
try:
|
||||||
|
return _run(host,expression,timeout,connection)
|
||||||
|
finally:
|
||||||
|
connection.s.close()
|
||||||
|
|
||||||
if __name__=='__main__':
|
if __name__=='__main__':
|
||||||
print(json.dumps(run(sys.argv[1],sys.argv[2]),ensure_ascii=False,indent=2))
|
print(json.dumps(run(sys.argv[1],sys.argv[2]),ensure_ascii=False,indent=2))
|
||||||
|
|
|
||||||
|
|
@ -29,6 +29,8 @@ class RDP:
|
||||||
while True:
|
while True:
|
||||||
r = self.recv()
|
r = self.recv()
|
||||||
self.events.append(r)
|
self.events.append(r)
|
||||||
|
if str(r.get("type", "")).endswith("ListChanged"):
|
||||||
|
continue
|
||||||
if r.get("from") == to and (r.get("type") not in ["consoleAPICall", "pageError"]):
|
if r.get("from") == to and (r.get("type") not in ["consoleAPICall", "pageError"]):
|
||||||
return r
|
return r
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1 +1,202 @@
|
||||||
// Home layout recovery now lives in the shared host/platform-ui.js.
|
// Android-owned data stays in its provider; Gaia keeps its local data separately.
|
||||||
|
(() => {
|
||||||
|
const app = location.hostname.split('.')[0];
|
||||||
|
const fr = () => (document.documentElement.lang || navigator.language).startsWith('fr');
|
||||||
|
const text = (f,e) => fr() ? f : e;
|
||||||
|
const call = params => VulpesCompat.call('android.personal', params);
|
||||||
|
const notice = message => window.VulpesGaiaUI?.notice(message);
|
||||||
|
const readOnly = () => notice(text('Ces données appartiennent à Android. Modifiez-les dans l’application Android.',
|
||||||
|
'Android owns these records. Edit them in the Android app.'));
|
||||||
|
const failure = () => notice(text('Accès aux données Android indisponible. Vérifiez les autorisations dans Paramètres.',
|
||||||
|
'Android data is unavailable. Check permissions in Settings.'));
|
||||||
|
let dirty = false;
|
||||||
|
let selectedContact;
|
||||||
|
const pendingCallChanges = new Set();
|
||||||
|
function refreshCallLog() {
|
||||||
|
if (document.hidden || !window.CallLog?.sticky) return;
|
||||||
|
if (pendingCallChanges.has('calls')) {
|
||||||
|
CallLog.callLogContainer.textContent = '';
|
||||||
|
CallLog.render();
|
||||||
|
} else if (pendingCallChanges.has('contacts')) {
|
||||||
|
CallLog._contactCache = false;
|
||||||
|
CallLog.updateListWithContactInfo('update');
|
||||||
|
}
|
||||||
|
pendingCallChanges.clear();
|
||||||
|
}
|
||||||
|
if(app==='communications' && location.pathname.startsWith('/contacts')) {
|
||||||
|
// Gaia's first-paint HTML cache must not retain Android names after revocation.
|
||||||
|
localStorage.removeItem('firstChunk');
|
||||||
|
document.addEventListener('click',event=>{
|
||||||
|
const row=event.target.closest?.('[data-uuid]');
|
||||||
|
if(row) selectedContact=row.dataset.uuid;
|
||||||
|
},true);
|
||||||
|
let cache;
|
||||||
|
Object.defineProperty(window,'Cache',{configurable:true,get:()=>cache,set:value=>{
|
||||||
|
cache=value;
|
||||||
|
Object.defineProperties(cache,{
|
||||||
|
enabled:{get:()=>false},active:{get:()=>false},firstChunk:{set:()=>{}}
|
||||||
|
});
|
||||||
|
cache.apply=()=>Promise.reject();
|
||||||
|
}});
|
||||||
|
}
|
||||||
|
function canRefresh() {
|
||||||
|
if (document.hidden) return false;
|
||||||
|
if (app === 'sms') return window.Navigation?.isCurrentPanel('thread-list');
|
||||||
|
if (location.pathname.startsWith('/contacts')) return window.MainNavigation?.currentView() === 'view-contacts-list';
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
let refreshingMessages = false;
|
||||||
|
async function refreshMessages() {
|
||||||
|
const view=window.ConversationView, id=view?.activeThread?.id;
|
||||||
|
if(refreshingMessages || !(id < 0) || document.hidden || !window.Navigation?.isCurrentPanel('thread'))return;
|
||||||
|
refreshingMessages=true;
|
||||||
|
try {
|
||||||
|
const rows=await VulpesCompat.call('messages.request',{operation:'getMessages',args:[{threadId:id}]});
|
||||||
|
if(view.activeThread?.id!==id || document.hidden)return;
|
||||||
|
const ids=new Set(rows.map(row=>String(row.id)));
|
||||||
|
for(const node of document.querySelectorAll('[data-message-id]')) {
|
||||||
|
if(Number(node.dataset.messageId)<0 && !ids.has(node.dataset.messageId))view.removeMessageDOM(node);
|
||||||
|
}
|
||||||
|
for(const row of rows) {
|
||||||
|
const key=JSON.stringify(row),old=document.getElementById('message-'+row.id);
|
||||||
|
if(old?.dataset.androidRecord===key)continue;
|
||||||
|
const message={...row,timestamp:new Date(row.timestamp)};
|
||||||
|
window.Threads?.registerMessage(message);
|
||||||
|
await view.appendMessage(message,false);
|
||||||
|
const node=document.getElementById('message-'+row.id);if(node)node.dataset.androidRecord=key;
|
||||||
|
}
|
||||||
|
dirty=false;
|
||||||
|
} catch(error){failure();}finally{refreshingMessages=false;}
|
||||||
|
}
|
||||||
|
function refresh() {
|
||||||
|
if (app === 'communications' && location.pathname.startsWith('/dialer')) {
|
||||||
|
refreshCallLog();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (dirty && selectedContact && !document.hidden && window.MainNavigation?.currentView()==='view-contact-details') {
|
||||||
|
dirty = false;
|
||||||
|
const id = selectedContact;
|
||||||
|
VulpesCompat.call('contacts.request',{operation:'find',options:{filterBy:['id'],filterOp:'equals',filterValue:id}})
|
||||||
|
.then(rows=>{if(rows.length)Contacts.updateContactDetail(id);else Contacts.goBack();}).catch(failure);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if(dirty && app==='sms')refreshMessages();
|
||||||
|
if (!dirty || !canRefresh()) return;
|
||||||
|
dirty = false;
|
||||||
|
if(app==='sms' && window.InboxView?.container && !InboxView.inEditMode) InboxView.renderThreads();
|
||||||
|
else if(window.contacts?.List?.load) contacts.List.load(undefined,true);
|
||||||
|
}
|
||||||
|
addEventListener('visibilitychange', refresh);
|
||||||
|
addEventListener('hashchange', refresh);
|
||||||
|
addEventListener('transitionend', refresh);
|
||||||
|
addEventListener('vulpes-service-event', ({detail}) => {
|
||||||
|
if (detail.type !== 'android-data-changed') return;
|
||||||
|
if (app === 'communications' && location.pathname.startsWith('/dialer')) {
|
||||||
|
pendingCallChanges.add(detail.data.kind);
|
||||||
|
refreshCallLog();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
dirty = true;
|
||||||
|
refresh();
|
||||||
|
});
|
||||||
|
|
||||||
|
// Keep Gaia's call grouping/rendering while reading the current Android log.
|
||||||
|
if (app === 'communications' && location.pathname.startsWith('/dialer')) {
|
||||||
|
let value;
|
||||||
|
Object.defineProperty(window, 'CallLogDBManager', {configurable:true,
|
||||||
|
get:()=>value, set:db=>{
|
||||||
|
value=db;
|
||||||
|
const original = Object.fromEntries(['getGroupList','getGroup','getGroupAtPosition'].map(k=>[k,db[k].bind(db)]));
|
||||||
|
const groups = async () => {
|
||||||
|
const rows = await call({operation:'page',kind:'calls'});
|
||||||
|
const list = new Map();
|
||||||
|
for (const row of rows) {
|
||||||
|
const recent = {date:row.date,number:row.number || '',type:row.type===2 ? 'dialing':'incoming',
|
||||||
|
status:row.type===1 ? 'connected':null};
|
||||||
|
const id=db._getGroupId(recent), key=JSON.stringify(id);
|
||||||
|
if(!list.has(key)) list.set(key,{id,number:recent.number,serviceId:0,lastEntryDate:row.date,retryCount:0,calls:[]});
|
||||||
|
const g=list.get(key);g.lastEntryDate=Math.max(g.lastEntryDate,row.date);g.retryCount++;
|
||||||
|
g.calls.push({date:row.date,duration:row.duration*1000});
|
||||||
|
}
|
||||||
|
return [...list.values()].map(g=>{g.calls.sort((a,b)=>b.date-a.date);return db._getGroupObject(g);});
|
||||||
|
};
|
||||||
|
let nativeCalls=false;
|
||||||
|
const active=async()=> (nativeCalls=!!(await call({operation:'status',kind:'calls'})).calls);
|
||||||
|
db.getGroupList=async(callback,sortedBy,prev,cursor,limit)=>{
|
||||||
|
try {
|
||||||
|
if(!await active()) return original.getGroupList(callback,sortedBy,prev,cursor,limit);
|
||||||
|
// Native groups do not live in Gaia's IndexedDB contact cache.
|
||||||
|
if(window.CallLog)CallLog._contactCache=false;
|
||||||
|
let list=(await groups()).sort((a,b)=>(a.lastEntryDate-b.lastEntryDate)*(prev?-1:1));
|
||||||
|
if(limit>0)list=list.slice(0,limit);
|
||||||
|
if(!cursor)return callback(list);
|
||||||
|
let index=0;
|
||||||
|
const next=()=>queueMicrotask(()=>callback({value:list[index++] || null,continue:next}));next();
|
||||||
|
} catch(error) { failure(); callback(cursor?{value:null}:[]); }
|
||||||
|
};
|
||||||
|
db.getGroup=async(number,date,type,status)=>{
|
||||||
|
if(!await active())return original.getGroup(number,date,type,status);
|
||||||
|
const key=db._getGroupId({number,date,type,status}).join('-');
|
||||||
|
const found=(await groups()).find(g=>g.id===key);
|
||||||
|
if(!found)throw Error('NotFoundError');return found;
|
||||||
|
};
|
||||||
|
db.getGroupAtPosition=async(position,sortedBy,prev,type,callback)=>{
|
||||||
|
if(!await active())return original.getGroupAtPosition(position,sortedBy,prev,type,callback);
|
||||||
|
try {const list=(await groups()).filter(g=>!type||g.type===type).sort((a,b)=>(a.lastEntryDate-b.lastEntryDate)*(prev?-1:1));callback(list[position-1]||null);}
|
||||||
|
catch(error){failure();callback(null);}
|
||||||
|
};
|
||||||
|
document.addEventListener('click', event=>{
|
||||||
|
if(!nativeCalls || !event.target.closest?.('#call-log-icon-edit'))return;
|
||||||
|
// Editing Android logs is intentionally delegated in this first integration.
|
||||||
|
event.preventDefault();event.stopImmediatePropagation();readOnly();
|
||||||
|
call({operation:'open',kind:'calls'}).catch(failure);
|
||||||
|
},true);
|
||||||
|
}});
|
||||||
|
}
|
||||||
|
if(app==='communications' && location.pathname.startsWith('/contacts')) {
|
||||||
|
const timer=setInterval(()=>{
|
||||||
|
if(!window.Contacts?.showForm)return;
|
||||||
|
clearInterval(timer);
|
||||||
|
const original=Contacts.showForm;
|
||||||
|
Contacts.showForm=function(edit,contact) {
|
||||||
|
if(edit && String(contact?.id).startsWith('android:')) {
|
||||||
|
selectedContact=contact.id;
|
||||||
|
call({operation:'open',kind:'contacts',id:contact.id.slice(8)}).catch(failure);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
return original.apply(this,arguments);
|
||||||
|
};
|
||||||
|
},100);
|
||||||
|
addEventListener('pagehide',()=>clearInterval(timer),{once:true});
|
||||||
|
}
|
||||||
|
function initialize() {
|
||||||
|
if (app !== 'settings') return;
|
||||||
|
const root=document.querySelector('#root > div');
|
||||||
|
if(!root || document.querySelector(".vulpes-android-data"))return;
|
||||||
|
const header=document.createElement('header');header.className='vulpes-android-data';
|
||||||
|
const title=document.createElement('h2');title.textContent=text('Données Android','Android data');header.append(title);
|
||||||
|
const list=document.createElement('ul');list.className='vulpes-android-data';
|
||||||
|
const hint=document.createElement('p');hint.style.cssText='margin:1rem 1.5rem;font-size:1.4rem;line-height:1.5';
|
||||||
|
hint.textContent=text('Lecture des contacts, SMS (hors MMS) et appels Android. Envoi, modification et suppression dans Android. Les contacts créés dans Gaia restent locaux.',
|
||||||
|
'Read Android contacts, SMS (not MMS) and calls. Send, edit and delete in Android. Contacts created in Gaia stay local.');
|
||||||
|
root.append(header,hint,list);
|
||||||
|
for(const [kind,french,english] of [['contacts','Contacts','Contacts'],['sms','SMS','SMS'],['calls','Journal d’appels','Call history']]) {
|
||||||
|
const li=document.createElement('li'),button=document.createElement('button');
|
||||||
|
li.append(button);list.append(li);
|
||||||
|
let enabled=false;
|
||||||
|
const update=state=>{enabled=state[kind];button.textContent=text(french,english)+' — '+(enabled?text('Déconnecter','Disconnect'):text('Autoriser la lecture','Allow reading'));};
|
||||||
|
call({operation:'status'}).then(update).catch(failure);
|
||||||
|
button.onclick=async()=>{
|
||||||
|
button.disabled=true;
|
||||||
|
try {
|
||||||
|
const disconnect=enabled;
|
||||||
|
const state=await call({operation:disconnect?'disconnect':'permission',kind});update(state);
|
||||||
|
if(!disconnect && !state[kind])notice(text('Autorisation refusée ou restreinte par Android. L’application Android reste disponible.',
|
||||||
|
'Permission denied or restricted by Android. Your Android app is still available.'));
|
||||||
|
} catch(error){failure();} finally{button.disabled=false;}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(app==='settings') new MutationObserver(initialize).observe(document.documentElement,{childList:true,subtree:true});
|
||||||
|
if(document.readyState==='loading')addEventListener('DOMContentLoaded',initialize,{once:true});else initialize();
|
||||||
|
})();
|
||||||
|
|
|
||||||
|
|
@ -405,7 +405,7 @@ window.performance.measure('callLogReady','callLogStart');return;}
|
||||||
self._empty=false;var currDate=new Date(cursor.value.date);batchGroupCounter++;if(!prevDate||(currDate.getTime()==prevDate.getTime())){chunk.push(cursor.value);}else{daysToRender.push(chunk);chunk=[cursor.value];var renderNow=false;if(batchGroupCounter>=MAX_GROUPS_FOR_FIRST_RENDER&&!screenRendered){renderNow=true;screenRendered=true;window.performance.mark('firstChunkReady');}else if(batchGroupCounter>=MAX_GROUPS_TO_BATCH_RENDER){renderNow=true;}
|
self._empty=false;var currDate=new Date(cursor.value.date);batchGroupCounter++;if(!prevDate||(currDate.getTime()==prevDate.getTime())){chunk.push(cursor.value);}else{daysToRender.push(chunk);chunk=[cursor.value];var renderNow=false;if(batchGroupCounter>=MAX_GROUPS_FOR_FIRST_RENDER&&!screenRendered){renderNow=true;screenRendered=true;window.performance.mark('firstChunkReady');}else if(batchGroupCounter>=MAX_GROUPS_TO_BATCH_RENDER){renderNow=true;}
|
||||||
if(renderNow){self.renderSeveralDays(daysToRender);daysToRender=[];batchGroupCounter=0;}}
|
if(renderNow){self.renderSeveralDays(daysToRender);daysToRender=[];batchGroupCounter=0;}}
|
||||||
prevDate=currDate;cursor.continue();},'lastEntryDate',true,true);},renderSeveralDays:function cl_renderSeveralDays(chunks){for(var i=0,l=chunks.length;i<l;i++){this.renderChunk(chunks[i]);}},renderChunk:function cl_renderChunk(chunk){var callLogSection=this.createSectionForGroup(chunk[0]);var phoneNumbers=[];var logGroupContainer=callLogSection.getElementsByTagName('ol')[0];for(var i=0;i<chunk.length;i++){var current=chunk[i];var logGroupDOM=this.createGroup(current);logGroupContainer.appendChild(logGroupDOM);phoneNumbers.push(current.number);}
|
prevDate=currDate;cursor.continue();},'lastEntryDate',true,true);},renderSeveralDays:function cl_renderSeveralDays(chunks){for(var i=0,l=chunks.length;i<l;i++){this.renderChunk(chunks[i]);}},renderChunk:function cl_renderChunk(chunk){var callLogSection=this.createSectionForGroup(chunk[0]);var phoneNumbers=[];var logGroupContainer=callLogSection.getElementsByTagName('ol')[0];for(var i=0;i<chunk.length;i++){var current=chunk[i];var logGroupDOM=this.createGroup(current);logGroupContainer.appendChild(logGroupDOM);phoneNumbers.push(current.number);}
|
||||||
this.callLogContainer.appendChild(callLogSection);if(!this._contactCache){this.updateListWithContactInfo(null,null,phoneNumbers,logGroupContainer);}},renderEmptyCallLog:function cl_renderEmptyCallLog(isEmptyMissedCallsGroup){this.disableEditModeButton();if(!isEmptyMissedCallsGroup){this._empty=true;}
|
this.callLogContainer.appendChild(callLogSection);if(!this._contactCache){this.updateListWithContactInfo(null,null,logGroupContainer);}},renderEmptyCallLog:function cl_renderEmptyCallLog(isEmptyMissedCallsGroup){this.disableEditModeButton();if(!isEmptyMissedCallsGroup){this._empty=true;}
|
||||||
var noResultContainer=document.getElementById('no-result-container');noResultContainer.hidden=false;var allCallsMsg1=document.getElementById('no-result-msg1');var allCallsMsg2=document.getElementById('no-result-msg2');var noMissedCallsMsg=document.getElementById('no-result-msg3');allCallsMsg1.hidden=isEmptyMissedCallsGroup||false;allCallsMsg2.hidden=isEmptyMissedCallsGroup||false;noMissedCallsMsg.hidden=!isEmptyMissedCallsGroup;if(!isEmptyMissedCallsGroup){var noResultContainerClone=noResultContainer.cloneNode(true);this.callLogContainer.innerHTML='';this.callLogContainer.appendChild(noResultContainerClone);}},appendGroup:function cl_appendGroup(group){if(!this._initialized){return;}
|
var noResultContainer=document.getElementById('no-result-container');noResultContainer.hidden=false;var allCallsMsg1=document.getElementById('no-result-msg1');var allCallsMsg2=document.getElementById('no-result-msg2');var noMissedCallsMsg=document.getElementById('no-result-msg3');allCallsMsg1.hidden=isEmptyMissedCallsGroup||false;allCallsMsg2.hidden=isEmptyMissedCallsGroup||false;noMissedCallsMsg.hidden=!isEmptyMissedCallsGroup;if(!isEmptyMissedCallsGroup){var noResultContainerClone=noResultContainer.cloneNode(true);this.callLogContainer.innerHTML='';this.callLogContainer.appendChild(noResultContainerClone);}},appendGroup:function cl_appendGroup(group){if(!this._initialized){return;}
|
||||||
this.unfilter();this.enableEditModeButton();var logGroupDOM=this.createGroup(group);var dayIndex=group.date;var container=this.callLogContainer;var previousLogGroup=document.getElementById(group.id);if(previousLogGroup){var parent=previousLogGroup.parentNode;parent.removeChild(previousLogGroup);this.insertInSection(logGroupDOM,parent);return logGroupDOM;}
|
this.unfilter();this.enableEditModeButton();var logGroupDOM=this.createGroup(group);var dayIndex=group.date;var container=this.callLogContainer;var previousLogGroup=document.getElementById(group.id);if(previousLogGroup){var parent=previousLogGroup.parentNode;parent.removeChild(previousLogGroup);this.insertInSection(logGroupDOM,parent);return logGroupDOM;}
|
||||||
var groupSelector='[data-timestamp="'+dayIndex+'"]';var sectionExists=container.querySelector(groupSelector);if(sectionExists){var section=sectionExists.getElementsByTagName('ol')[0];this.insertInSection(logGroupDOM,section);return logGroupDOM;}
|
var groupSelector='[data-timestamp="'+dayIndex+'"]';var sectionExists=container.querySelector(groupSelector);if(sectionExists){var section=sectionExists.getElementsByTagName('ol')[0];this.insertInSection(logGroupDOM,section);return logGroupDOM;}
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,7 @@ window.performance.measure('callLogReady','callLogStart');return;}
|
||||||
self._empty=false;var currDate=new Date(cursor.value.date);batchGroupCounter++;if(!prevDate||(currDate.getTime()==prevDate.getTime())){chunk.push(cursor.value);}else{daysToRender.push(chunk);chunk=[cursor.value];var renderNow=false;if(batchGroupCounter>=MAX_GROUPS_FOR_FIRST_RENDER&&!screenRendered){renderNow=true;screenRendered=true;window.performance.mark('firstChunkReady');}else if(batchGroupCounter>=MAX_GROUPS_TO_BATCH_RENDER){renderNow=true;}
|
self._empty=false;var currDate=new Date(cursor.value.date);batchGroupCounter++;if(!prevDate||(currDate.getTime()==prevDate.getTime())){chunk.push(cursor.value);}else{daysToRender.push(chunk);chunk=[cursor.value];var renderNow=false;if(batchGroupCounter>=MAX_GROUPS_FOR_FIRST_RENDER&&!screenRendered){renderNow=true;screenRendered=true;window.performance.mark('firstChunkReady');}else if(batchGroupCounter>=MAX_GROUPS_TO_BATCH_RENDER){renderNow=true;}
|
||||||
if(renderNow){self.renderSeveralDays(daysToRender);daysToRender=[];batchGroupCounter=0;}}
|
if(renderNow){self.renderSeveralDays(daysToRender);daysToRender=[];batchGroupCounter=0;}}
|
||||||
prevDate=currDate;cursor.continue();},'lastEntryDate',true,true);},renderSeveralDays:function cl_renderSeveralDays(chunks){for(var i=0,l=chunks.length;i<l;i++){this.renderChunk(chunks[i]);}},renderChunk:function cl_renderChunk(chunk){var callLogSection=this.createSectionForGroup(chunk[0]);var phoneNumbers=[];var logGroupContainer=callLogSection.getElementsByTagName('ol')[0];for(var i=0;i<chunk.length;i++){var current=chunk[i];var logGroupDOM=this.createGroup(current);logGroupContainer.appendChild(logGroupDOM);phoneNumbers.push(current.number);}
|
prevDate=currDate;cursor.continue();},'lastEntryDate',true,true);},renderSeveralDays:function cl_renderSeveralDays(chunks){for(var i=0,l=chunks.length;i<l;i++){this.renderChunk(chunks[i]);}},renderChunk:function cl_renderChunk(chunk){var callLogSection=this.createSectionForGroup(chunk[0]);var phoneNumbers=[];var logGroupContainer=callLogSection.getElementsByTagName('ol')[0];for(var i=0;i<chunk.length;i++){var current=chunk[i];var logGroupDOM=this.createGroup(current);logGroupContainer.appendChild(logGroupDOM);phoneNumbers.push(current.number);}
|
||||||
this.callLogContainer.appendChild(callLogSection);if(!this._contactCache){this.updateListWithContactInfo(null,null,phoneNumbers,logGroupContainer);}},renderEmptyCallLog:function cl_renderEmptyCallLog(isEmptyMissedCallsGroup){this.disableEditModeButton();if(!isEmptyMissedCallsGroup){this._empty=true;}
|
this.callLogContainer.appendChild(callLogSection);if(!this._contactCache){this.updateListWithContactInfo(null,null,logGroupContainer);}},renderEmptyCallLog:function cl_renderEmptyCallLog(isEmptyMissedCallsGroup){this.disableEditModeButton();if(!isEmptyMissedCallsGroup){this._empty=true;}
|
||||||
var noResultContainer=document.getElementById('no-result-container');noResultContainer.hidden=false;var allCallsMsg1=document.getElementById('no-result-msg1');var allCallsMsg2=document.getElementById('no-result-msg2');var noMissedCallsMsg=document.getElementById('no-result-msg3');allCallsMsg1.hidden=isEmptyMissedCallsGroup||false;allCallsMsg2.hidden=isEmptyMissedCallsGroup||false;noMissedCallsMsg.hidden=!isEmptyMissedCallsGroup;if(!isEmptyMissedCallsGroup){var noResultContainerClone=noResultContainer.cloneNode(true);this.callLogContainer.innerHTML='';this.callLogContainer.appendChild(noResultContainerClone);}},appendGroup:function cl_appendGroup(group){if(!this._initialized){return;}
|
var noResultContainer=document.getElementById('no-result-container');noResultContainer.hidden=false;var allCallsMsg1=document.getElementById('no-result-msg1');var allCallsMsg2=document.getElementById('no-result-msg2');var noMissedCallsMsg=document.getElementById('no-result-msg3');allCallsMsg1.hidden=isEmptyMissedCallsGroup||false;allCallsMsg2.hidden=isEmptyMissedCallsGroup||false;noMissedCallsMsg.hidden=!isEmptyMissedCallsGroup;if(!isEmptyMissedCallsGroup){var noResultContainerClone=noResultContainer.cloneNode(true);this.callLogContainer.innerHTML='';this.callLogContainer.appendChild(noResultContainerClone);}},appendGroup:function cl_appendGroup(group){if(!this._initialized){return;}
|
||||||
this.unfilter();this.enableEditModeButton();var logGroupDOM=this.createGroup(group);var dayIndex=group.date;var container=this.callLogContainer;var previousLogGroup=document.getElementById(group.id);if(previousLogGroup){var parent=previousLogGroup.parentNode;parent.removeChild(previousLogGroup);this.insertInSection(logGroupDOM,parent);return logGroupDOM;}
|
this.unfilter();this.enableEditModeButton();var logGroupDOM=this.createGroup(group);var dayIndex=group.date;var container=this.callLogContainer;var previousLogGroup=document.getElementById(group.id);if(previousLogGroup){var parent=previousLogGroup.parentNode;parent.removeChild(previousLogGroup);this.insertInSection(logGroupDOM,parent);return logGroupDOM;}
|
||||||
var groupSelector='[data-timestamp="'+dayIndex+'"]';var sectionExists=container.querySelector(groupSelector);if(sectionExists){var section=sectionExists.getElementsByTagName('ol')[0];this.insertInSection(logGroupDOM,section);return logGroupDOM;}
|
var groupSelector='[data-timestamp="'+dayIndex+'"]';var sectionExists=container.querySelector(groupSelector);if(sectionExists){var section=sectionExists.getElementsByTagName('ol')[0];this.insertInSection(logGroupDOM,section);return logGroupDOM;}
|
||||||
|
|
|
||||||
|
|
@ -6,6 +6,12 @@
|
||||||
function labels(){document.getElementById('browse').textContent=text('Ouvrir le catalogue','Open catalogue');document.getElementById('open').textContent=text('Ouvrir','Open');document.getElementById('install').textContent=text('Installer','Install');document.getElementById('cancel').textContent=text('Annuler','Cancel');}
|
function labels(){document.getElementById('browse').textContent=text('Ouvrir le catalogue','Open catalogue');document.getElementById('open').textContent=text('Ouvrir','Open');document.getElementById('install').textContent=text('Installer','Install');document.getElementById('cancel').textContent=text('Annuler','Cancel');}
|
||||||
function loadFailed(){status(text('Catalogue inaccessible. Vérifiez la connexion Internet, puis réessayez.','Catalogue unavailable. Check your Internet connection, then try again.'));document.getElementById('open').hidden=true;}
|
function loadFailed(){status(text('Catalogue inaccessible. Vérifiez la connexion Internet, puis réessayez.','Catalogue unavailable. Check your Internet connection, then try again.'));document.getElementById('open').hidden=true;}
|
||||||
frame.addEventListener('mozbrowsererror',loadFailed);
|
frame.addEventListener('mozbrowsererror',loadFailed);
|
||||||
|
frame.addEventListener('mozbrowserclose',()=>{
|
||||||
|
if(busy)return;
|
||||||
|
status(text('Le catalogue est fermé. Vous pouvez le rouvrir ci-dessous.',
|
||||||
|
'The catalogue is closed. You can reopen it below.'));
|
||||||
|
document.getElementById('open').hidden=true;
|
||||||
|
});
|
||||||
function browse(){labels();message.hidden=true;dialog.hidden=true;frame.style.visibility='visible';frame.src='https://vulpes-os.org/marketplace/?mode=app&lang='+(fr()?'fr':'en');}
|
function browse(){labels();message.hidden=true;dialog.hidden=true;frame.style.visibility='visible';frame.src='https://vulpes-os.org/marketplace/?mode=app&lang='+(fr()?'fr':'en');}
|
||||||
function status(value){frame.style.visibility='hidden';message.hidden=false;document.getElementById('status').textContent=value;}
|
function status(value){frame.style.visibility='hidden';message.hidden=false;document.getElementById('status').textContent=value;}
|
||||||
async function prepare(url){
|
async function prepare(url){
|
||||||
|
|
|
||||||
|
|
@ -5,6 +5,25 @@
|
||||||
"en": "# Changelog — Vulpes OS\n\n[Français](CHANGELOG.md)\n\nUpdates by date and platform. Within each group: Add, Change, Fix, Note, Test. Entries describe the state at their date; a fix in development requires an updated installed version.\n"
|
"en": "# Changelog — Vulpes OS\n\n[Français](CHANGELOG.md)\n\nUpdates by date and platform. Within each group: Add, Change, Fix, Note, Test. Entries describe the state at their date; a fix in development requires an updated installed version.\n"
|
||||||
},
|
},
|
||||||
"entries": [
|
"entries": [
|
||||||
|
{
|
||||||
|
"id": "2.7-preview.21",
|
||||||
|
"text": {
|
||||||
|
"fr": "## 14/10/2026 : 2.7-preview.21\n\n\n\n### \n\n-   : Messages des fonctions indisponibles plus lisibles en thèmes clair et sombre.\n-   : Dictionnaires supplémentaires disponibles hors ligne ; activation et reprise du clavier Gaia fiabilisées. La vérification sur les appareils concernés reste nécessaire.\n-   : Affichage du nom des contacts rétabli au premier chargement du journal.\n-   : Panneaux Stockage rétablis. Une erreur de chargement ne bloque plus les autres menus.\n\n### \n\n-   : Lecture des contacts, SMS et journaux Android dans Gaia, après autorisation. Les données locales de Vulpes sont conservées.\n-   : Retour vers Vulpes sans écran blanc persistant ; un catalogue fermé peut être rouvert.\n-   : Le rectangle blanc signalé reste à reproduire sur les appareils concernés.\n-   : Première étape en lecture seule, hors MMS. Envoi et édition des données Android dans les applications Android ; les nouveaux contacts Gaia restent locaux. Accès SMS et journal selon les autorisations de la ROM et de l’installateur. Essais sur Android 9 ; autres versions à confirmer.\n\n### \n\n-   : Les corrections communes de Gaia sont incluses dans les images complètes et les mises à jour de démarrage.\n-   : Nouvelle image d’installation construite ; démarrage et flash sur Pixel à vérifier avant publication.\n",
|
||||||
|
"en": "## 14/10/2026 : 2.7-preview.21\n\n\n\n### \n\n-   : Unavailable-feature messages are easier to read in light and dark themes.\n-   : Contact names now appear when the call history first loads.\n-   : Additional dictionaries available offline; improved Gaia keyboard activation and recovery. Verification on affected devices is still needed.\n-   : Storage panels restored. A loading error no longer locks the other menus.\n\n### \n\n-   : Read Android contacts, SMS and call history in Gaia after granting access. Existing local Vulpes data is preserved.\n-   : Return to Vulpes without a persistent white overlay; a closed catalogue can be reopened.\n-   : The reported blank keyboard still needs reproduction on the affected devices.\n-   : First, read-only integration, excluding MMS. Sending and editing Android records use Android apps; new Gaia contacts stay local. SMS and call log access depend on ROM and installer permissions. Tested on Android 9; other versions need verification.\n\n### \n\n-   : Shared Gaia fixes are included in full installation images and boot updates.\n-   : New installation image built; Pixel boot and flashing must be tested before publication.\n"
|
||||||
|
},
|
||||||
|
"metadata": {
|
||||||
|
"kind": "version",
|
||||||
|
"status": "published",
|
||||||
|
"platforms": [
|
||||||
|
"pc",
|
||||||
|
"apk",
|
||||||
|
"models"
|
||||||
|
],
|
||||||
|
"models": [
|
||||||
|
"sargo"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"id": "2.7-preview.20",
|
"id": "2.7-preview.20",
|
||||||
"text": {
|
"text": {
|
||||||
|
|
@ -907,6 +926,13 @@
|
||||||
"url": "https://nnsprod.com/git/oversu/VulpesOS/releases/tag/android-2.7-preview.1",
|
"url": "https://nnsprod.com/git/oversu/VulpesOS/releases/tag/android-2.7-preview.1",
|
||||||
"summary": "# Vulpes OS — 2.7-preview.1\n\n🇫🇷 Ancienne Preview Android expérimentale. Une version plus récente est disponible dans les releases du projet.\n\n🇬🇧 Older experimental Android Preview. A newer version is available in the project releases.",
|
"summary": "# Vulpes OS — 2.7-preview.1\n\n🇫🇷 Ancienne Preview Android expérimentale. Une version plus récente est disponible dans les releases du projet.\n\n🇬🇧 Older experimental Android Preview. A newer version is available in the project releases.",
|
||||||
"include_entry": true
|
"include_entry": true
|
||||||
|
},
|
||||||
|
"v2.7-preview.21": {
|
||||||
|
"version": "2.7-preview.21",
|
||||||
|
"after": "2.7-preview.20",
|
||||||
|
"url": "https://nnsprod.com/git/oversu/VulpesOS/releases/tag/v2.7-preview.21",
|
||||||
|
"include_entry": true,
|
||||||
|
"summary": "# Vulpes OS — 2.7-preview.21\n\n🇫🇷 **Preview Android expérimentale.** Contacts, SMS et journal d’appels Android accessibles dans Gaia après autorisation, en lecture seule. Les données locales Vulpes sont conservées. Les MMS ne sont pas synchronisés ; appels, envoi et modification des données Android passent par les applications Android.\n\nInstaller l’APK par-dessus une Preview précédente signée avec la même clé. Android 8 minimum déclaré ; ARM64, ARMv7 et x86_64. Intégration vérifiée sur émulateur Android 9 avec des données de test ; les Motorola signalés et les versions Android récentes restent à qualifier. Le problème de clavier blanc n’est pas considéré comme résolu sur tous les appareils.\n\nBuild de développement signé, débogage via ADB autorisé. Gaia 2.7.0 · GeckoView Android 156.0. Vérification du téléchargement : `sha256sum -c SHA256SUMS.txt`. **Aucune nouvelle image Pixel n’est publiée ici : son flash et ses tests restent à effectuer.**\n\n🇬🇧 **Experimental Android Preview.** Android contacts, SMS and call history can be read in Gaia after granting permission. Local Vulpes data is preserved. MMS are not synchronized; calls, sending and editing Android records use Android apps.\n\nInstall over a previous Preview signed with the same key. Declared minimum Android 8; ARM64, ARMv7 and x86_64. Integration checked on an Android 9 emulator with test data; reported Motorola devices and recent Android versions still need qualification. The blank keyboard issue is not considered fixed on every device.\n\nSigned development build, debugging through authorized ADB. Gaia 2.7.0 · Android GeckoView 156.0. Verify the download with `sha256sum -c SHA256SUMS.txt`. **No new Pixel image is published here: flashing and hardware tests are still pending.**\n"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -265,8 +265,7 @@ var CallLog = {
|
||||||
// If the contacts cache is not valid, we retrieve the contacts information
|
// If the contacts cache is not valid, we retrieve the contacts information
|
||||||
// directly from the contacts API and update the DOM accordingly.
|
// directly from the contacts API and update the DOM accordingly.
|
||||||
if (!this._contactCache) {
|
if (!this._contactCache) {
|
||||||
this.updateListWithContactInfo(null, null, phoneNumbers,
|
this.updateListWithContactInfo(null, null, logGroupContainer);
|
||||||
logGroupContainer);
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -9,10 +9,9 @@ var LayoutDictionaryDownloader = function(imEngineId, dictFilename) {
|
||||||
this._xhr = null;
|
this._xhr = null;
|
||||||
};
|
};
|
||||||
|
|
||||||
// Remote URLs to download the data. We require the remote server to have
|
// Dictionaries ship with Vulpes so adding a layout also works offline.
|
||||||
// CORS turned on since we are not asking for SystemXHR permission.
|
|
||||||
LayoutDictionaryDownloader.prototype.REMOTE_URL =
|
LayoutDictionaryDownloader.prototype.REMOTE_URL =
|
||||||
'https://fxos.cdn.mozilla.net/dictionaries/%imEngineId/%ver/%dictFilename';
|
'/js/imes/%imEngineId/dictionaries/%dictFilename';
|
||||||
|
|
||||||
// If the data schema changes in an incompatible way, we must bump the
|
// If the data schema changes in an incompatible way, we must bump the
|
||||||
// version-to-download here.
|
// version-to-download here.
|
||||||
|
|
|
||||||
|
|
@ -6,6 +6,12 @@
|
||||||
function labels(){document.getElementById('browse').textContent=text('Ouvrir le catalogue','Open catalogue');document.getElementById('open').textContent=text('Ouvrir','Open');document.getElementById('install').textContent=text('Installer','Install');document.getElementById('cancel').textContent=text('Annuler','Cancel');}
|
function labels(){document.getElementById('browse').textContent=text('Ouvrir le catalogue','Open catalogue');document.getElementById('open').textContent=text('Ouvrir','Open');document.getElementById('install').textContent=text('Installer','Install');document.getElementById('cancel').textContent=text('Annuler','Cancel');}
|
||||||
function loadFailed(){status(text('Catalogue inaccessible. Vérifiez la connexion Internet, puis réessayez.','Catalogue unavailable. Check your Internet connection, then try again.'));document.getElementById('open').hidden=true;}
|
function loadFailed(){status(text('Catalogue inaccessible. Vérifiez la connexion Internet, puis réessayez.','Catalogue unavailable. Check your Internet connection, then try again.'));document.getElementById('open').hidden=true;}
|
||||||
frame.addEventListener('mozbrowsererror',loadFailed);
|
frame.addEventListener('mozbrowsererror',loadFailed);
|
||||||
|
frame.addEventListener('mozbrowserclose',()=>{
|
||||||
|
if(busy)return;
|
||||||
|
status(text('Le catalogue est fermé. Vous pouvez le rouvrir ci-dessous.',
|
||||||
|
'The catalogue is closed. You can reopen it below.'));
|
||||||
|
document.getElementById('open').hidden=true;
|
||||||
|
});
|
||||||
function browse(){labels();message.hidden=true;dialog.hidden=true;frame.style.visibility='visible';frame.src='https://vulpes-os.org/marketplace/?mode=app&lang='+(fr()?'fr':'en');}
|
function browse(){labels();message.hidden=true;dialog.hidden=true;frame.style.visibility='visible';frame.src='https://vulpes-os.org/marketplace/?mode=app&lang='+(fr()?'fr':'en');}
|
||||||
function status(value){frame.style.visibility='hidden';message.hidden=false;document.getElementById('status').textContent=value;}
|
function status(value){frame.style.visibility='hidden';message.hidden=false;document.getElementById('status').textContent=value;}
|
||||||
async function prepare(url){
|
async function prepare(url){
|
||||||
|
|
|
||||||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue