| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
package android.content.pm; |
| 18 |
|
| 19 |
import android.compat.annotation.UnsupportedAppUsage; |
| 20 |
import android.os.Build; |
| 21 |
import android.os.Parcel; |
| 22 |
import android.os.Parcelable; |
| 23 |
|
| 24 |
import java.security.PublicKey; |
| 25 |
|
| 26 |
|
| 27 |
|
| 28 |
|
| 29 |
|
| 30 |
|
| 31 |
|
| 32 |
public class VerifierInfo implements Parcelable { |
| 33 |
|
| 34 |
public final String packageName; |
| 35 |
|
| 36 |
|
| 37 |
public final PublicKey publicKey; |
| 38 |
|
| 39 |
|
| 40 |
|
| 41 |
|
| 42 |
|
| 43 |
|
| 44 |
|
| 45 |
|
| 46 |
|
| 47 |
|
| 48 |
@UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553) |
| 49 |
public VerifierInfo(String packageName, PublicKey publicKey) { |
| 50 |
if (packageName == null || packageName.length() == 0) { |
| 51 |
throw new IllegalArgumentException("packageName must not be null or empty"); |
| 52 |
} else if (publicKey == null) { |
| 53 |
throw new IllegalArgumentException("publicKey must not be null"); |
| 54 |
} |
| 55 |
|
| 56 |
this.packageName = packageName; |
| 57 |
this.publicKey = publicKey; |
| 58 |
} |
| 59 |
|
| 60 |
private VerifierInfo(Parcel source) { |
| 61 |
packageName = source.readString(); |
| 62 |
publicKey = (PublicKey) source.readSerializable(java.security.PublicKey.class.getClassLoader(), java.security.PublicKey.class); |
| 63 |
} |
| 64 |
|
| 65 |
@Override |
| 66 |
public int describeContents() { |
| 67 |
return 0; |
| 68 |
} |
| 69 |
|
| 70 |
@Override |
| 71 |
public void writeToParcel(Parcel dest, int flags) { |
| 72 |
dest.writeString(packageName); |
| 73 |
dest.writeSerializable(publicKey); |
| 74 |
} |
| 75 |
|
| 76 |
public static final @android.annotation.NonNull Parcelable.Creator<VerifierInfo> CREATOR |
| 77 |
= new Parcelable.Creator<VerifierInfo>() { |
| 78 |
public VerifierInfo createFromParcel(Parcel source) { |
| 79 |
return new VerifierInfo(source); |
| 80 |
} |
| 81 |
|
| 82 |
public VerifierInfo[] newArray(int size) { |
| 83 |
return new VerifierInfo[size]; |
| 84 |
} |
| 85 |
}; |
| 86 |
} |