mirror of
https://github.com/revanced/Apktool.git
synced 2025-01-05 17:45:52 +01:00
deleted not-needed smali stuff, renamed license for smali to prevent conflicts, worked on Proguard
This commit is contained in:
parent
3947b4c941
commit
bbee938b5c
@ -1,4 +0,0 @@
|
||||
.class public abstract interface annotation LClassAnnotation;
|
||||
.super Ljava/lang/Object;
|
||||
.implements Ljava/lang/annotation/Annotation;
|
||||
|
@ -1,4 +0,0 @@
|
||||
.class public abstract interface annotation LFieldAnnotation;
|
||||
.super Ljava/lang/Object;
|
||||
.implements Ljava/lang/annotation/Annotation;
|
||||
|
@ -1,138 +0,0 @@
|
||||
.class public LMain;
|
||||
.super Ljava/lang/Object;
|
||||
|
||||
|
||||
#expected output:
|
||||
#@ClassAnnotation()
|
||||
#@MethodAnnotation()
|
||||
#@FieldAnnotation()
|
||||
#@ParameterAnnotation()
|
||||
|
||||
|
||||
.method public static main([Ljava/lang/String;)V
|
||||
.registers 1
|
||||
|
||||
invoke-static {}, LMain;->testClassAnnotation()V
|
||||
|
||||
invoke-static {}, LMain;->testMethodAnnotation()V
|
||||
|
||||
invoke-static {}, LMain;->testFieldAnnotation()V
|
||||
|
||||
const-string v0, ""
|
||||
|
||||
invoke-static {v0}, LMain;->testParameterAnnotation(Ljava/lang/String;)V
|
||||
|
||||
return-void
|
||||
.end method
|
||||
|
||||
.annotation runtime LClassAnnotation;
|
||||
.end annotation
|
||||
|
||||
.method public static testClassAnnotation()V
|
||||
.registers 3
|
||||
|
||||
sget-object v0, Ljava/lang/System;->out:Ljava/io/PrintStream;
|
||||
|
||||
const-class v1, LMain;
|
||||
const-class v2, LClassAnnotation;
|
||||
|
||||
invoke-virtual {v1, v2}, Ljava/lang/Class;->getAnnotation(Ljava/lang/Class;)Ljava/lang/annotation/Annotation;
|
||||
move-result-object v1
|
||||
|
||||
invoke-virtual {v0, v1}, Ljava/io/PrintStream;->println(Ljava/lang/Object;)V
|
||||
|
||||
return-void
|
||||
.end method
|
||||
|
||||
|
||||
|
||||
.method public static testMethodAnnotation()V
|
||||
.registers 4
|
||||
|
||||
.annotation runtime LMethodAnnotation;
|
||||
.end annotation
|
||||
|
||||
sget-object v0, Ljava/lang/System;->out:Ljava/io/PrintStream;
|
||||
|
||||
const-class v1, LMain;
|
||||
const-string v2, "testMethodAnnotation"
|
||||
|
||||
const/4 v3, 0
|
||||
new-array v3, v3, [Ljava/lang/Class;
|
||||
|
||||
invoke-virtual {v1, v2, v3}, Ljava/lang/Class;->getMethod(Ljava/lang/String;[Ljava/lang/Class;)Ljava/lang/reflect/Method;
|
||||
move-result-object v1
|
||||
|
||||
const-class v2, LMethodAnnotation;
|
||||
|
||||
invoke-virtual {v1, v2}, Ljava/lang/reflect/Method;->getAnnotation(Ljava/lang/Class;)Ljava/lang/annotation/Annotation;
|
||||
move-result-object v1
|
||||
|
||||
invoke-virtual {v0, v1}, Ljava/io/PrintStream;->println(Ljava/lang/Object;)V
|
||||
|
||||
return-void
|
||||
.end method
|
||||
|
||||
|
||||
.field public static fieldAnnotationTest:Ljava/lang/Object;
|
||||
.annotation runtime LFieldAnnotation;
|
||||
.end annotation
|
||||
.end field
|
||||
|
||||
.method public static testFieldAnnotation()V
|
||||
.registers 3
|
||||
|
||||
sget-object v0, Ljava/lang/System;->out:Ljava/io/PrintStream;
|
||||
|
||||
const-class v1, LMain;
|
||||
const-string v2, "fieldAnnotationTest"
|
||||
|
||||
invoke-virtual {v1, v2}, Ljava/lang/Class;->getField(Ljava/lang/String;)Ljava/lang/reflect/Field;
|
||||
move-result-object v1
|
||||
|
||||
const-class v2, LFieldAnnotation;
|
||||
|
||||
invoke-virtual {v1, v2}, Ljava/lang/reflect/Field;->getAnnotation(Ljava/lang/Class;)Ljava/lang/annotation/Annotation;
|
||||
move-result-object v1
|
||||
|
||||
invoke-virtual {v0, v1}, Ljava/io/PrintStream;->println(Ljava/lang/Object;)V
|
||||
|
||||
return-void
|
||||
.end method
|
||||
|
||||
|
||||
.method public static testParameterAnnotation(Ljava/lang/String;)V
|
||||
.registers 6
|
||||
|
||||
.parameter
|
||||
.annotation runtime LParameterAnnotation;
|
||||
.end annotation
|
||||
.end parameter
|
||||
|
||||
|
||||
sget-object v0, Ljava/lang/System;->out:Ljava/io/PrintStream;
|
||||
|
||||
const-class v1, LMain;
|
||||
const-string v2, "testParameterAnnotation"
|
||||
|
||||
const/4 v3, 1
|
||||
new-array v3, v3, [Ljava/lang/Class;
|
||||
|
||||
const-class v4, Ljava/lang/String;
|
||||
const/4 v5, 0
|
||||
aput-object v4, v3, v5
|
||||
|
||||
invoke-virtual {v1, v2, v3}, Ljava/lang/Class;->getMethod(Ljava/lang/String;[Ljava/lang/Class;)Ljava/lang/reflect/Method;
|
||||
move-result-object v1
|
||||
|
||||
|
||||
invoke-virtual {v1}, Ljava/lang/reflect/Method;->getParameterAnnotations()[[Ljava/lang/annotation/Annotation;
|
||||
move-result-object v1
|
||||
|
||||
aget-object v1, v1, v5
|
||||
aget-object v1, v1, v5
|
||||
|
||||
invoke-virtual {v0, v1}, Ljava/io/PrintStream;->println(Ljava/lang/Object;)V
|
||||
|
||||
return-void
|
||||
.end method
|
@ -1,4 +0,0 @@
|
||||
.class public abstract interface annotation LMethodAnnotation;
|
||||
.super Ljava/lang/Object;
|
||||
.implements Ljava/lang/annotation/Annotation;
|
||||
|
@ -1,3 +0,0 @@
|
||||
.class public abstract interface annotation LParameterAnnotation;
|
||||
.super Ljava/lang/Object;
|
||||
.implements Ljava/lang/annotation/Annotation;
|
@ -1,6 +0,0 @@
|
||||
.class public L10;
|
||||
.super Ljava/lang/Object;
|
||||
|
||||
.method public static 11()V
|
||||
return-void
|
||||
.end method
|
@ -1,67 +0,0 @@
|
||||
.class public abstract interface annotation LAnnotationWithValues;
|
||||
.super Ljava/lang/Object;
|
||||
.implements Ljava/lang/annotation/Annotation;
|
||||
|
||||
.method public abstract booleanValue()Z
|
||||
.end method
|
||||
|
||||
.method public abstract byteValue()B
|
||||
.end method
|
||||
|
||||
.method public abstract charValue()C
|
||||
.end method
|
||||
|
||||
.method public abstract shortValue()S
|
||||
.end method
|
||||
|
||||
.method public abstract intValue()I
|
||||
.end method
|
||||
|
||||
.method public abstract longValue()J
|
||||
.end method
|
||||
|
||||
.method public abstract floatValue()F
|
||||
.end method
|
||||
|
||||
.method public abstract doubleValue()D
|
||||
.end method
|
||||
|
||||
.method public abstract stringValue()Ljava/lang/String;
|
||||
.end method
|
||||
|
||||
.method public abstract subAnnotationValue()LSubAnnotation;
|
||||
.end method
|
||||
|
||||
.method public abstract typeValue()Ljava/lang/Class;
|
||||
.end method
|
||||
|
||||
.method public abstract methodValue()Ljava/lang/reflect/Method;
|
||||
.end method
|
||||
|
||||
#dalvik doesn't seem to like field values
|
||||
#.method public abstract fieldValue()Ljava/lang/reflect/Field;
|
||||
#.end method
|
||||
|
||||
.method public abstract enumValue()LEnum;
|
||||
.end method
|
||||
|
||||
.annotation system Ldalvik/annotation/AnnotationDefault;
|
||||
value = .subannotation LAnnotationWithValues;
|
||||
booleanValue = false
|
||||
byteValue = 1t
|
||||
charValue = '2'
|
||||
shortValue = 3s
|
||||
intValue = 4
|
||||
longValue = 5l
|
||||
floatValue = 6.0f
|
||||
doubleValue = 7.0
|
||||
stringValue = "8"
|
||||
subAnnotationValue = .subannotation LSubAnnotation;
|
||||
stringValue = "9"
|
||||
.end subannotation
|
||||
typeValue = L10;
|
||||
methodValue = L10;->11()V
|
||||
enumValue = .enum LEnum;->12:LEnum;
|
||||
.end subannotation
|
||||
.end annotation
|
||||
|
@ -1,52 +0,0 @@
|
||||
.class public final enum LEnum;
|
||||
.super Ljava/lang/Enum;
|
||||
|
||||
.field private static final synthetic $VALUES:[LEnum;
|
||||
|
||||
.field public static final enum 12:LEnum;
|
||||
|
||||
.method static constructor <clinit>()V
|
||||
.registers 4
|
||||
|
||||
const/4 v3, 1
|
||||
const/4 v2, 0
|
||||
new-instance v0, LEnum;
|
||||
const-string v1, "12"
|
||||
invoke-direct {v0, v1, v2}, LEnum;-><init>(Ljava/lang/String;I)V
|
||||
sput-object v0, LEnum;->12:LEnum;
|
||||
|
||||
const/4 v0, 1
|
||||
new-array v0, v0, [LEnum;
|
||||
sget-object v1, LEnum;->12:LEnum;
|
||||
aput-object v1, v0, v2
|
||||
|
||||
sput-object v0, LEnum;->$VALUES:[LEnum;
|
||||
return-void
|
||||
.end method
|
||||
|
||||
.method private constructor <init>(Ljava/lang/String;I)V
|
||||
.registers 3
|
||||
|
||||
invoke-direct {p0, p1, p2}, Ljava/lang/Enum;-><init>(Ljava/lang/String;I)V
|
||||
return-void
|
||||
.end method
|
||||
|
||||
.method public static valueOf(Ljava/lang/String;)LEnum;
|
||||
.registers 2
|
||||
|
||||
const-class v0, LEnum;
|
||||
invoke-static {v0, p0}, Ljava/lang/Enum;->valueOf(Ljava/lang/Class;Ljava/lang/String;)Ljava/lang/Enum;
|
||||
move-result-object v1
|
||||
check-cast v1, LEnum;
|
||||
return-object v1
|
||||
.end method
|
||||
|
||||
.method public static values()[LEnum;
|
||||
.registers 1
|
||||
|
||||
sget-object v0, LEnum;->$VALUES:[LEnum;
|
||||
invoke-virtual {v0}, [LEnum;->clone()Ljava/lang/Object;
|
||||
move-result-object v0
|
||||
check-cast v0, [LEnum;
|
||||
return-object v0
|
||||
.end method
|
@ -1,25 +0,0 @@
|
||||
.class public LMain;
|
||||
.super Ljava/lang/Object;
|
||||
|
||||
#expected output:
|
||||
#@AnnotationWithValues(booleanValue=false, byteValue=1, charValue=2, doubleValue=7.0, enumValue=12, floatValue=6.0, intValue=4, longValue=5, methodValue=public static void 10.11(), shortValue=3, stringValue=8, subAnnotationValue=@SubAnnotation(stringValue=9), typeValue=class 10)
|
||||
|
||||
|
||||
.method public static main([Ljava/lang/String;)V
|
||||
.registers 3
|
||||
|
||||
sget-object v0, Ljava/lang/System;->out:Ljava/io/PrintStream;
|
||||
|
||||
const-class v1, LMain;
|
||||
const-class v2, LAnnotationWithValues;
|
||||
|
||||
invoke-virtual {v1, v2}, Ljava/lang/Class;->getAnnotation(Ljava/lang/Class;)Ljava/lang/annotation/Annotation;
|
||||
move-result-object v1
|
||||
|
||||
invoke-virtual {v0, v1}, Ljava/io/PrintStream;->println(Ljava/lang/Object;)V
|
||||
|
||||
return-void
|
||||
.end method
|
||||
|
||||
.annotation runtime LAnnotationWithValues;
|
||||
.end annotation
|
@ -1,6 +0,0 @@
|
||||
.class public abstract interface annotation LSubAnnotation;
|
||||
.super Ljava/lang/Object;
|
||||
.implements Ljava/lang/annotation/Annotation;
|
||||
|
||||
.method public abstract stringValue()Ljava/lang/String;
|
||||
.end method
|
@ -1,73 +0,0 @@
|
||||
.class public final enum LEnum;
|
||||
.super Ljava/lang/Enum;
|
||||
|
||||
#This class is an example of how to define an enum. You have
|
||||
#to do all of the work that java normally takes care of
|
||||
|
||||
.field private static final synthetic $VALUES:[LEnum;
|
||||
|
||||
.field public static final enum VALUE1:LEnum;
|
||||
.field public static final enum VALUE2:LEnum;
|
||||
|
||||
.method static constructor <clinit>()V
|
||||
.registers 4
|
||||
|
||||
#create an instance of this class for the VALUE1 value
|
||||
new-instance v0, LEnum;
|
||||
const-string v1, "VALUE1"
|
||||
const/4 v2, 0
|
||||
invoke-direct {v0, v1, v2}, LEnum;-><init>(Ljava/lang/String;I)V
|
||||
|
||||
#and store it in VALUE1
|
||||
sput-object v0, LEnum;->VALUE1:LEnum;
|
||||
|
||||
#create an instance of this class for the VALUE2 value
|
||||
new-instance v0, LEnum;
|
||||
const-string v1, "VALUE2"
|
||||
const/4 v3, 1
|
||||
invoke-direct {v0, v1, v3}, LEnum;-><init>(Ljava/lang/String;I)V
|
||||
|
||||
#and store it in VALUE2
|
||||
sput-object v0, LEnum;->VALUE2:LEnum;
|
||||
|
||||
#create an array of Enums, for the $VALUES member
|
||||
const/4 v0, 2
|
||||
new-array v0, v0, [LEnum;
|
||||
|
||||
#add VALUE1 to the array
|
||||
sget-object v1, LEnum;->VALUE1:LEnum;
|
||||
aput-object v1, v0, v2
|
||||
|
||||
#add VALUE2 to the array
|
||||
sget-object v1, LEnum;->VALUE2:LEnum;
|
||||
aput-object v1, v0, v3
|
||||
|
||||
#and store the array in $VALUES
|
||||
sput-object v0, LEnum;->$VALUES:[LEnum;
|
||||
|
||||
return-void
|
||||
.end method
|
||||
|
||||
.method private constructor <init>(Ljava/lang/String;I)V
|
||||
.registers 3
|
||||
invoke-direct {p0, p1, p2}, Ljava/lang/Enum;-><init>(Ljava/lang/String;I)V
|
||||
return-void
|
||||
.end method
|
||||
|
||||
.method public static valueof(Ljava/lang/String;)LEnum;
|
||||
.registers 2
|
||||
const-class v0, LEnum;
|
||||
invoke-static {v0, p0}, Ljava/lang/Enum;->valueOf(Ljava/lang/Class;Ljava/lang/String;)Ljava/lang/Enum;
|
||||
move-result-object v1
|
||||
check-cast v1, LEnum;
|
||||
return-object v1
|
||||
.end method
|
||||
|
||||
.method public static values()[LEnum;
|
||||
.registers 1
|
||||
sget-object v0, LEnum;->$VALUES:[LEnum;
|
||||
invoke-virtual {v0}, [LEnum;->clone()Ljava/lang/Object;
|
||||
move-result-object v0
|
||||
check-cast v0, [LEnum;
|
||||
return-object v0
|
||||
.end method
|
@ -1,15 +0,0 @@
|
||||
.class public LMain;
|
||||
.super Ljava/lang/Object;
|
||||
|
||||
|
||||
|
||||
.method public static main([Ljava/lang/String;)V
|
||||
.registers 2
|
||||
|
||||
sget-object v0, Ljava/lang/System;->out:Ljava/io/PrintStream;
|
||||
sget-object v1, LEnum;->VALUE1:LEnum;
|
||||
|
||||
invoke-virtual {v0, v1}, Ljava/io/PrintStream;->println(Ljava/lang/Object;)V
|
||||
|
||||
return-void
|
||||
.end method
|
@ -1,27 +0,0 @@
|
||||
.class public LHelloWorld;
|
||||
|
||||
#Ye olde hello world application
|
||||
#To assemble and run this on a phone or emulator:
|
||||
#
|
||||
#java -jar smali.jar -o classes.dex HelloWorld.smali
|
||||
#zip HelloWorld.zip classes.dex
|
||||
#adb push HelloWorld.zip /data/local
|
||||
#adb shell dalvikvm -cp /data/local/HelloWorld.zip HelloWorld
|
||||
#
|
||||
#if you get out of memory type errors when running smali.jar, try
|
||||
#java -Xmx512m -jar smali.jar HelloWorld.smali
|
||||
#instead
|
||||
|
||||
.super Ljava/lang/Object;
|
||||
|
||||
.method public static main([Ljava/lang/String;)V
|
||||
.registers 2
|
||||
|
||||
sget-object v0, Ljava/lang/System;->out:Ljava/io/PrintStream;
|
||||
|
||||
const-string v1, "Hello World!"
|
||||
|
||||
invoke-virtual {v0, v1}, Ljava/io/PrintStream;->println(Ljava/lang/String;)V
|
||||
|
||||
return-void
|
||||
.end method
|
@ -1,5 +0,0 @@
|
||||
.class public abstract interface LInterface;
|
||||
.super Ljava/lang/Object;
|
||||
|
||||
.method public abstract interfaceMethod()Ljava/lang/String;
|
||||
.end method
|
@ -1,35 +0,0 @@
|
||||
.class public LMain;
|
||||
.super Ljava/lang/Object;
|
||||
.implements LInterface;
|
||||
|
||||
#expected output:
|
||||
#in interfaceMethod()
|
||||
|
||||
.method public constructor <init>()V
|
||||
.registers 1
|
||||
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
|
||||
return-void
|
||||
.end method
|
||||
|
||||
.method public static main([Ljava/lang/String;)V
|
||||
.registers 3
|
||||
|
||||
sget-object v0, Ljava/lang/System;->out:Ljava/io/PrintStream;
|
||||
|
||||
new-instance v1, LMain;
|
||||
invoke-direct {v1}, LMain;-><init>()V
|
||||
invoke-interface {v1}, LInterface;->interfaceMethod()Ljava/lang/String;
|
||||
move-result-object v1
|
||||
|
||||
invoke-virtual {v0, v1}, Ljava/io/PrintStream;->println(Ljava/lang/Object;)V
|
||||
|
||||
return-void
|
||||
.end method
|
||||
|
||||
|
||||
.method public interfaceMethod()Ljava/lang/String;
|
||||
.registers 1
|
||||
|
||||
const-string v0, "in interfaceMethod()"
|
||||
return-object v0
|
||||
.end method
|
@ -1,50 +0,0 @@
|
||||
.class public LMain;
|
||||
.super Ljava/lang/Object;
|
||||
|
||||
#expected output:
|
||||
#returning a string
|
||||
#42
|
||||
|
||||
.method public constructor <init>()V
|
||||
.registers 1
|
||||
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
|
||||
return-void
|
||||
.end method
|
||||
|
||||
.method public static main([Ljava/lang/String;)V
|
||||
.registers 4
|
||||
|
||||
sget-object v0, Ljava/lang/System;->out:Ljava/io/PrintStream;
|
||||
|
||||
new-instance v1, LMain;
|
||||
invoke-direct {v1}, LMain;-><init>()V
|
||||
invoke-virtual {v1}, LMain;->overloadTest()Ljava/lang/String;
|
||||
move-result-object v2
|
||||
|
||||
invoke-virtual {v0, v2}, Ljava/io/PrintStream;->println(Ljava/lang/Object;)V
|
||||
|
||||
invoke-virtual {v1}, LMain;->overloadTest()I
|
||||
move-result v2
|
||||
|
||||
invoke-static {v2}, Ljava/lang/Integer;->toString(I)Ljava/lang/String;
|
||||
move-result-object v2
|
||||
|
||||
invoke-virtual {v0, v2}, Ljava/io/PrintStream;->println(Ljava/lang/Object;)V
|
||||
|
||||
return-void
|
||||
.end method
|
||||
|
||||
|
||||
.method public overloadTest()Ljava/lang/String;
|
||||
.registers 1
|
||||
|
||||
const-string v0, "returning a string"
|
||||
return-object v0
|
||||
.end method
|
||||
|
||||
.method public overloadTest()I
|
||||
.registers 1
|
||||
|
||||
const v0, 42
|
||||
return v0
|
||||
.end method
|
@ -1,24 +0,0 @@
|
||||
.class public LMain;
|
||||
.super Ljava/lang/Object;
|
||||
|
||||
#expected output (using the dalvik's default stack size)
|
||||
#@RecursiveAnnotation(value=@RecursiveAnnotation(value=@RecursiveAnnotation(value=@RecursiveAnnotation(value=@RecursiveAnnotation(value=@RecursiveAnnotation(value=@RecursiveAnnotation(value=@RecursiveAnnotation(value=@RecursiveAnnotation(value=@RecursiveAnnotation(value=@RecursiveAnnotation(value=@RecursiveAnnotation(value=@RecursiveAnnotation(value=@RecursiveAnnotation(value=@RecursiveAnnotation(value=@RecursiveAnnotation(value=@RecursiveAnnotation(value=@RecursiveAnnotation(value=@RecursiveAnnotation(value=@RecursiveAnnotation(value=@RecursiveAnnotation(value=@RecursiveAnnotation(value=@RecursiveAnnotation(value=@RecursiveAnnotation(value=@RecursiveAnnotation(value=@RecursiveAnnotation(value=@RecursiveAnnotation(value=@RecursiveAnnotation(value=@RecursiveAnnotation(value=@RecursiveAnnotation(value=java.lang.StackOverflowError))))))))))))))))))))))))))))))
|
||||
|
||||
.method public static main([Ljava/lang/String;)V
|
||||
.registers 3
|
||||
|
||||
sget-object v0, Ljava/lang/System;->out:Ljava/io/PrintStream;
|
||||
|
||||
const-class v1, LMain;
|
||||
const-class v2, LRecursiveAnnotation;
|
||||
|
||||
invoke-virtual {v1, v2}, Ljava/lang/Class;->getAnnotation(Ljava/lang/Class;)Ljava/lang/annotation/Annotation;
|
||||
move-result-object v1
|
||||
|
||||
invoke-virtual {v0, v1}, Ljava/io/PrintStream;->println(Ljava/lang/Object;)V
|
||||
|
||||
return-void
|
||||
.end method
|
||||
|
||||
.annotation runtime LRecursiveAnnotation;
|
||||
.end annotation
|
@ -1,18 +0,0 @@
|
||||
.class public abstract interface annotation LRecursiveAnnotation;
|
||||
.super Ljava/lang/Object;
|
||||
.implements Ljava/lang/annotation/Annotation;
|
||||
|
||||
#this is a recursive annotation that has a default value of itself.
|
||||
#Trying to print .toString() on an instance of this annotation
|
||||
#will cause a stack overflow
|
||||
|
||||
.method public abstract value()LRecursiveAnnotation;
|
||||
.end method
|
||||
|
||||
.annotation system Ldalvik/annotation/AnnotationDefault;
|
||||
value = .subannotation LRecursiveAnnotation;
|
||||
value = .subannotation LRecursiveAnnotation;
|
||||
.end subannotation
|
||||
.end subannotation
|
||||
.end annotation
|
||||
|
@ -1,21 +0,0 @@
|
||||
.class public LMain;
|
||||
.super Ljava/lang/Object;
|
||||
|
||||
.method public static main([Ljava/lang/String;)V
|
||||
.registers 3
|
||||
|
||||
:second_handler
|
||||
:first_try_start
|
||||
new-instance v0, Ljava/lang/RuntimeException;
|
||||
invoke-direct {v0}, Ljava/lang/RuntimeException;-><init>()V
|
||||
throw v0
|
||||
:first_try_end
|
||||
.catch Ljava/lang/Exception; {:first_try_start .. :first_try_end} :first_handler
|
||||
:first_handler
|
||||
:second_try_start
|
||||
new-instance v0, Ljava/lang/RuntimeException;
|
||||
invoke-direct {v0}, Ljava/lang/RuntimeException;-><init>()V
|
||||
throw v0
|
||||
:second_try_end
|
||||
.catch Ljava/lang/Exception; {:second_try_start .. :second_try_end} :second_handler
|
||||
.end method
|
@ -1,83 +0,0 @@
|
||||
#!/bin/bash
|
||||
#
|
||||
# Copyright (C) 2007 The Android Open Source Project
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
# As per the Apache license requirements, this file has been modified
|
||||
# from its original state.
|
||||
#
|
||||
# Such modifications are Copyright (C) 2010 Ben Gruver, and are released
|
||||
# under the original license
|
||||
|
||||
# This script is a wrapper around baksmali.jar, so you can simply call
|
||||
# "baksmali", instead of java -jar baksmali.jar. It is heavily based on
|
||||
# the "dx" script from the Android SDK
|
||||
|
||||
# Set up prog to be the path of this script, including following symlinks,
|
||||
# and set up progdir to be the fully-qualified pathname of its directory.
|
||||
prog="$0"
|
||||
while [ -h "${prog}" ]; do
|
||||
newProg=`/bin/ls -ld "${prog}"`
|
||||
echo ${newProg}
|
||||
|
||||
|
||||
newProg=`expr "${newProg}" : ".* -> \(.*\)$"`
|
||||
if expr "x${newProg}" : 'x/' >/dev/null; then
|
||||
prog="${newProg}"
|
||||
else
|
||||
progdir=`dirname "${prog}"`
|
||||
prog="${progdir}/${newProg}"
|
||||
fi
|
||||
done
|
||||
oldwd=`pwd`
|
||||
progdir=`dirname "${prog}"`
|
||||
cd "${progdir}"
|
||||
progdir=`pwd`
|
||||
prog="${progdir}"/`basename "${prog}"`
|
||||
cd "${oldwd}"
|
||||
|
||||
|
||||
jarfile=baksmali.jar
|
||||
libdir="$progdir"
|
||||
if [ ! -r "$libdir/$jarfile" ]
|
||||
then
|
||||
echo `basename "$prog"`": can't find $jarfile"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
javaOpts=""
|
||||
|
||||
# If you want DX to have more memory when executing, uncomment the following
|
||||
# line and adjust the value accordingly. Use "java -X" for a list of options
|
||||
# you can pass here.
|
||||
#
|
||||
javaOpts="-Xmx256M"
|
||||
|
||||
# Alternatively, this will extract any parameter "-Jxxx" from the command line
|
||||
# and pass them to Java (instead of to dx). This makes it possible for you to
|
||||
# add a command-line parameter such as "-JXmx256M" in your ant scripts, for
|
||||
# example.
|
||||
while expr "x$1" : 'x-J' >/dev/null; do
|
||||
opt=`expr "$1" : '-J\(.*\)'`
|
||||
javaOpts="${javaOpts} -${opt}"
|
||||
shift
|
||||
done
|
||||
|
||||
if [ "$OSTYPE" = "cygwin" ] ; then
|
||||
jarpath=`cygpath -w "$libdir/$jarfile"`
|
||||
else
|
||||
jarpath="$libdir/$jarfile"
|
||||
fi
|
||||
|
||||
exec java $javaOpts -jar "$jarpath" "$@"
|
@ -1,83 +0,0 @@
|
||||
#!/bin/bash
|
||||
#
|
||||
# Copyright (C) 2007 The Android Open Source Project
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
# As per the Apache license requirements, this file has been modified
|
||||
# from its original state.
|
||||
#
|
||||
# Such modifications are Copyright (C) 2010 Ben Gruver, and are released
|
||||
# under the original license
|
||||
|
||||
# This script is a wrapper for smali.jar, so you can simply call "smali",
|
||||
# instead of java -jar smali.jar. It is heavily based on the "dx" script
|
||||
# from the Android SDK
|
||||
|
||||
# Set up prog to be the path of this script, including following symlinks,
|
||||
# and set up progdir to be the fully-qualified pathname of its directory.
|
||||
prog="$0"
|
||||
while [ -h "${prog}" ]; do
|
||||
newProg=`/bin/ls -ld "${prog}"`
|
||||
echo ${newProg}
|
||||
|
||||
|
||||
newProg=`expr "${newProg}" : ".* -> \(.*\)$"`
|
||||
if expr "x${newProg}" : 'x/' >/dev/null; then
|
||||
prog="${newProg}"
|
||||
else
|
||||
progdir=`dirname "${prog}"`
|
||||
prog="${progdir}/${newProg}"
|
||||
fi
|
||||
done
|
||||
oldwd=`pwd`
|
||||
progdir=`dirname "${prog}"`
|
||||
cd "${progdir}"
|
||||
progdir=`pwd`
|
||||
prog="${progdir}"/`basename "${prog}"`
|
||||
cd "${oldwd}"
|
||||
|
||||
|
||||
jarfile=smali.jar
|
||||
libdir="$progdir"
|
||||
if [ ! -r "$libdir/$jarfile" ]
|
||||
then
|
||||
echo `basename "$prog"`": can't find $jarfile"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
javaOpts=""
|
||||
|
||||
# If you want DX to have more memory when executing, uncomment the following
|
||||
# line and adjust the value accordingly. Use "java -X" for a list of options
|
||||
# you can pass here.
|
||||
#
|
||||
javaOpts="-Xmx256M"
|
||||
|
||||
# Alternatively, this will extract any parameter "-Jxxx" from the command line
|
||||
# and pass them to Java (instead of to dx). This makes it possible for you to
|
||||
# add a command-line parameter such as "-JXmx256M" in your ant scripts, for
|
||||
# example.
|
||||
while expr "x$1" : 'x-J' >/dev/null; do
|
||||
opt=`expr "$1" : '-J\(.*\)'`
|
||||
javaOpts="${javaOpts} -${opt}"
|
||||
shift
|
||||
done
|
||||
|
||||
if [ "$OSTYPE" = "cygwin" ] ; then
|
||||
jarpath=`cygpath -w "$libdir/$jarfile"`
|
||||
else
|
||||
jarpath="$libdir/$jarfile"
|
||||
fi
|
||||
|
||||
exec java $javaOpts -jar "$jarpath" "$@"
|
@ -16,8 +16,13 @@
|
||||
|
||||
version = apktoolversion
|
||||
|
||||
configurations {
|
||||
proguard
|
||||
}
|
||||
|
||||
dependencies {
|
||||
compile project(':brut.apktool:apktool-lib')
|
||||
proguard 'net.sf.proguard:proguard-base:4.8'
|
||||
}
|
||||
|
||||
gradle.taskGraph.whenReady {
|
||||
@ -28,4 +33,27 @@ gradle.taskGraph.whenReady {
|
||||
attributes("Main-Class": "brut.apktool.Main")
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
task proguard(type: JavaExec, dependsOn: jar) {
|
||||
def outFile = jar.destinationDir.getPath() + '/' + jar.baseName + '-' + jar.version + '-small' + '.' + jar.extension
|
||||
inputs.file jar.archivePath
|
||||
outputs.file outFile
|
||||
|
||||
classpath = configurations.proguard
|
||||
main = 'proguard.ProGuard'
|
||||
args '-injars ' + "${jar.archivePath}" + ' (!META-INF/LICENSE.txt,!META-INF/NOTICE.txt,!README)'
|
||||
args "-outjars ${outFile}"
|
||||
args "-libraryjars ${System.properties['java.home']}/lib/rt.jar"
|
||||
args '-dontobfuscate'
|
||||
args '-dontoptimize'
|
||||
args '-keep public class brut.apktool.Main { public static void main(java.lang.String[]); }'
|
||||
args '-keep class org.yaml.snakeyaml.** { public protected private *; }'
|
||||
args '-keepclassmembers enum * { public static **[] values(); public static ** valueOf(java.lang.String); }'
|
||||
args '-dontwarn com.google.common.base.**'
|
||||
args '-dontwarn com.google.common.collect.**'
|
||||
args '-dontwarn javax.xml.xpath.**'
|
||||
args '-dontnote **'
|
||||
}
|
||||
|
||||
tasks.getByPath(':release').dependsOn(proguard)
|
Loading…
Reference in New Issue
Block a user