Merge "Switch to HexEncoding from ByteStringUtils" into qt-dev-plus-aosp

This commit is contained in:
Neil Fuller
2019-05-28 16:40:17 +00:00
committed by Android (Google) Code Review

View File

@@ -256,7 +256,6 @@ import android.text.format.DateUtils;
import android.util.ArrayMap;
import android.util.ArraySet;
import android.util.Base64;
import android.util.ByteStringUtils;
import android.util.DisplayMetrics;
import android.util.EventLog;
import android.util.ExceptionUtils;
@@ -330,6 +329,7 @@ import dalvik.system.VMRuntime;
import libcore.io.IoUtils;
import libcore.util.EmptyArray;
import libcore.util.HexEncoding;
import org.xmlpull.v1.XmlPullParser;
import org.xmlpull.v1.XmlPullParserException;
@@ -10656,8 +10656,9 @@ public class PackageManagerService extends IPackageManager.Stub
} else {
// lib signing cert could have rotated beyond the one expected, check to see
// if the new one has been blessed by the old
if (!libPkg.mSigningDetails.hasSha256Certificate(
ByteStringUtils.fromHexToByteArray(expectedCertDigests[0]))) {
byte[] digestBytes = HexEncoding.decode(
expectedCertDigests[0], false /* allowSingleChar */);
if (!libPkg.mSigningDetails.hasSha256Certificate(digestBytes)) {
throw new PackageManagerException(
INSTALL_FAILED_MISSING_SHARED_LIBRARY,
"Package " + packageName + " requires differently signed" +