Skip to content

Commit 0b8a15a

Browse files
committed
Update header generator and dependencies
1 parent 6f0bbd5 commit 0b8a15a

File tree

6 files changed

+28
-24
lines changed

6 files changed

+28
-24
lines changed

app/build.gradle

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,13 @@ apply plugin: 'kotlin-android'
33

44
android {
55
compileSdkVersion 30
6-
buildToolsVersion = '30.0.2'
6+
buildToolsVersion = '30.0.3'
77
ndkVersion '21.0.6113669'
88

99
defaultConfig {
1010
applicationId "com.mcal.disassembler"
1111
minSdkVersion 14
12+
//noinspection OldTargetApi
1213
targetSdkVersion 29
1314
versionCode 23
1415
versionName "2.3"
@@ -41,18 +42,18 @@ dependencies {
4142
implementation project(':library')
4243
implementation fileTree(dir: 'libs', include: ['*.jar'])
4344
implementation 'androidx.cardview:cardview:1.0.0'
44-
implementation 'androidx.annotation:annotation:1.1.0'
45+
implementation 'androidx.annotation:annotation:1.2.0'
4546
implementation 'androidx.preference:preference:1.1.1'
46-
implementation "androidx.core:core-ktx:1.3.1"
47+
implementation "androidx.core:core-ktx:1.5.0"
4748
implementation 'androidx.swiperefreshlayout:swiperefreshlayout:1.1.0'
4849

49-
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.4.10"
50-
implementation 'org.jetbrains:annotations:19.0.0'
50+
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.5.20"
51+
implementation 'org.jetbrains:annotations:21.0.1'
5152

52-
implementation 'com.google.android.material:material:1.2.1'
53+
implementation 'com.google.android.material:material:1.3.0'
5354

5455
implementation 'com.anjlab.android.iab.v3:library:1.1.0'
55-
implementation 'com.jakewharton:butterknife:8.5.1'
56+
implementation 'com.jakewharton:butterknife:10.2.3'
5657
//annotationProcessor 'com.jakewharton:butterknife-compiler:10.1.0'
5758
implementation 'com.nineoldandroids:library:2.4.0'
5859
}

app/proguard-rules.pro

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
-keepattributes SourceFile, LineNumberTable
2-
32
-renamesourcefileattribute SourceFile
4-
-repackageclasses disassembler
53

6-
-keep class com.mcal.disassembler.activities.MainActivity
4+
-dontobfuscate

app/src/main/java/com/mcal/disassembler/util/FileSaver.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@
55
import java.io.IOException;
66

77
public class FileSaver {
8-
private String name;
9-
private String[] file;
10-
private String path;
8+
private final String name;
9+
private final String[] file;
10+
private final String path;
1111

1212
public FileSaver(String path, String name, String[] file) {
1313
this.name = name;

app/src/main/java/com/mcal/disassembler/util/HeaderGenerator.java

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@
1010
import java.util.Vector;
1111

1212
public class HeaderGenerator {
13-
private DisassemblerClass disassemblerClass;
14-
private DisassemblerVtable vtable;
13+
private final DisassemblerClass disassemblerClass;
14+
private final DisassemblerVtable vtable;
1515
private String[] namespace;
1616
private String className;
1717

@@ -96,6 +96,8 @@ private String getOwnerClass(DisassemblerSymbol sym) throws Exception {
9696
public String[] generate() {
9797
Vector<String> lines = new Vector<>();
9898
try {
99+
lines.addElement("#ifdef _" + className.toUpperCase() + "_H");
100+
lines.addElement("");
99101
lines.addElement("#pragma once");
100102
lines.addElement("");
101103
lines.addElement("//This header template file is generated by Disassembler.");
@@ -151,6 +153,8 @@ public String[] generate() {
151153
}
152154
}
153155
lines.addElement("};//" + className);
156+
lines.addElement("");
157+
lines.addElement("#endif // _" + className.toUpperCase() + "_H");
154158
for (String space : namespace) {
155159
lines.addElement("}//" + space);
156160
}
@@ -196,7 +200,7 @@ private String getVirtualMethodDefinition(@NotNull DisassemblerSymbol symbol) th
196200

197201
@Nullable
198202
private DisassemblerSymbol[] getObjects() {
199-
Vector<DisassemblerSymbol> symbols = new Vector<DisassemblerSymbol>();
203+
Vector<DisassemblerSymbol> symbols = new Vector<>();
200204
for (DisassemblerSymbol symbol : disassemblerClass.getSymbols())
201205
if (isObjectItem(symbol))
202206
symbols.addElement(symbol);
@@ -228,7 +232,7 @@ private DisassemblerSymbol[] getVtables() {
228232

229233
@Nullable
230234
private DisassemblerSymbol[] getMethods() {
231-
Vector<DisassemblerSymbol> symbols = new Vector<DisassemblerSymbol>();
235+
Vector<DisassemblerSymbol> symbols = new Vector<>();
232236
for (DisassemblerSymbol symbol : disassemblerClass.getSymbols())
233237
if (isMethodItem(symbol) && !isVtable(symbol) && hasItemInList(symbols, symbol))
234238
symbols.addElement(symbol);
@@ -252,7 +256,7 @@ private boolean isVtable(DisassemblerSymbol sym) {
252256

253257
@NotNull
254258
private Vector<DisassemblerSymbol> moveConOrDesToStart(@NotNull Vector<DisassemblerSymbol> syms) {
255-
Vector<DisassemblerSymbol> ret = new Vector<DisassemblerSymbol>();
259+
Vector<DisassemblerSymbol> ret = new Vector<>();
256260
for (DisassemblerSymbol sym : syms)
257261
if (isCon(sym))
258262
ret.addElement(sym);

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ buildscript {
77
jcenter()
88
}
99
dependencies {
10-
classpath 'com.android.tools.build:gradle:4.0.1'
10+
classpath 'com.android.tools.build:gradle:4.2.1'
1111
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.4.10"
1212

1313
// NOTE: Do not place your application dependencies here; they belong

library/build.gradle

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,11 @@ apply plugin: 'com.android.library'
22

33
android {
44
compileSdkVersion 30
5-
buildToolsVersion = '30.0.2'
5+
buildToolsVersion = '30.0.3'
66

77
defaultConfig {
88
minSdkVersion 14
9+
//noinspection OldTargetApi
910
targetSdkVersion 29
1011
versionCode 13
1112
versionName "1.3"
@@ -24,11 +25,11 @@ android {
2425

2526
dependencies {
2627
implementation fileTree(dir: 'libs', include: ['*.jar'])
27-
implementation 'androidx.appcompat:appcompat:1.2.0'
28-
implementation 'androidx.recyclerview:recyclerview:1.1.0'
28+
implementation 'androidx.appcompat:appcompat:1.3.0'
29+
implementation 'androidx.recyclerview:recyclerview:1.2.1'
2930
implementation 'androidx.cardview:cardview:1.0.0'
3031

31-
implementation 'com.google.android.material:material:1.2.1'
32+
implementation 'com.google.android.material:material:1.3.0'
3233

33-
implementation 'org.jetbrains:annotations:19.0.0'
34+
implementation 'org.jetbrains:annotations:21.0.1'
3435
}

0 commit comments

Comments
 (0)