java.lang.Object
java.lang.Enum<AppMain>
edu.jiangxin.apktoolbox.convert.protobuf.supervised.AppMain
All Implemented Interfaces:
Serializable, Comparable<AppMain>, Constable

public enum AppMain extends Enum<AppMain>
Desktop application offering the functionality of the ProtoToJson-API.

The user has the option to select a binary protobuf message which the application will then attempt to decode into readable JSON. The result will then be displayed in an advanced text editor window for further processing.

Message decoding requires protobuf descriptors that are put into the CACHE_DIRECTORY in advance by the user. Such descriptors can be obtained by applying a protoc command on the protobuf schema .proto, for example:


 protoc --descriptor_set_out foo.desc foo.proto
 
Author:
Daniel Tischner <zabuza.dev@gmail.com>
  • Field Details

    • CACHE_DIRECTORY

      public static final Path CACHE_DIRECTORY
      The directory to use for the descriptor cache.
  • Method Details

    • values

      public static AppMain[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static AppMain valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • main

      public static void main(String[] args)
      Starts the desktop application.

      Prior to using this, the user has to populate the CACHE_DIRECTORY with protobuf descriptor files. Such descriptors can be obtained by applying a protoc command on the protobuf schema .proto, for example:

      
       protoc --descriptor_set_out foo.desc foo.proto
       
      The user has the option to select a binary protobuf message which the application will then attempt to decode into readable JSON. The result will then be displayed in an advanced text editor window for further processing.
      Parameters:
      args - Null or empty if the user should be given the option to select a binary protobuf message. Otherwise one argument which is the path to the binary protobuf message to convert, the application will then directly proceed to decoding this message instead of asking the user for a message first.