类 AppBundleUtils

java.lang.Object
io.github.amsonix.molt.internal.reschiper.bundle.AppBundleUtils

public class AppBundleUtils extends Object
Utility methods for working with Android App Bundles (AABs).
  • 构造器概要

    构造器
    构造器
    说明
     
  • 方法概要

    修饰符和类型
    方法
    说明
    static @NotNull String
    bytesToHexString(byte @NotNull [] src)
    Convert a byte array to a hexadecimal string.
    static @NotNull String
    getEntryMd5(@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 String
    getEntryNameByResourceName(@NotNull String resourceName)
    Get the entry name from a resource name in the format "package.type.entry".
    static String
    getResourceFullName(@NotNull com.android.tools.build.bundletool.model.ResourceTableEntry entry)
    Get the full resource name from a ResourceTableEntry.
    static String
    getResourceFullName(String packageName, String typeName, String entryName)
    Get the full resource name from individual components.
    static String
    getTypeNameByResourceName(@NotNull String resourceName)
    Get the type name from a resource name in the format "package.type.entry".
    static long
    getZipEntrySize(@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 long
    getZipEntrySize(@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.

    从类继承的方法 java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 构造器详细资料

    • 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

      @NotNull public static @NotNull String bytesToHexString(byte @NotNull [] src)
      Convert a byte array to a hexadecimal string.
      参数:
      src - The byte array to convert.
      返回:
      The hexadecimal string.
    • getEntryNameByResourceName

      public static String getEntryNameByResourceName(@NotNull @NotNull String resourceName)
      Get the entry name from a resource name in the format "package.type.entry".
      参数:
      resourceName - The resource name.
      返回:
      The entry name.
    • getTypeNameByResourceName

      public static String getTypeNameByResourceName(@NotNull @NotNull String resourceName)
      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

      public static String getResourceFullName(String packageName, String typeName, String entryName)
      Get the full resource name from individual components.
      参数:
      packageName - The package name.
      typeName - The type name.
      entryName - The entry name.
      返回:
      The full resource name.