dex-tools-0.0.9.15

16:35:22.119 INFO  jd.cli.Main - Decompiling dex-tools-0.0.9.15.jar
package com.googlecode.dex2jar.tools;

import java.lang.annotation.Annotation;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

@Retention(RetentionPolicy.RUNTIME)
@Target({java.lang.annotation.ElementType.TYPE})
public @interface BaseCmd$Syntax
{
  String cmd();
  
  String desc() default "";
  
  String onlineHelp() default "";
  
  String syntax() default "";
}

/* Location:
 * Qualified Name:     com.googlecode.dex2jar.tools.BaseCmd.Syntax
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package com.googlecode.dex2jar.tools;

import java.io.File;
import java.io.PrintStream;
import java.io.PrintWriter;
import java.lang.annotation.Annotation;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
import java.lang.reflect.Field;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
import java.util.TreeSet;

public abstract class BaseCmd
{
  private String cmdLineSyntax;
  private String cmdName;
  private String desc;
  private String onlineHelp;
  public BaseCmd() {}
  
  protected static class HelpException
    extends RuntimeException
  {}
  
  @Retention(RetentionPolicy.RUNTIME)
  @Target({java.lang.annotation.ElementType.FIELD})
  protected static @interface Opt
  {
    String argName() default "";
    
    String description();
    
    boolean hasArg() default true;
    
    String longOpt() default "";
    
    String opt();
    
    boolean required() default false;
  }
  
  protected static class Option
    implements Comparable<Option>
  {
    public String argName = "arg";
    public String description;
    public Field field;
    public boolean hasArg = true;
    public String longOpt;
    public String opt;
    public boolean required = false;
    
    public int compareTo(Option o)
    {
      return opt.compareTo(opt);
    }
    
    public String getOptAndLongOpt()
    {
      StringBuilder sb = new StringBuilder();
      sb.append("-").append(opt);
      if (longOpt != null) {
        sb.append(",--").append(longOpt);
      }
      return sb.toString();
    }
  }
  
  protected Map<String, Option> optMap = new HashMap();
  @Opt(opt="h", longOpt="help", hasArg=false, description="Print this help message")
  private boolean printHelp = false;
  protected String[] remainingArgs;
  
  public BaseCmd(String cmdLineSyntax, String header)
  {
    int i = cmdLineSyntax.indexOf(' ');
    if (i > 0)
    {
      cmdName = cmdLineSyntax.substring(0, i);
      this.cmdLineSyntax = cmdLineSyntax.substring(i + 1);
    }
    desc = header;
  }
  
  public BaseCmd(String cmdName, String cmdSyntax, String header)
  {
    this.cmdName = cmdName;
    cmdLineSyntax = cmdSyntax;
    desc = header;
  }
  
  private Set<Option> collectRequriedOptions(Map<String, Option> optMap)
  {
    Set<Option> options = new HashSet();
    for (Map.Entry<String, Option> e : optMap.entrySet())
    {
      Option option = (Option)e.getValue();
      if (required) {
        options.add(option);
      }
    }
    return options;
  }
  
  protected Object convert(String value, Class type)
  {
    if (type.equals(String.class)) {
      return value;
    }
    if ((type.equals(Integer.TYPE)) || (type.equals(Integer.class))) {
      return Integer.valueOf(Integer.parseInt(value));
    }
    if ((type.equals(Long.TYPE)) || (type.equals(Long.class))) {
      return Long.valueOf(Long.parseLong(value));
    }
    if ((type.equals(Float.TYPE)) || (type.equals(Float.class))) {
      return Float.valueOf(Float.parseFloat(value));
    }
    if ((type.equals(Double.TYPE)) || (type.equals(Double.class))) {
      return Double.valueOf(Double.parseDouble(value));
    }
    if ((type.equals(Boolean.TYPE)) || (type.equals(Boolean.class))) {
      return Boolean.valueOf(Boolean.parseBoolean(value));
    }
    if (type.equals(File.class)) {
      return new File(value);
    }
    try
    {
      type.asSubclass(Enum.class);
      return Enum.valueOf(type, value);
    }
    catch (Exception localException)
    {
      throw new RuntimeException("can't convert [" + value + "] to type " + type);
    }
  }
  
  protected abstract void doCommandLine()
    throws Exception;
  
  public void doMain(String... args)
  {
    try
    {
      initOptions();
      parseSetArgs(args);
      doCommandLine();
    }
    catch (HelpException localHelpException)
    {
      usage();
    }
    catch (Exception e)
    {
      e.printStackTrace(System.err);
    }
  }
  
  protected String getVersionString()
  {
    return getClass().getPackage().getImplementationVersion();
  }
  
  protected void initOptionFromClass(Class<?> clz)
  {
    if (clz == null) {
      return;
    }
    initOptionFromClass(clz.getSuperclass());
    
    Syntax syntax = (Syntax)clz.getAnnotation(Syntax.class);
    if (syntax != null)
    {
      cmdLineSyntax = syntax.syntax();
      cmdName = syntax.cmd();
      desc = syntax.desc();
      onlineHelp = syntax.onlineHelp();
    }
    Field[] fs = clz.getDeclaredFields();
    Field[] arrayOfField1;
    int j = (arrayOfField1 = fs).length;
    for (int i = 0; i < j; i++)
    {
      Field f = arrayOfField1[i];
      Opt opt = (Opt)f.getAnnotation(Opt.class);
      if (opt != null)
      {
        f.setAccessible(true);
        if (!opt.hasArg())
        {
          Class<?> type = f.getType();
          if (!type.equals(Boolean.TYPE)) {
            throw new RuntimeException("the type of " + f + 
              " must be boolean, as it is declared as no args");
          }
          try
          {
            b = ((Boolean)f.get(this)).booleanValue();
          }
          catch (Exception e)
          {
            boolean b;
            throw new RuntimeException(e);
          }
          boolean b;
          if (b) {
            throw new RuntimeException("the value of " + f + " must be false, as it is declared as no args");
          }
        }
        Option option = new Option();
        field = f;
        opt = opt.opt();
        description = opt.description();
        hasArg = opt.hasArg();
        required = opt.required();
        if (!"".equals(opt.longOpt()))
        {
          longOpt = opt.longOpt();
          optMap.put("--" + longOpt, option);
        }
        if (!"".equals(opt.argName())) {
          argName = opt.argName();
        }
        optMap.put("-" + opt, option);
      }
    }
  }
  
  protected void initOptions()
  {
    initOptionFromClass(getClass());
  }
  
  protected void parseSetArgs(String... args)
    throws IllegalArgumentException, IllegalAccessException
  {
    List<String> remainsOptions = new ArrayList();
    Set<Option> requiredOpts = collectRequriedOptions(optMap);
    Option needArgOpt = null;
    Object localObject;
    int j = (localObject = args).length;
    for (int i = 0; i < j; i++)
    {
      String s = localObject[i];
      if (needArgOpt != null)
      {
        field.set(this, convert(s, field.getType()));
        needArgOpt = null;
      }
      else if (s.startsWith("-"))
      {
        Option opt = (Option)optMap.get(s);
        requiredOpts.remove(opt);
        if (opt == null)
        {
          System.err.println("ERROR: Unrecognized option: " + s);
          throw new HelpException();
        }
        if (hasArg) {
          needArgOpt = opt;
        } else {
          field.set(this, Boolean.valueOf(true));
        }
      }
      else
      {
        remainsOptions.add(s);
      }
    }
    if (needArgOpt != null)
    {
      System.err.println("ERROR: Option " + needArgOpt.getOptAndLongOpt() + " need an argument value");
      throw new HelpException();
    }
    remainingArgs = ((String[])remainsOptions.toArray(new String[0]));
    if (printHelp) {
      throw new HelpException();
    }
    if (!requiredOpts.isEmpty())
    {
      StringBuilder sb = new StringBuilder();
      sb.append("ERROR: Options: ");
      boolean first = true;
      for (localObject = requiredOpts.iterator(); ((Iterator)localObject).hasNext();)
      {
        Option option = (Option)((Iterator)localObject).next();
        if (first) {
          first = false;
        } else {
          sb.append(" and ");
        }
        sb.append(option.getOptAndLongOpt());
      }
      sb.append(" is required");
      System.err.println(sb.toString());
      throw new HelpException();
    }
  }
  
  protected void usage()
  {
    PrintWriter out = new PrintWriter(System.err, true);
    
    out.println(cmdName + " -- " + this.desc);
    out.println("usage: " + cmdName + " " + cmdLineSyntax);
    if (optMap.size() > 0) {
      out.println("options:");
    }
    TreeSet<Option> options = new TreeSet(optMap.values());
    int palength = -1;
    for (Option option : options)
    {
      int pa = 5 + opt.length();
      if (longOpt != null) {
        pa += 3 + longOpt.length();
      }
      if (hasArg) {
        pa += 3 + argName.length();
      }
      if ((pa < 40) && 
        (pa > palength)) {
        palength = pa;
      }
    }
    int pblength = 80 - palength;
    
    StringBuilder sb = new StringBuilder();
    for (Option option : options)
    {
      sb.setLength(0);
      sb.append(" -").append(opt);
      if (longOpt != null) {
        sb.append(",--").append(longOpt);
      }
      if (hasArg) {
        sb.append(" <").append(argName).append(">");
      }
      String desc = description;
      if ((desc == null) || (desc.length() == 0))
      {
        out.println(sb);
      }
      else
      {
        for (int i = palength - sb.length(); i > 0; i--) {
          sb.append(' ');
        }
        if (sb.length() > 40)
        {
          out.println(sb);
          sb.setLength(0);
          for (int i = 0; i < palength; i++) {
            sb.append(' ');
          }
        }
        int nextStart = 0;
        while (nextStart < desc.length()) {
          if (desc.length() - nextStart < pblength)
          {
            sb.append(desc.substring(nextStart));
            out.println(sb);
            nextStart = desc.length();
            sb.setLength(0);
          }
          else
          {
            sb.append(desc.substring(nextStart, pblength));
            out.println(sb);
            nextStart += pblength;
            sb.setLength(0);
            for (int i = 0; i < palength; i++) {
              sb.append(' ');
            }
          }
        }
        if (sb.length() > 0)
        {
          out.println(sb);
          sb.setLength(0);
        }
      }
    }
    String ver = getVersionString();
    if ((ver != null) && (!"".equals(ver))) {
      out.println("version: " + ver);
    }
    if ((onlineHelp != null) && (!"".equals(onlineHelp))) {
      if (onlineHelp.length() + "online help: ".length() > 80)
      {
        out.println("online help: ");
        out.println(onlineHelp);
      }
      else
      {
        out.println("online help: " + onlineHelp);
      }
    }
    out.flush();
  }
  
  @Retention(RetentionPolicy.RUNTIME)
  @Target({java.lang.annotation.ElementType.TYPE})
  protected static @interface Syntax
  {
    String cmd();
    
    String desc() default "";
    
    String onlineHelp() default "";
    
    String syntax() default "";
  }
}

/* Location:
 * Qualified Name:     com.googlecode.dex2jar.tools.BaseCmd
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package com.googlecode.dex2jar.tools;

import org.objectweb.asm.ClassVisitor;
import org.objectweb.asm.tree.ClassNode;

class JasminifierClassAdapter$1
  extends ClassNode
{
  JasminifierClassAdapter$1(ClassVisitor paramClassVisitor) {}
  
  public void visitEnd()
  {
    if (val$cv != null) {
      accept(val$cv);
    }
  }
}

/* Location:
 * Qualified Name:     com.googlecode.dex2jar.tools.JasminifierClassAdapter.1
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package com.googlecode.dex2jar.tools;

import java.io.PrintStream;
import org.objectweb.asm.ClassAdapter;
import org.objectweb.asm.ClassReader;
import org.objectweb.asm.ClassVisitor;
import org.objectweb.asm.FieldVisitor;
import org.objectweb.asm.MethodVisitor;

class JarAccessCmd$1$1
  extends ClassAdapter
{
  JarAccessCmd$1$1(JarAccessCmd.1 param1, ClassVisitor $anonymous0, int paramInt1, int paramInt2, int paramInt3, int paramInt4, ClassReader paramClassReader, int paramInt5, int paramInt6)
  {
    super($anonymous0);
  }
  
  public void visit(int version, int access, String name, String signature, String superName, String[] interfaces)
  {
    int na = access & val$rc | val$ac;
    if (access != na) {
      System.out.println("c " + name);
    }
    super.visit(version, na, name, signature, superName, interfaces);
  }
  
  public FieldVisitor visitField(int access, String name, String desc, String signature, Object value)
  {
    int na = access & val$rf | val$af;
    if (na != access) {
      System.out.println("f " + val$r.getClassName() + "." + name);
    }
    return super.visitField(na, name, desc, signature, value);
  }
  
  public MethodVisitor visitMethod(int access, String name, String desc, String signature, String[] exceptions)
  {
    int na = access & val$rm | val$am;
    if (na != access) {
      System.out.println("m " + val$r.getClassName() + "." + name + desc);
    }
    return super.visitMethod(na, name, desc, signature, exceptions);
  }
}

/* Location:
 * Qualified Name:     com.googlecode.dex2jar.tools.JarAccessCmd.1.1
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package com.googlecode.dex2jar.tools;

import java.io.File;
import java.io.PrintStream;
import org.objectweb.asm.ClassAdapter;
import org.objectweb.asm.ClassReader;
import org.objectweb.asm.ClassVisitor;
import org.objectweb.asm.FieldVisitor;
import org.objectweb.asm.MethodVisitor;
import p.rn.util.FileOut.OutHandler;
import p.rn.util.FileWalker.StreamHandler;

public class JarAccessCmd
  extends BaseCmd
{
  public static void main(String[] args)
  {
    new JarAccessCmd().doMain(args);
  }
  
  public JarAccessCmd()
  {
    super("d2j-jar-access [options] <jar>", "add or remove class/method/field access in jar file");
  }
  
  @BaseCmd.Opt(opt="f", longOpt="force", hasArg=false, description="force overwrite")
  private boolean forceOverwrite = false;
  @BaseCmd.Opt(opt="o", longOpt="output", description="output dir of .j files, default is $current_dir/[jar-name]-access.jar", argName="out-dir")
  private File output;
  @BaseCmd.Opt(opt="rd", longOpt="remove-debug", hasArg=false, description="remove debug info")
  private boolean removeDebug = false;
  @BaseCmd.Opt(opt="rf", longOpt="remove-field-access", description="remove access from field", argName="ACC")
  private String removeFieldAccess;
  @BaseCmd.Opt(opt="rm", longOpt="remove-method-access", description="remove access from method", argName="ACC")
  private String removeMethodAccess;
  @BaseCmd.Opt(opt="rc", longOpt="remove-class-access", description="remove access from class", argName="ACC")
  private String removeClassAccess;
  @BaseCmd.Opt(opt="af", longOpt="add-field-access", description="add access from field", argName="ACC")
  private String addFieldAccess;
  @BaseCmd.Opt(opt="am", longOpt="add-method-access", description="add access from method", argName="ACC")
  private String addMethodAccess;
  @BaseCmd.Opt(opt="ac", longOpt="add-class-access", description="add access from class", argName="ACC")
  private String addClassAccess;
  
  static int str2acc(String s)
  {
    if (s == null) {
      return 0;
    }
    int result = 0;
    s = s.toLowerCase();
    if (s.contains("public")) {
      result |= 0x1;
    }
    if (s.contains("private")) {
      result |= 0x2;
    }
    if (s.contains("protected")) {
      result |= 0x4;
    }
    if (s.contains("final")) {
      result |= 0x10;
    }
    if (s.contains("static")) {
      result |= 0x8;
    }
    if (s.contains("super")) {
      result |= 0x20;
    }
    if (s.contains("synchronized")) {
      result |= 0x20;
    }
    if (s.contains("volatile")) {
      result |= 0x40;
    }
    if (s.contains("bridge")) {
      result |= 0x40;
    }
    if (s.contains("transient")) {
      result |= 0x80;
    }
    if (s.contains("varargs")) {
      result |= 0x80;
    }
    if (s.contains("native")) {
      result |= 0x100;
    }
    if (s.contains("strict")) {
      result |= 0x800;
    }
    if (s.contains("interface")) {
      result |= 0x200;
    }
    if (s.contains("abstract")) {
      result |= 0x400;
    }
    if (s.contains("synthetic")) {
      result |= 0x1000;
    }
    if (s.contains("annotation")) {
      result |= 0x2000;
    }
    if (s.contains("enum")) {
      result |= 0x4000;
    }
    if (s.contains("deprecated")) {
      result |= 0x20000;
    }
    return result;
  }
  
  /* Error */
  protected void doCommandLine()
    throws java.lang.Exception
  {
    // Byte code:
    //   0: aload_0
    //   1: getfield 139	com/googlecode/dex2jar/tools/JarAccessCmd:remainingArgs	[Ljava/lang/String;
    //   4: arraylength
    //   5: iconst_1
    //   6: if_icmpeq +8 -> 14
    //   9: aload_0
    //   10: invokevirtual 142	com/googlecode/dex2jar/tools/JarAccessCmd:usage	()V
    //   13: return
    //   14: new 145	java/io/File
    //   17: dup
    //   18: aload_0
    //   19: getfield 139	com/googlecode/dex2jar/tools/JarAccessCmd:remainingArgs	[Ljava/lang/String;
    //   22: iconst_0
    //   23: aaload
    //   24: invokespecial 147	java/io/File:<init>	(Ljava/lang/String;)V
    //   27: astore_1
    //   28: aload_1
    //   29: invokevirtual 150	java/io/File:exists	()Z
    //   32: ifne +33 -> 65
    //   35: getstatic 154	java/lang/System:err	Ljava/io/PrintStream;
    //   38: new 160	java/lang/StringBuilder
    //   41: dup
    //   42: invokespecial 162	java/lang/StringBuilder:<init>	()V
    //   45: aload_1
    //   46: invokevirtual 163	java/lang/StringBuilder:append	(Ljava/lang/Object;)Ljava/lang/StringBuilder;
    //   49: ldc -89
    //   51: invokevirtual 169	java/lang/StringBuilder:append	(Ljava/lang/String;)Ljava/lang/StringBuilder;
    //   54: invokevirtual 172	java/lang/StringBuilder:toString	()Ljava/lang/String;
    //   57: invokevirtual 175	java/io/PrintStream:println	(Ljava/lang/String;)V
    //   60: aload_0
    //   61: invokevirtual 142	com/googlecode/dex2jar/tools/JarAccessCmd:usage	()V
    //   64: return
    //   65: aload_0
    //   66: getfield 180	com/googlecode/dex2jar/tools/JarAccessCmd:output	Ljava/io/File;
    //   69: ifnonnull +82 -> 151
    //   72: aload_1
    //   73: invokevirtual 182	java/io/File:isDirectory	()Z
    //   76: ifeq +39 -> 115
    //   79: aload_0
    //   80: new 145	java/io/File
    //   83: dup
    //   84: new 160	java/lang/StringBuilder
    //   87: dup
    //   88: aload_1
    //   89: invokevirtual 185	java/io/File:getName	()Ljava/lang/String;
    //   92: invokestatic 188	java/lang/String:valueOf	(Ljava/lang/Object;)Ljava/lang/String;
    //   95: invokespecial 192	java/lang/StringBuilder:<init>	(Ljava/lang/String;)V
    //   98: ldc -63
    //   100: invokevirtual 169	java/lang/StringBuilder:append	(Ljava/lang/String;)Ljava/lang/StringBuilder;
    //   103: invokevirtual 172	java/lang/StringBuilder:toString	()Ljava/lang/String;
    //   106: invokespecial 147	java/io/File:<init>	(Ljava/lang/String;)V
    //   109: putfield 180	com/googlecode/dex2jar/tools/JarAccessCmd:output	Ljava/io/File;
    //   112: goto +39 -> 151
    //   115: aload_0
    //   116: new 145	java/io/File
    //   119: dup
    //   120: new 160	java/lang/StringBuilder
    //   123: dup
    //   124: aload_1
    //   125: invokevirtual 185	java/io/File:getName	()Ljava/lang/String;
    //   128: invokestatic 195	org/apache/commons/io/FilenameUtils:getBaseName	(Ljava/lang/String;)Ljava/lang/String;
    //   131: invokestatic 188	java/lang/String:valueOf	(Ljava/lang/Object;)Ljava/lang/String;
    //   134: invokespecial 192	java/lang/StringBuilder:<init>	(Ljava/lang/String;)V
    //   137: ldc -63
    //   139: invokevirtual 169	java/lang/StringBuilder:append	(Ljava/lang/String;)Ljava/lang/StringBuilder;
    //   142: invokevirtual 172	java/lang/StringBuilder:toString	()Ljava/lang/String;
    //   145: invokespecial 147	java/io/File:<init>	(Ljava/lang/String;)V
    //   148: putfield 180	com/googlecode/dex2jar/tools/JarAccessCmd:output	Ljava/io/File;
    //   151: aload_0
    //   152: getfield 180	com/googlecode/dex2jar/tools/JarAccessCmd:output	Ljava/io/File;
    //   155: invokevirtual 150	java/io/File:exists	()Z
    //   158: ifeq +43 -> 201
    //   161: aload_0
    //   162: getfield 74	com/googlecode/dex2jar/tools/JarAccessCmd:forceOverwrite	Z
    //   165: ifne +36 -> 201
    //   168: getstatic 154	java/lang/System:err	Ljava/io/PrintStream;
    //   171: new 160	java/lang/StringBuilder
    //   174: dup
    //   175: invokespecial 162	java/lang/StringBuilder:<init>	()V
    //   178: aload_0
    //   179: getfield 180	com/googlecode/dex2jar/tools/JarAccessCmd:output	Ljava/io/File;
    //   182: invokevirtual 163	java/lang/StringBuilder:append	(Ljava/lang/Object;)Ljava/lang/StringBuilder;
    //   185: ldc -55
    //   187: invokevirtual 169	java/lang/StringBuilder:append	(Ljava/lang/String;)Ljava/lang/StringBuilder;
    //   190: invokevirtual 172	java/lang/StringBuilder:toString	()Ljava/lang/String;
    //   193: invokevirtual 175	java/io/PrintStream:println	(Ljava/lang/String;)V
    //   196: aload_0
    //   197: invokevirtual 142	com/googlecode/dex2jar/tools/JarAccessCmd:usage	()V
    //   200: return
    //   201: aload_0
    //   202: getfield 203	com/googlecode/dex2jar/tools/JarAccessCmd:removeFieldAccess	Ljava/lang/String;
    //   205: invokestatic 205	com/googlecode/dex2jar/tools/JarAccessCmd:str2acc	(Ljava/lang/String;)I
    //   208: iconst_m1
    //   209: ixor
    //   210: istore_2
    //   211: aload_0
    //   212: getfield 207	com/googlecode/dex2jar/tools/JarAccessCmd:removeMethodAccess	Ljava/lang/String;
    //   215: invokestatic 205	com/googlecode/dex2jar/tools/JarAccessCmd:str2acc	(Ljava/lang/String;)I
    //   218: iconst_m1
    //   219: ixor
    //   220: istore_3
    //   221: aload_0
    //   222: getfield 209	com/googlecode/dex2jar/tools/JarAccessCmd:removeClassAccess	Ljava/lang/String;
    //   225: invokestatic 205	com/googlecode/dex2jar/tools/JarAccessCmd:str2acc	(Ljava/lang/String;)I
    //   228: iconst_m1
    //   229: ixor
    //   230: istore 4
    //   232: aload_0
    //   233: getfield 211	com/googlecode/dex2jar/tools/JarAccessCmd:addFieldAccess	Ljava/lang/String;
    //   236: invokestatic 205	com/googlecode/dex2jar/tools/JarAccessCmd:str2acc	(Ljava/lang/String;)I
    //   239: istore 5
    //   241: aload_0
    //   242: getfield 213	com/googlecode/dex2jar/tools/JarAccessCmd:addMethodAccess	Ljava/lang/String;
    //   245: invokestatic 205	com/googlecode/dex2jar/tools/JarAccessCmd:str2acc	(Ljava/lang/String;)I
    //   248: istore 6
    //   250: aload_0
    //   251: getfield 215	com/googlecode/dex2jar/tools/JarAccessCmd:addClassAccess	Ljava/lang/String;
    //   254: invokestatic 205	com/googlecode/dex2jar/tools/JarAccessCmd:str2acc	(Ljava/lang/String;)I
    //   257: istore 7
    //   259: aload_0
    //   260: getfield 76	com/googlecode/dex2jar/tools/JarAccessCmd:removeDebug	Z
    //   263: ifeq +7 -> 270
    //   266: iconst_2
    //   267: goto +4 -> 271
    //   270: iconst_0
    //   271: istore 8
    //   273: aload_0
    //   274: getfield 180	com/googlecode/dex2jar/tools/JarAccessCmd:output	Ljava/io/File;
    //   277: iconst_1
    //   278: invokestatic 217	p/rn/util/FileOut:create	(Ljava/io/File;Z)Lp/rn/util/FileOut$OutHandler;
    //   281: astore 9
    //   283: new 223	p/rn/util/FileWalker
    //   286: dup
    //   287: invokespecial 225	p/rn/util/FileWalker:<init>	()V
    //   290: new 226	com/googlecode/dex2jar/tools/JarAccessCmd$1
    //   293: dup
    //   294: aload_0
    //   295: aload 9
    //   297: iload 8
    //   299: iload 4
    //   301: iload 7
    //   303: iload_2
    //   304: iload 5
    //   306: iload_3
    //   307: iload 6
    //   309: invokespecial 228	com/googlecode/dex2jar/tools/JarAccessCmd$1:<init>	(Lcom/googlecode/dex2jar/tools/JarAccessCmd;Lp/rn/util/FileOut$OutHandler;IIIIIII)V
    //   312: invokevirtual 231	p/rn/util/FileWalker:withStreamHandler	(Lp/rn/util/FileWalker$StreamHandler;)Lp/rn/util/FileWalker;
    //   315: aload_1
    //   316: invokevirtual 235	p/rn/util/FileWalker:walk	(Ljava/io/File;)V
    //   319: goto +13 -> 332
    //   322: astore 10
    //   324: aload 9
    //   326: invokestatic 239	org/apache/commons/io/IOUtils:closeQuietly	(Ljava/io/Closeable;)V
    //   329: aload 10
    //   331: athrow
    //   332: aload 9
    //   334: invokestatic 239	org/apache/commons/io/IOUtils:closeQuietly	(Ljava/io/Closeable;)V
    //   337: return
    // Line number table:
    //   Java source line #137	-> byte code offset #0
    //   Java source line #138	-> byte code offset #9
    //   Java source line #139	-> byte code offset #13
    //   Java source line #142	-> byte code offset #14
    //   Java source line #143	-> byte code offset #28
    //   Java source line #144	-> byte code offset #35
    //   Java source line #145	-> byte code offset #60
    //   Java source line #146	-> byte code offset #64
    //   Java source line #149	-> byte code offset #65
    //   Java source line #150	-> byte code offset #72
    //   Java source line #151	-> byte code offset #79
    //   Java source line #153	-> byte code offset #115
    //   Java source line #157	-> byte code offset #151
    //   Java source line #158	-> byte code offset #168
    //   Java source line #159	-> byte code offset #196
    //   Java source line #160	-> byte code offset #200
    //   Java source line #163	-> byte code offset #201
    //   Java source line #164	-> byte code offset #211
    //   Java source line #165	-> byte code offset #221
    //   Java source line #167	-> byte code offset #232
    //   Java source line #168	-> byte code offset #241
    //   Java source line #169	-> byte code offset #250
    //   Java source line #171	-> byte code offset #259
    //   Java source line #172	-> byte code offset #273
    //   Java source line #174	-> byte code offset #283
    //   Java source line #230	-> byte code offset #315
    //   Java source line #231	-> byte code offset #322
    //   Java source line #232	-> byte code offset #324
    //   Java source line #233	-> byte code offset #329
    //   Java source line #232	-> byte code offset #332
    //   Java source line #234	-> byte code offset #337
    // Local variable table:
    //   start	length	slot	name	signature
    //   0	338	0	this	JarAccessCmd
    //   27	289	1	jar	File
    //   210	94	2	rf	int
    //   220	87	3	rm	int
    //   230	70	4	rc	int
    //   239	66	5	af	int
    //   248	60	6	am	int
    //   257	45	7	ac	int
    //   271	27	8	flags	int
    //   281	52	9	fo	FileOut.OutHandler
    //   322	8	10	localObject	Object
    // Exception table:
    //   from	to	target	type
    //   283	322	322	finally
  }
}

