OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 package org.chromium.webapk.lib.client; | 5 package org.chromium.webapk.lib.client; |
6 | 6 |
7 import static org.chromium.webapk.lib.common.WebApkConstants.WEBAPK_PACKAGE_PREF
IX; | 7 import static org.chromium.webapk.lib.common.WebApkConstants.WEBAPK_PACKAGE_PREF
IX; |
8 | 8 |
9 import android.content.Context; | 9 import android.content.Context; |
10 import android.content.Intent; | 10 import android.content.Intent; |
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
111 Log.d(TAG, "WebApk invalid"); | 111 Log.d(TAG, "WebApk invalid"); |
112 return false; | 112 return false; |
113 } | 113 } |
114 | 114 |
115 /** | 115 /** |
116 * Initializes the WebApkValidator with the expected signature that WebAPKs
must be signed | 116 * Initializes the WebApkValidator with the expected signature that WebAPKs
must be signed |
117 * with for the current host. | 117 * with for the current host. |
118 * @param expectedSignature | 118 * @param expectedSignature |
119 */ | 119 */ |
120 public static void initWithBrowserHostSignature(byte[] expectedSignature) { | 120 public static void initWithBrowserHostSignature(byte[] expectedSignature) { |
| 121 if (sExpectedSignature != null) { |
| 122 return; |
| 123 } |
121 sExpectedSignature = Arrays.copyOf(expectedSignature, expectedSignature.
length); | 124 sExpectedSignature = Arrays.copyOf(expectedSignature, expectedSignature.
length); |
122 } | 125 } |
123 } | 126 } |
OLD | NEW |