Class ApkResHelper

java.lang.Object
com.pnfsoftware.jeb.core.units.code.android.ApkResHelper

public class ApkResHelper extends Object
Gather APK resources (strings and integers atm) to make them easily retrievable by client code, such as disassembly generators for IDexUnit. This helper walks through the processed Resources held by corresponding IXmlUnit. The path structure of the units matter.

Access to this object is thread-safe.

  • Constructor Details

    • ApkResHelper

      public ApkResHelper(IApkUnit apk, List<String> preferredLocales)
      Create an APK resource helper.
      Parameters:
      apk - mandatory unit
      preferredLocales - optional
    • ApkResHelper

      public ApkResHelper(IApkUnit apk)
      Create an APK resource helper.
      Parameters:
      apk - APK unit
  • Method Details

    • getString

      public String getString(int resId)
      Retrieve a string resource value.
      Parameters:
      resId - resource identifier
      Returns:
      the string value, or null
    • getInteger

      public Integer getInteger(int resId)
      Retrieve an integer resource value.
      Parameters:
      resId - resource identifier
      Returns:
      the integer value, or null
    • generateAutoCommentForPotentialResourceId

      public String generateAutoCommentForPotentialResourceId(int resId)
      Generate a comment for a potential resource identifier.
      Parameters:
      resId - resource identifier
      Returns:
      an auto-comment, or null