Skip to content

Commit d1af702

Browse files
committed
Remove ClassGenerator(ctor), update proguard cfg, update version
1 parent 0a71aab commit d1af702

File tree

4 files changed

+10
-15
lines changed

4 files changed

+10
-15
lines changed

app/build.gradle

+4-4
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ android {
1515
applicationId "org.duangsuse.tree"
1616
minSdkVersion 14
1717
targetSdkVersion 27
18-
versionCode 2
19-
versionName '1.1-萘'
18+
versionCode 3
19+
versionName '1.2-钠'
2020
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
2121
signingConfig signingConfigs.config
2222
}
@@ -33,7 +33,7 @@ android {
3333
}
3434
}
3535
lintOptions {
36-
disable 'MissingApplicationIcon', 'GoogleAppIndexingWarning', 'AllowBackup'
36+
disable 'MissingApplicationIcon', 'GoogleAppIndexingWarning', 'AllowBackup', 'UnusedAttribute'
3737
}
3838
productFlavors {
3939
}
@@ -50,4 +50,4 @@ dependencies {
5050
testImplementation 'junit:junit:4.12'
5151
androidTestImplementation 'com.android.support.test:runner:1.0.1'
5252
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'
53-
}
53+
}

app/proguard-rules.pro

+3-1
Original file line numberDiff line numberDiff line change
@@ -25,5 +25,7 @@
2525
-dontnote org.apache.http.**
2626
-dontnote android.net.http.**
2727
-dontnote bsh.ClassGenerator
28+
-dontnote bsh.BshClassManager
2829
-keep class org.duangsuse.** { *; }
29-
-keep class bsh.** { *; }
30+
-keep class bsh.** { *; }
31+
-keepclassmembers class android.os.Build { int SDK_INT; }

app/src/main/java/bsh/ClassGenerator.java

+1-10
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,7 @@ public abstract class ClassGenerator {
77
private static ClassGenerator cg;
88

99
public static ClassGenerator getClassGenerator() throws UtilEvalError {
10-
if (cg == null) {
11-
try {
12-
Class clas = Class.forName("bsh.ClassGeneratorImpl");
13-
cg = (ClassGenerator) clas.newInstance();
14-
} catch (Exception e) {
15-
throw new Unavailable("类生成器不可用: " + e);
16-
}
17-
}
18-
19-
return cg;
10+
throw new Unavailable("类生成器不可用");
2011
}
2112

2213
/** Parse the BSHBlock for the class definition and generate the class. */

app/src/main/java/org/duangsuse/tree/ExecActivity.java

+2
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
import android.os.Bundle;
1616
import android.view.View;
1717
import android.view.View.OnLongClickListener;
18+
import android.view.Gravity;
1819
import android.widget.EditText;
1920

2021
import java.util.Locale;
@@ -33,6 +34,7 @@ protected void onCreate(Bundle savedInstanceState) {
3334
if (getActionBar() != null)
3435
getActionBar().setIcon(drawable.ic_secure);
3536
textBackground = new EditText(this);
37+
textBackground.setGravity(Gravity.TOP);
3638
textBackground.setText("Loading info...");
3739
setContentView(textBackground);
3840
try {

0 commit comments

Comments
 (0)