public static String apiToMagic(int targetApiLevel) {
    String version;

    if (targetApiLevel >= API_CURRENT) {
      version = VERSION_CURRENT;
    } else if (targetApiLevel >= API_CONST_METHOD_HANDLE) {
      version = VERSION_FOR_API_28;
    } else if (targetApiLevel >= API_METHOD_HANDLES) {
      version = VERSION_FOR_API_26;
    } else if (targetApiLevel >= API_DEFINE_INTERFACE_METHODS) {
      version = VERSION_FOR_API_24;
    } else {
      version = VERSION_FOR_API_13;
    }

    return MAGIC_PREFIX + version + MAGIC_SUFFIX;
  }
Returns the magic number corresponding to the given target API level.

@param targetApiLevel level of API (minimum supported value 13).
@return Magic string corresponding to API level supplied.
android/android_framework/dex-maker/src/main/java/com/android/dex/DexFormat.java