1 /* 2 * Copyright (C) 2020 The Android Open Source Project 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 17 package com.android.apksig; 18 19 import com.android.apksig.internal.apk.stamp.SourceStampConstants; 20 import com.android.apksig.internal.apk.v1.V1SchemeConstants; 21 import com.android.apksig.internal.apk.v2.V2SchemeConstants; 22 import com.android.apksig.internal.apk.v3.V3SchemeConstants; 23 24 /** 25 * Exports internally defined constants to allow clients to reference these values without relying 26 * on internal code. 27 */ 28 public class Constants { Constants()29 private Constants() {} 30 31 public static final int VERSION_SOURCE_STAMP = 0; 32 public static final int VERSION_JAR_SIGNATURE_SCHEME = 1; 33 public static final int VERSION_APK_SIGNATURE_SCHEME_V2 = 2; 34 public static final int VERSION_APK_SIGNATURE_SCHEME_V3 = 3; 35 public static final int VERSION_APK_SIGNATURE_SCHEME_V4 = 4; 36 37 public static final String MANIFEST_ENTRY_NAME = V1SchemeConstants.MANIFEST_ENTRY_NAME; 38 39 public static final int APK_SIGNATURE_SCHEME_V2_BLOCK_ID = 40 V2SchemeConstants.APK_SIGNATURE_SCHEME_V2_BLOCK_ID; 41 42 public static final int APK_SIGNATURE_SCHEME_V3_BLOCK_ID = 43 V3SchemeConstants.APK_SIGNATURE_SCHEME_V3_BLOCK_ID; 44 public static final int PROOF_OF_ROTATION_ATTR_ID = V3SchemeConstants.PROOF_OF_ROTATION_ATTR_ID; 45 46 public static final int V1_SOURCE_STAMP_BLOCK_ID = 47 SourceStampConstants.V1_SOURCE_STAMP_BLOCK_ID; 48 public static final int V2_SOURCE_STAMP_BLOCK_ID = 49 SourceStampConstants.V2_SOURCE_STAMP_BLOCK_ID; 50 } 51