类 AppBundleUtils
java.lang.Object
io.github.amsonix.molt.internal.reschiper.bundle.AppBundleUtils
Utility methods for working with Android App Bundles (AABs).
-
构造器概要
构造器 -
方法概要
修饰符和类型方法说明static @NotNull StringbytesToHexString(byte @NotNull [] src) Convert a byte array to a hexadecimal string.static @NotNull StringgetEntryMd5(@NotNull ZipFile bundleZipFile, @NotNull com.android.tools.build.bundletool.model.ModuleEntry entry, @NotNull com.android.tools.build.bundletool.model.BundleModule bundleModule) Get the MD5 hash of a specific entry within the AAB.static StringgetEntryNameByResourceName(@NotNull String resourceName) Get the entry name from a resource name in the format "package.type.entry".static StringgetResourceFullName(@NotNull com.android.tools.build.bundletool.model.ResourceTableEntry entry) Get the full resource name from a ResourceTableEntry.static StringgetResourceFullName(String packageName, String typeName, String entryName) Get the full resource name from individual components.static StringgetTypeNameByResourceName(@NotNull String resourceName) Get the type name from a resource name in the format "package.type.entry".static longgetZipEntrySize(@NotNull ZipFile bundleZipFile, @NotNull com.android.tools.build.bundletool.model.ModuleEntry entry, @NotNull com.android.tools.build.bundletool.model.BundleModule bundleModule) Get the size of a specific entry within the AAB.static longgetZipEntrySize(@NotNull ZipFile bundleZipFile, @NotNull com.android.tools.build.bundletool.model.ZipPath zipPath) Get the size of a specific entry within the AAB.static byte[]readByte(@NotNull ZipFile bundleZipFile, @NotNull com.android.tools.build.bundletool.model.ModuleEntry entry, @NotNull com.android.tools.build.bundletool.model.BundleModule bundleModule) Read the content of a specific entry within the AAB as bytes.
-
构造器详细资料
-
AppBundleUtils
public AppBundleUtils()
-
-
方法详细资料
-
getZipEntrySize
public static long getZipEntrySize(@NotNull @NotNull ZipFile bundleZipFile, @NotNull @NotNull com.android.tools.build.bundletool.model.ModuleEntry entry, @NotNull @NotNull com.android.tools.build.bundletool.model.BundleModule bundleModule) Get the size of a specific entry within the AAB.- 参数:
bundleZipFile- The AAB as a ZipFile.entry- The ModuleEntry for the entry.bundleModule- The BundleModule containing the entry.- 返回:
- The size of the entry in bytes.
-
getZipEntrySize
public static long getZipEntrySize(@NotNull @NotNull ZipFile bundleZipFile, @NotNull @NotNull com.android.tools.build.bundletool.model.ZipPath zipPath) Get the size of a specific entry within the AAB.- 参数:
bundleZipFile- The AAB as a ZipFile.zipPath- The ZipPath of the entry.- 返回:
- The size of the entry in bytes.
-
getEntryMd5
@NotNull public static @NotNull String getEntryMd5(@NotNull @NotNull ZipFile bundleZipFile, @NotNull @NotNull com.android.tools.build.bundletool.model.ModuleEntry entry, @NotNull @NotNull com.android.tools.build.bundletool.model.BundleModule bundleModule) Get the MD5 hash of a specific entry within the AAB.- 参数:
bundleZipFile- The AAB as a ZipFile.entry- The ModuleEntry for the entry.bundleModule- The BundleModule containing the entry.- 返回:
- The MD5 hash as a hexadecimal string.
-
readByte
public static byte[] readByte(@NotNull @NotNull ZipFile bundleZipFile, @NotNull @NotNull com.android.tools.build.bundletool.model.ModuleEntry entry, @NotNull @NotNull com.android.tools.build.bundletool.model.BundleModule bundleModule) throws IOException Read the content of a specific entry within the AAB as bytes.- 参数:
bundleZipFile- The AAB as a ZipFile.entry- The ModuleEntry for the entry.bundleModule- The BundleModule containing the entry.- 返回:
- The content of the entry as bytes.
- 抛出:
IOException- If an I/O error occurs.
-
bytesToHexString
Convert a byte array to a hexadecimal string.- 参数:
src- The byte array to convert.- 返回:
- The hexadecimal string.
-
getEntryNameByResourceName
Get the entry name from a resource name in the format "package.type.entry".- 参数:
resourceName- The resource name.- 返回:
- The entry name.
-
getTypeNameByResourceName
Get the type name from a resource name in the format "package.type.entry".- 参数:
resourceName- The resource name.- 返回:
- The type name.
-
getResourceFullName
public static String getResourceFullName(@NotNull @NotNull com.android.tools.build.bundletool.model.ResourceTableEntry entry) Get the full resource name from a ResourceTableEntry.- 参数:
entry- The ResourceTableEntry.- 返回:
- The full resource name.
-
getResourceFullName
Get the full resource name from individual components.- 参数:
packageName- The package name.typeName- The type name.entryName- The entry name.- 返回:
- The full resource name.
-