Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(22)

Unified Diff: chrome/android/webapk/libs/client/src/org/chromium/webapk/lib/client/WebApkValidator.java

Issue 2629573004: Add a chrome://webapks page. (Closed)
Patch Set: Add a chrome://webapks page. Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/android/webapk/libs/client/src/org/chromium/webapk/lib/client/WebApkValidator.java
diff --git a/chrome/android/webapk/libs/client/src/org/chromium/webapk/lib/client/WebApkValidator.java b/chrome/android/webapk/libs/client/src/org/chromium/webapk/lib/client/WebApkValidator.java
index 377494bdae5659ecf521421ede980fe4317abced..bb1e2ec37140302172b5b7efc06dda697d881154 100644
--- a/chrome/android/webapk/libs/client/src/org/chromium/webapk/lib/client/WebApkValidator.java
+++ b/chrome/android/webapk/libs/client/src/org/chromium/webapk/lib/client/WebApkValidator.java
@@ -69,7 +69,6 @@ public class WebApkValidator {
public static String findWebApkPackage(Context context, List<ResolveInfo> infos) {
for (ResolveInfo info : infos) {
if (info.activityInfo != null
- && info.activityInfo.packageName.startsWith(WEBAPK_PACKAGE_PREFIX)
&& isValidWebApk(context, info.activityInfo.packageName)) {
return info.activityInfo.packageName;
}
@@ -83,11 +82,14 @@ public class WebApkValidator {
* @param webappPackageName The package name to check
* @return true iff the WebAPK is installed and passes security checks
*/
- private static boolean isValidWebApk(Context context, String webappPackageName) {
+ public static boolean isValidWebApk(Context context, String webappPackageName) {
if (sExpectedSignature == null) {
Log.wtf(TAG, "WebApk validation failure - expected signature not set."
+ "missing call to WebApkValidator.initWithBrowserHostSignature");
}
+ if (!webappPackageName.startsWith(WEBAPK_PACKAGE_PREFIX)) {
+ return false;
+ }
// check signature
PackageInfo packageInfo = null;
try {

Powered by Google App Engine
This is Rietveld 408576698