/* Location:
 * Qualified Name:     com.googlecode.dex2jar.tools.JarAccessCmd
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package com.googlecode.dex2jar.tools;

import java.io.File;
import java.io.IOException;
import java.lang.reflect.Method;
import org.objectweb.asm.ClassReader;
import org.objectweb.asm.ClassWriter;
import org.objectweb.asm.tree.AbstractInsnNode;
import org.objectweb.asm.tree.ClassNode;
import org.objectweb.asm.tree.InsnList;
import org.objectweb.asm.tree.InsnNode;
import org.objectweb.asm.tree.IntInsnNode;
import org.objectweb.asm.tree.LdcInsnNode;
import org.objectweb.asm.tree.MethodInsnNode;
import org.objectweb.asm.tree.MethodNode;
import p.rn.util.FileOut.OutHandler;
import p.rn.util.FileWalker.StreamHandler;
import p.rn.util.FileWalker.StreamOpener;

@BaseCmd.Syntax(cmd="d2j-decrpyt-string", syntax="[options] <jar>", desc="Decrypt in class file", onlineHelp="https://code.google.com/p/dex2jar/wiki/DecryptStrings")
public class DecryptStringCmd
  extends BaseCmd
{
  public static void main(String[] args)
  {
    new DecryptStringCmd().doMain(args);
  }
  
  @BaseCmd.Opt(opt="f", longOpt="force", hasArg=false, description="force overwrite")
  private boolean forceOverwrite = false;
  @BaseCmd.Opt(opt="o", longOpt="output", description="output of .jar files, default is $current_dir/[jar-name]-decrypted.jar", argName="out")
  private File output;
  @BaseCmd.Opt(opt="mo", longOpt="decrypt-method-owner", description="the owner of the mothed which can decrypt the stings, example: java.lang.String", argName="owner")
  private String methodOwner;
  @BaseCmd.Opt(opt="mn", longOpt="decrypt-method-name", description="the owner of the mothed which can decrypt the stings, the method's signature must be static (type)Ljava/lang/String;", argName="name")
  private String methodName;
  @BaseCmd.Opt(opt="cp", longOpt="classpath", description="add extra lib to classpath", argName="cp")
  private String classpath;
  @BaseCmd.Opt(opt="t", longOpt="arg-type", description="the type of the method's argument, int,string. default is string", argName="type")
  private String type = "string";
  
  /* Error */
  protected void doCommandLine()
    throws Exception
  {
    // Byte code:
    //   0: aload_0
    //   1: getfield 68	com/googlecode/dex2jar/tools/DecryptStringCmd:remainingArgs	[Ljava/lang/String;
    //   4: arraylength
    //   5: iconst_1
    //   6: if_icmpeq +8 -> 14
    //   9: aload_0
    //   10: invokevirtual 71	com/googlecode/dex2jar/tools/DecryptStringCmd:usage	()V
    //   13: return
    //   14: new 74	java/io/File
    //   17: dup
    //   18: aload_0
    //   19: getfield 68	com/googlecode/dex2jar/tools/DecryptStringCmd:remainingArgs	[Ljava/lang/String;
    //   22: iconst_0
    //   23: aaload
    //   24: invokespecial 76	java/io/File:<init>	(Ljava/lang/String;)V
    //   27: astore_1
    //   28: aload_1
    //   29: invokevirtual 79	java/io/File:exists	()Z
    //   32: ifne +29 -> 61
    //   35: getstatic 83	java/lang/System:err	Ljava/io/PrintStream;
    //   38: new 89	java/lang/StringBuilder
    //   41: dup
    //   42: invokespecial 91	java/lang/StringBuilder:<init>	()V
    //   45: aload_1
    //   46: invokevirtual 92	java/lang/StringBuilder:append	(Ljava/lang/Object;)Ljava/lang/StringBuilder;
    //   49: ldc 96
    //   51: invokevirtual 98	java/lang/StringBuilder:append	(Ljava/lang/String;)Ljava/lang/StringBuilder;
    //   54: invokevirtual 101	java/lang/StringBuilder:toString	()Ljava/lang/String;
    //   57: invokevirtual 105	java/io/PrintStream:println	(Ljava/lang/String;)V
    //   60: return
    //   61: aload_0
    //   62: getfield 110	com/googlecode/dex2jar/tools/DecryptStringCmd:methodName	Ljava/lang/String;
    //   65: ifnull +10 -> 75
    //   68: aload_0
    //   69: getfield 112	com/googlecode/dex2jar/tools/DecryptStringCmd:methodOwner	Ljava/lang/String;
    //   72: ifnonnull +12 -> 84
    //   75: getstatic 83	java/lang/System:err	Ljava/io/PrintStream;
    //   78: ldc 114
    //   80: invokevirtual 105	java/io/PrintStream:println	(Ljava/lang/String;)V
    //   83: return
    //   84: aload_0
    //   85: getfield 116	com/googlecode/dex2jar/tools/DecryptStringCmd:output	Ljava/io/File;
    //   88: ifnonnull +82 -> 170
    //   91: aload_1
    //   92: invokevirtual 118	java/io/File:isDirectory	()Z
    //   95: ifeq +39 -> 134
    //   98: aload_0
    //   99: new 74	java/io/File
    //   102: dup
    //   103: new 89	java/lang/StringBuilder
    //   106: dup
    //   107: aload_1
    //   108: invokevirtual 121	java/io/File:getName	()Ljava/lang/String;
    //   111: invokestatic 124	java/lang/String:valueOf	(Ljava/lang/Object;)Ljava/lang/String;
    //   114: invokespecial 130	java/lang/StringBuilder:<init>	(Ljava/lang/String;)V
    //   117: ldc -125
    //   119: invokevirtual 98	java/lang/StringBuilder:append	(Ljava/lang/String;)Ljava/lang/StringBuilder;
    //   122: invokevirtual 101	java/lang/StringBuilder:toString	()Ljava/lang/String;
    //   125: invokespecial 76	java/io/File:<init>	(Ljava/lang/String;)V
    //   128: putfield 116	com/googlecode/dex2jar/tools/DecryptStringCmd:output	Ljava/io/File;
    //   131: goto +39 -> 170
    //   134: aload_0
    //   135: new 74	java/io/File
    //   138: dup
    //   139: new 89	java/lang/StringBuilder
    //   142: dup
    //   143: aload_1
    //   144: invokevirtual 121	java/io/File:getName	()Ljava/lang/String;
    //   147: invokestatic 133	org/apache/commons/io/FilenameUtils:getBaseName	(Ljava/lang/String;)Ljava/lang/String;
    //   150: invokestatic 124	java/lang/String:valueOf	(Ljava/lang/Object;)Ljava/lang/String;
    //   153: invokespecial 130	java/lang/StringBuilder:<init>	(Ljava/lang/String;)V
    //   156: ldc -125
    //   158: invokevirtual 98	java/lang/StringBuilder:append	(Ljava/lang/String;)Ljava/lang/StringBuilder;
    //   161: invokevirtual 101	java/lang/StringBuilder:toString	()Ljava/lang/String;
    //   164: invokespecial 76	java/io/File:<init>	(Ljava/lang/String;)V
    //   167: putfield 116	com/googlecode/dex2jar/tools/DecryptStringCmd:output	Ljava/io/File;
    //   170: aload_0
    //   171: getfield 116	com/googlecode/dex2jar/tools/DecryptStringCmd:output	Ljava/io/File;
    //   174: invokevirtual 79	java/io/File:exists	()Z
    //   177: ifeq +39 -> 216
    //   180: aload_0
    //   181: getfield 46	com/googlecode/dex2jar/tools/DecryptStringCmd:forceOverwrite	Z
    //   184: ifne +32 -> 216
    //   187: getstatic 83	java/lang/System:err	Ljava/io/PrintStream;
    //   190: new 89	java/lang/StringBuilder
    //   193: dup
    //   194: invokespecial 91	java/lang/StringBuilder:<init>	()V
    //   197: aload_0
    //   198: getfield 116	com/googlecode/dex2jar/tools/DecryptStringCmd:output	Ljava/io/File;
    //   201: invokevirtual 92	java/lang/StringBuilder:append	(Ljava/lang/Object;)Ljava/lang/StringBuilder;
    //   204: ldc -117
    //   206: invokevirtual 98	java/lang/StringBuilder:append	(Ljava/lang/String;)Ljava/lang/StringBuilder;
    //   209: invokevirtual 101	java/lang/StringBuilder:toString	()Ljava/lang/String;
    //   212: invokevirtual 105	java/io/PrintStream:println	(Ljava/lang/String;)V
    //   215: return
    //   216: getstatic 83	java/lang/System:err	Ljava/io/PrintStream;
    //   219: new 89	java/lang/StringBuilder
    //   222: dup
    //   223: invokespecial 91	java/lang/StringBuilder:<init>	()V
    //   226: aload_1
    //   227: invokevirtual 92	java/lang/StringBuilder:append	(Ljava/lang/Object;)Ljava/lang/StringBuilder;
    //   230: ldc -115
    //   232: invokevirtual 98	java/lang/StringBuilder:append	(Ljava/lang/String;)Ljava/lang/StringBuilder;
    //   235: aload_0
    //   236: getfield 116	com/googlecode/dex2jar/tools/DecryptStringCmd:output	Ljava/io/File;
    //   239: invokevirtual 92	java/lang/StringBuilder:append	(Ljava/lang/Object;)Ljava/lang/StringBuilder;
    //   242: invokevirtual 101	java/lang/StringBuilder:toString	()Ljava/lang/String;
    //   245: invokevirtual 105	java/io/PrintStream:println	(Ljava/lang/String;)V
    //   248: new 143	java/util/ArrayList
    //   251: dup
    //   252: invokespecial 145	java/util/ArrayList:<init>	()V
    //   255: astore_2
    //   256: aload_0
    //   257: getfield 146	com/googlecode/dex2jar/tools/DecryptStringCmd:classpath	Ljava/lang/String;
    //   260: ifnull +22 -> 282
    //   263: aload_2
    //   264: aload_0
    //   265: getfield 146	com/googlecode/dex2jar/tools/DecryptStringCmd:classpath	Ljava/lang/String;
    //   268: ldc -108
    //   270: invokevirtual 150	java/lang/String:split	(Ljava/lang/String;)[Ljava/lang/String;
    //   273: invokestatic 154	java/util/Arrays:asList	([Ljava/lang/Object;)Ljava/util/List;
    //   276: invokeinterface 160 2 0
    //   281: pop
    //   282: aload_2
    //   283: aload_1
    //   284: invokevirtual 166	java/io/File:getAbsolutePath	()Ljava/lang/String;
    //   287: invokeinterface 169 2 0
    //   292: pop
    //   293: aload_2
    //   294: invokeinterface 173 1 0
    //   299: anewarray 177	java/net/URL
    //   302: astore_3
    //   303: iconst_0
    //   304: istore 4
    //   306: goto +34 -> 340
    //   309: aload_3
    //   310: iload 4
    //   312: new 74	java/io/File
    //   315: dup
    //   316: aload_2
    //   317: iload 4
    //   319: invokeinterface 179 2 0
    //   324: checkcast 125	java/lang/String
    //   327: invokespecial 76	java/io/File:<init>	(Ljava/lang/String;)V
    //   330: invokevirtual 183	java/io/File:toURI	()Ljava/net/URI;
    //   333: invokevirtual 187	java/net/URI:toURL	()Ljava/net/URL;
    //   336: aastore
    //   337: iinc 4 1
    //   340: iload 4
    //   342: aload_2
    //   343: invokeinterface 173 1 0
    //   348: if_icmplt -39 -> 309
    //   351: ldc 48
    //   353: aload_0
    //   354: getfield 50	com/googlecode/dex2jar/tools/DecryptStringCmd:type	Ljava/lang/String;
    //   357: invokevirtual 193	java/lang/String:equals	(Ljava/lang/Object;)Z
    //   360: ifeq +8 -> 368
    //   363: ldc 125
    //   365: goto +6 -> 371
    //   368: getstatic 196	java/lang/Integer:TYPE	Ljava/lang/Class;
    //   371: astore 6
    //   373: new 202	java/net/URLClassLoader
    //   376: dup
    //   377: aload_3
    //   378: invokespecial 204	java/net/URLClassLoader:<init>	([Ljava/net/URL;)V
    //   381: astore 7
    //   383: aload 7
    //   385: aload_0
    //   386: getfield 112	com/googlecode/dex2jar/tools/DecryptStringCmd:methodOwner	Ljava/lang/String;
    //   389: invokevirtual 207	java/net/URLClassLoader:loadClass	(Ljava/lang/String;)Ljava/lang/Class;
    //   392: aload_0
    //   393: getfield 110	com/googlecode/dex2jar/tools/DecryptStringCmd:methodName	Ljava/lang/String;
    //   396: iconst_1
    //   397: anewarray 211	java/lang/Class
    //   400: dup
    //   401: iconst_0
    //   402: aload 6
    //   404: aastore
    //   405: invokevirtual 213	java/lang/Class:getDeclaredMethod	(Ljava/lang/String;[Ljava/lang/Class;)Ljava/lang/reflect/Method;
    //   408: astore 4
    //   410: aload 4
    //   412: iconst_1
    //   413: invokevirtual 217	java/lang/reflect/Method:setAccessible	(Z)V
    //   416: aload 4
    //   418: invokestatic 223	org/objectweb/asm/Type:getMethodDescriptor	(Ljava/lang/reflect/Method;)Ljava/lang/String;
    //   421: astore 5
    //   423: goto +65 -> 488
    //   426: astore 6
    //   428: getstatic 83	java/lang/System:err	Ljava/io/PrintStream;
    //   431: new 89	java/lang/StringBuilder
    //   434: dup
    //   435: ldc -27
    //   437: invokespecial 130	java/lang/StringBuilder:<init>	(Ljava/lang/String;)V
    //   440: aload_0
    //   441: getfield 112	com/googlecode/dex2jar/tools/DecryptStringCmd:methodOwner	Ljava/lang/String;
    //   444: invokevirtual 98	java/lang/StringBuilder:append	(Ljava/lang/String;)Ljava/lang/StringBuilder;
    //   447: ldc -25
    //   449: invokevirtual 98	java/lang/StringBuilder:append	(Ljava/lang/String;)Ljava/lang/StringBuilder;
    //   452: aload_0
    //   453: getfield 110	com/googlecode/dex2jar/tools/DecryptStringCmd:methodName	Ljava/lang/String;
    //   456: invokevirtual 98	java/lang/StringBuilder:append	(Ljava/lang/String;)Ljava/lang/StringBuilder;
    //   459: ldc -23
    //   461: invokevirtual 98	java/lang/StringBuilder:append	(Ljava/lang/String;)Ljava/lang/StringBuilder;
    //   464: aload_0
    //   465: getfield 50	com/googlecode/dex2jar/tools/DecryptStringCmd:type	Ljava/lang/String;
    //   468: invokevirtual 98	java/lang/StringBuilder:append	(Ljava/lang/String;)Ljava/lang/StringBuilder;
    //   471: ldc -21
    //   473: invokevirtual 98	java/lang/StringBuilder:append	(Ljava/lang/String;)Ljava/lang/StringBuilder;
    //   476: invokevirtual 101	java/lang/StringBuilder:toString	()Lja
1 2 3 4 5

Further reading...

For more information on Java 1.5 Tiger, you may find Java 1.5 Tiger, A developer's Notebook by D. Flanagan and B. McLaughlin from O'Reilly of interest.

New!JAR listings


Copyright 2006-2017. Infinite Loop Ltd