Loading build/e_patches/Browser-Add-support-for-eOS-webapk.patch 0 → 100644 +45 −0 Original line number Original line Diff line number Diff line From 3977a8ca23a92ca27040e7c4e090ae110314f4d8 Mon Sep 17 00:00:00 2001 From: althafvly <althafvly@gmail.com> Date: Thu, 29 May 2025 19:49:11 +0530 Subject: Browser: Add support for /e/OS webapk --- .../components/webapk/lib/client/WebApkValidator.java | 4 +++- .../components/webapk/lib/common/WebApkConstants.java | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/components/webapk/android/libs/client/src/org/chromium/components/webapk/lib/client/WebApkValidator.java b/components/webapk/android/libs/client/src/org/chromium/components/webapk/lib/client/WebApkValidator.java index 3c01521024120..8bd8467c8b4eb 100644 --- a/components/webapk/android/libs/client/src/org/chromium/components/webapk/lib/client/WebApkValidator.java +++ b/components/webapk/android/libs/client/src/org/chromium/components/webapk/lib/client/WebApkValidator.java @@ -6,6 +6,7 @@ package org.chromium.components.webapk.lib.client; import static org.chromium.build.NullUtil.assumeNonNull; import static org.chromium.components.webapk.lib.common.WebApkConstants.WEBAPK_PACKAGE_PREFIX; +import static org.chromium.components.webapk.lib.common.WebApkConstants.E_WEBAPK_PACKAGE_PREFIX; import static org.chromium.components.webapk.lib.common.WebApkMetaDataKeys.SCOPE; import static org.chromium.components.webapk.lib.common.WebApkMetaDataKeys.START_URL; import static org.chromium.components.webapk.lib.common.WebApkMetaDataKeys.WEB_MANIFEST_URL; @@ -422,7 +423,8 @@ public class WebApkValidator { private static boolean verifyV1WebApk(PackageInfo packageInfo, String webappPackageName) { if (packageInfo.signatures == null || packageInfo.signatures.length != 2 - || !webappPackageName.startsWith(WEBAPK_PACKAGE_PREFIX)) { + || !(webappPackageName.startsWith(WEBAPK_PACKAGE_PREFIX) + || webappPackageName.startsWith(E_WEBAPK_PACKAGE_PREFIX))) { return false; } for (Signature signature : packageInfo.signatures) { diff --git a/components/webapk/android/libs/common/src/org/chromium/components/webapk/lib/common/WebApkConstants.java b/components/webapk/android/libs/common/src/org/chromium/components/webapk/lib/common/WebApkConstants.java index dc63f37ad40b1..d83407803058b 100644 --- a/components/webapk/android/libs/common/src/org/chromium/components/webapk/lib/common/WebApkConstants.java +++ b/components/webapk/android/libs/common/src/org/chromium/components/webapk/lib/common/WebApkConstants.java @@ -10,4 +10,5 @@ import org.chromium.build.annotations.NullMarked; @NullMarked public final class WebApkConstants { public static final String WEBAPK_PACKAGE_PREFIX = "org.chromium.webapk"; + public static final String E_WEBAPK_PACKAGE_PREFIX = "foundation.e.webapk"; } -- 2.34.1 build/e_patches/Browser-Check-for-webapk-and-system-signature.patch 0 → 100644 +68 −0 Original line number Original line Diff line number Diff line From 74cc04e57f5810393700f050c7874b0d68b6af12 Mon Sep 17 00:00:00 2001 From: althafvly <althafvly@gmail.com> Date: Thu, 29 May 2025 17:12:54 +0530 Subject: Browser: Check for webapk and system signature --- .../webapk/lib/client/WebApkValidator.java | 32 +++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/components/webapk/android/libs/client/src/org/chromium/components/webapk/lib/client/WebApkValidator.java b/components/webapk/android/libs/client/src/org/chromium/components/webapk/lib/client/WebApkValidator.java index 5f63e80bc1a2e..3c01521024120 100644 --- a/components/webapk/android/libs/client/src/org/chromium/components/webapk/lib/client/WebApkValidator.java +++ b/components/webapk/android/libs/client/src/org/chromium/components/webapk/lib/client/WebApkValidator.java @@ -65,6 +65,8 @@ public class WebApkValidator { private static @Nullable PublicKey sCommentSignedPublicKey; private static boolean sOverrideValidation; + private static final String BROWSER_PACKAGE_NAME = "foundation.e.browser"; + @IntDef({ ValidationResult.FAILURE, ValidationResult.V1_WEB_APK, @@ -340,12 +342,42 @@ public class WebApkValidator { return ValidationResult.MAPS_LITE; } + if (isSignedTrusted(packageInfo, context)) { + return ValidationResult.COMMENT_SIGNED; + } if (verifyCommentSignedWebApk(packageInfo)) { return ValidationResult.COMMENT_SIGNED; } return ValidationResult.FAILURE; } + public static boolean isSignedTrusted(PackageInfo packageInfo, Context context) { + try { + if (packageInfo == null || packageInfo.signatures == null) { + return false; + } + + PackageInfo browserPackageInfo = context.getPackageManager().getPackageInfo( + BROWSER_PACKAGE_NAME, PackageManager.GET_SIGNATURES); + + if (browserPackageInfo == null || browserPackageInfo.signatures == null) { + return false; + } + + for (Signature sig1 : packageInfo.signatures) { + for (Signature sig2 : browserPackageInfo.signatures) { + if (sig1.equals(sig2)) { + return true; + } + } + } + } catch (Exception e) { + Log.e(TAG, "Exception while comparing signatures", e); + } + + return false; + } + /** * @param url A Url that might launch a WebApk. * @param applicationPackage The package of the WebApk to restrict the launch to. -- 2.34.1 build/e_patches_list.txt +2 −0 Original line number Original line Diff line number Diff line Loading @@ -65,3 +65,5 @@ Migrate-to-murena-search-from-spot.patch updater-disable-updater-pings.patch updater-disable-updater-pings.patch Disable-Component-Updates.patch Disable-Component-Updates.patch Browser-Move-to-Murena-Qwant-from-QwanteSpot.patch Browser-Move-to-Murena-Qwant-from-QwanteSpot.patch Browser-Check-for-webapk-and-system-signature.patch Browser-Add-support-for-eOS-webapk.patch Loading
build/e_patches/Browser-Add-support-for-eOS-webapk.patch 0 → 100644 +45 −0 Original line number Original line Diff line number Diff line From 3977a8ca23a92ca27040e7c4e090ae110314f4d8 Mon Sep 17 00:00:00 2001 From: althafvly <althafvly@gmail.com> Date: Thu, 29 May 2025 19:49:11 +0530 Subject: Browser: Add support for /e/OS webapk --- .../components/webapk/lib/client/WebApkValidator.java | 4 +++- .../components/webapk/lib/common/WebApkConstants.java | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/components/webapk/android/libs/client/src/org/chromium/components/webapk/lib/client/WebApkValidator.java b/components/webapk/android/libs/client/src/org/chromium/components/webapk/lib/client/WebApkValidator.java index 3c01521024120..8bd8467c8b4eb 100644 --- a/components/webapk/android/libs/client/src/org/chromium/components/webapk/lib/client/WebApkValidator.java +++ b/components/webapk/android/libs/client/src/org/chromium/components/webapk/lib/client/WebApkValidator.java @@ -6,6 +6,7 @@ package org.chromium.components.webapk.lib.client; import static org.chromium.build.NullUtil.assumeNonNull; import static org.chromium.components.webapk.lib.common.WebApkConstants.WEBAPK_PACKAGE_PREFIX; +import static org.chromium.components.webapk.lib.common.WebApkConstants.E_WEBAPK_PACKAGE_PREFIX; import static org.chromium.components.webapk.lib.common.WebApkMetaDataKeys.SCOPE; import static org.chromium.components.webapk.lib.common.WebApkMetaDataKeys.START_URL; import static org.chromium.components.webapk.lib.common.WebApkMetaDataKeys.WEB_MANIFEST_URL; @@ -422,7 +423,8 @@ public class WebApkValidator { private static boolean verifyV1WebApk(PackageInfo packageInfo, String webappPackageName) { if (packageInfo.signatures == null || packageInfo.signatures.length != 2 - || !webappPackageName.startsWith(WEBAPK_PACKAGE_PREFIX)) { + || !(webappPackageName.startsWith(WEBAPK_PACKAGE_PREFIX) + || webappPackageName.startsWith(E_WEBAPK_PACKAGE_PREFIX))) { return false; } for (Signature signature : packageInfo.signatures) { diff --git a/components/webapk/android/libs/common/src/org/chromium/components/webapk/lib/common/WebApkConstants.java b/components/webapk/android/libs/common/src/org/chromium/components/webapk/lib/common/WebApkConstants.java index dc63f37ad40b1..d83407803058b 100644 --- a/components/webapk/android/libs/common/src/org/chromium/components/webapk/lib/common/WebApkConstants.java +++ b/components/webapk/android/libs/common/src/org/chromium/components/webapk/lib/common/WebApkConstants.java @@ -10,4 +10,5 @@ import org.chromium.build.annotations.NullMarked; @NullMarked public final class WebApkConstants { public static final String WEBAPK_PACKAGE_PREFIX = "org.chromium.webapk"; + public static final String E_WEBAPK_PACKAGE_PREFIX = "foundation.e.webapk"; } -- 2.34.1
build/e_patches/Browser-Check-for-webapk-and-system-signature.patch 0 → 100644 +68 −0 Original line number Original line Diff line number Diff line From 74cc04e57f5810393700f050c7874b0d68b6af12 Mon Sep 17 00:00:00 2001 From: althafvly <althafvly@gmail.com> Date: Thu, 29 May 2025 17:12:54 +0530 Subject: Browser: Check for webapk and system signature --- .../webapk/lib/client/WebApkValidator.java | 32 +++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/components/webapk/android/libs/client/src/org/chromium/components/webapk/lib/client/WebApkValidator.java b/components/webapk/android/libs/client/src/org/chromium/components/webapk/lib/client/WebApkValidator.java index 5f63e80bc1a2e..3c01521024120 100644 --- a/components/webapk/android/libs/client/src/org/chromium/components/webapk/lib/client/WebApkValidator.java +++ b/components/webapk/android/libs/client/src/org/chromium/components/webapk/lib/client/WebApkValidator.java @@ -65,6 +65,8 @@ public class WebApkValidator { private static @Nullable PublicKey sCommentSignedPublicKey; private static boolean sOverrideValidation; + private static final String BROWSER_PACKAGE_NAME = "foundation.e.browser"; + @IntDef({ ValidationResult.FAILURE, ValidationResult.V1_WEB_APK, @@ -340,12 +342,42 @@ public class WebApkValidator { return ValidationResult.MAPS_LITE; } + if (isSignedTrusted(packageInfo, context)) { + return ValidationResult.COMMENT_SIGNED; + } if (verifyCommentSignedWebApk(packageInfo)) { return ValidationResult.COMMENT_SIGNED; } return ValidationResult.FAILURE; } + public static boolean isSignedTrusted(PackageInfo packageInfo, Context context) { + try { + if (packageInfo == null || packageInfo.signatures == null) { + return false; + } + + PackageInfo browserPackageInfo = context.getPackageManager().getPackageInfo( + BROWSER_PACKAGE_NAME, PackageManager.GET_SIGNATURES); + + if (browserPackageInfo == null || browserPackageInfo.signatures == null) { + return false; + } + + for (Signature sig1 : packageInfo.signatures) { + for (Signature sig2 : browserPackageInfo.signatures) { + if (sig1.equals(sig2)) { + return true; + } + } + } + } catch (Exception e) { + Log.e(TAG, "Exception while comparing signatures", e); + } + + return false; + } + /** * @param url A Url that might launch a WebApk. * @param applicationPackage The package of the WebApk to restrict the launch to. -- 2.34.1
build/e_patches_list.txt +2 −0 Original line number Original line Diff line number Diff line Loading @@ -65,3 +65,5 @@ Migrate-to-murena-search-from-spot.patch updater-disable-updater-pings.patch updater-disable-updater-pings.patch Disable-Component-Updates.patch Disable-Component-Updates.patch Browser-Move-to-Murena-Qwant-from-QwanteSpot.patch Browser-Move-to-Murena-Qwant-from-QwanteSpot.patch Browser-Check-for-webapk-and-system-signature.patch Browser-Add-support-for-eOS-webapk.patch