From b5d194236851a4c33f1ea61da3604da78a5bbd83 Mon Sep 17 00:00:00 2001
From: PeratX <1215714524@qq.com>
Date: Wed, 23 Oct 2019 12:34:17 +0800
Subject: [PATCH] Home: remove notice_main
---
app/build.gradle | 3 +--
app/src/main/java/org/itxtech/daedalus/Daedalus.java | 3 +--
.../java/org/itxtech/daedalus/activity/MainActivity.java | 3 +--
.../org/itxtech/daedalus/fragment/DNSTestFragment.java | 2 +-
.../java/org/itxtech/daedalus/fragment/HomeFragment.java | 8 --------
.../java/org/itxtech/daedalus/fragment/LogFragment.java | 2 +-
.../java/org/itxtech/daedalus/provider/TcpProvider.java | 2 +-
.../java/org/itxtech/daedalus/util/RuleResolver.java | 4 ++--
.../java/org/itxtech/daedalus/util/server/DNSServer.java | 2 +-
app/src/main/res/layout/fragment_main.xml | 9 ---------
app/src/main/res/values-zh-rCN/strings.xml | 1 -
app/src/main/res/values-zh-rTW/strings.xml | 1 -
app/src/main/res/values/strings.xml | 1 -
13 files changed, 9 insertions(+), 32 deletions(-)
diff --git a/app/build.gradle b/app/build.gradle
index 040344c..7f93c67 100644
--- a/app/build.gradle
+++ b/app/build.gradle
@@ -56,7 +56,7 @@ dependencies {
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
implementation 'androidx.percentlayout:percentlayout:1.0.0'
implementation 'androidx.cardview:cardview:1.0.0'
- implementation 'com.google.android.material:material:1.1.0-beta01'
+ implementation 'com.google.android.material:material:1.2.0-alpha01'
implementation 'androidx.recyclerview:recyclerview:1.1.0-beta05'
implementation "androidx.preference:preference:1.1.0"
//DNS
@@ -65,7 +65,6 @@ dependencies {
implementation 'org.minidns:minidns-client:0.3.4'
implementation 'com.google.code.gson:gson:2.8.5'
implementation 'com.squareup.okhttp3:okhttp:4.2.0'
-
//Analytics
googleReleaseImplementation 'com.google.firebase:firebase-core:17.2.0'
googleReleaseImplementation 'com.crashlytics.sdk.android:crashlytics:2.10.1'
diff --git a/app/src/main/java/org/itxtech/daedalus/Daedalus.java b/app/src/main/java/org/itxtech/daedalus/Daedalus.java
index 066a836..8cc9453 100644
--- a/app/src/main/java/org/itxtech/daedalus/Daedalus.java
+++ b/app/src/main/java/org/itxtech/daedalus/Daedalus.java
@@ -175,7 +175,6 @@ public class Daedalus extends Application {
@Override
public void onTerminate() {
- Log.d("Daedalus", "onTerminate");
super.onTerminate();
instance = null;
@@ -242,7 +241,7 @@ public class Daedalus extends Application {
public static void updateShortcut(Context context) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N_MR1) {
- Log.d("Daedalus", "Updating shortcut");
+ Logger.info("Updating shortcut");
boolean activate = DaedalusVpnService.isActivated();
String notice = activate ? context.getString(R.string.button_text_deactivate) : context.getString(R.string.button_text_activate);
ShortcutInfo info = new ShortcutInfo.Builder(context, Daedalus.SHORTCUT_ID_ACTIVATE)
diff --git a/app/src/main/java/org/itxtech/daedalus/activity/MainActivity.java b/app/src/main/java/org/itxtech/daedalus/activity/MainActivity.java
index f8b22c3..78f1ef8 100644
--- a/app/src/main/java/org/itxtech/daedalus/activity/MainActivity.java
+++ b/app/src/main/java/org/itxtech/daedalus/activity/MainActivity.java
@@ -182,7 +182,7 @@ public class MainActivity extends AppCompatActivity implements NavigationView.On
private void updateUserInterface(Intent intent) {
int launchAction = intent.getIntExtra(LAUNCH_ACTION, LAUNCH_ACTION_NONE);
- Log.d(TAG, "Updating user interface with Launch Action " + String.valueOf(launchAction));
+ Log.d(TAG, "Updating user interface with Launch Action " + launchAction);
if (launchAction == LAUNCH_ACTION_ACTIVATE) {
this.activateService();
} else if (launchAction == LAUNCH_ACTION_DEACTIVATE) {
@@ -240,7 +240,6 @@ public class MainActivity extends AppCompatActivity implements NavigationView.On
@Override
public boolean onNavigationItemSelected(@NonNull MenuItem item) {
- // Handle navigation view item clicks here.
int id = item.getItemId();
switch (id) {
diff --git a/app/src/main/java/org/itxtech/daedalus/fragment/DNSTestFragment.java b/app/src/main/java/org/itxtech/daedalus/fragment/DNSTestFragment.java
index 79157d9..3d44e6f 100644
--- a/app/src/main/java/org/itxtech/daedalus/fragment/DNSTestFragment.java
+++ b/app/src/main/java/org/itxtech/daedalus/fragment/DNSTestFragment.java
@@ -181,7 +181,7 @@ public class DNSTestFragment extends ToolbarFragment {
}
}
testText.append("\n").append(getString(R.string.test_time_used)).append(" ").
- append(String.valueOf(endTime - startTime)).append(" ms");
+ append(endTime - startTime).append(" ms");
succ = true;
}
} catch (SocketTimeoutException ignored) {
diff --git a/app/src/main/java/org/itxtech/daedalus/fragment/HomeFragment.java b/app/src/main/java/org/itxtech/daedalus/fragment/HomeFragment.java
index 91803a8..82702f3 100644
--- a/app/src/main/java/org/itxtech/daedalus/fragment/HomeFragment.java
+++ b/app/src/main/java/org/itxtech/daedalus/fragment/HomeFragment.java
@@ -49,14 +49,6 @@ public class HomeFragment extends ToolbarFragment {
updateUserInterface();
}
- @Override
- public void setUserVisibleHint(boolean isVisibleToUser) {
- super.setUserVisibleHint(isVisibleToUser);
- if (isVisibleToUser) {
- updateUserInterface();
- }
- }
-
private void updateUserInterface() {
Log.d("DMainFragment", "updateInterface");
Button but = getView().findViewById(R.id.button_activate);
diff --git a/app/src/main/java/org/itxtech/daedalus/fragment/LogFragment.java b/app/src/main/java/org/itxtech/daedalus/fragment/LogFragment.java
index dc8880d..0a418b0 100644
--- a/app/src/main/java/org/itxtech/daedalus/fragment/LogFragment.java
+++ b/app/src/main/java/org/itxtech/daedalus/fragment/LogFragment.java
@@ -44,7 +44,7 @@ public class LogFragment extends ToolbarFragment implements Toolbar.OnMenuItemCl
private void export() {
try {
- String file = Daedalus.logPath + String.valueOf(System.currentTimeMillis()) + ".log";
+ String file = Daedalus.logPath + System.currentTimeMillis() + ".log";
FileWriter fileWriter = new FileWriter(file);
fileWriter.write(Logger.getLog());
fileWriter.close();
diff --git a/app/src/main/java/org/itxtech/daedalus/provider/TcpProvider.java b/app/src/main/java/org/itxtech/daedalus/provider/TcpProvider.java
index 3768ea5..183efc9 100644
--- a/app/src/main/java/org/itxtech/daedalus/provider/TcpProvider.java
+++ b/app/src/main/java/org/itxtech/daedalus/provider/TcpProvider.java
@@ -161,7 +161,7 @@ public class TcpProvider extends UdpProvider {
try {
DataInputStream stream = new DataInputStream(dnsSocket.getInputStream());
int length = stream.readUnsignedShort();
- Log.d(TAG, "Reading length: " + String.valueOf(length));
+ Log.d(TAG, "Reading length: " + length);
byte[] data = new byte[length];
stream.read(data);
dnsSocket.close();
diff --git a/app/src/main/java/org/itxtech/daedalus/util/RuleResolver.java b/app/src/main/java/org/itxtech/daedalus/util/RuleResolver.java
index d52806f..d6638a7 100644
--- a/app/src/main/java/org/itxtech/daedalus/util/RuleResolver.java
+++ b/app/src/main/java/org/itxtech/daedalus/util/RuleResolver.java
@@ -129,7 +129,7 @@ public class RuleResolver implements Runnable {
dataIO.close();
stream.close();
- Logger.info("Loaded " + String.valueOf(count) + " rules");
+ Logger.info("Loaded " + count + " rules");
}
}
} else if (mode == MODE_DNSMASQ) {
@@ -162,7 +162,7 @@ public class RuleResolver implements Runnable {
dataIO.close();
stream.close();
- Logger.info("Loaded " + String.valueOf(count) + " rules");
+ Logger.info("Loaded " + count + " rules");
}
}
}
diff --git a/app/src/main/java/org/itxtech/daedalus/util/server/DNSServer.java b/app/src/main/java/org/itxtech/daedalus/util/server/DNSServer.java
index e6e8be9..865d07b 100644
--- a/app/src/main/java/org/itxtech/daedalus/util/server/DNSServer.java
+++ b/app/src/main/java/org/itxtech/daedalus/util/server/DNSServer.java
@@ -19,7 +19,7 @@ public class DNSServer extends AbstractDNSServer {
private static int totalId = 0;
private String id;
- private int description = 0;
+ private int description;
public DNSServer(String address, int description, int port) {
super(address, port);
diff --git a/app/src/main/res/layout/fragment_main.xml b/app/src/main/res/layout/fragment_main.xml
index 9ada810..30b23a1 100644
--- a/app/src/main/res/layout/fragment_main.xml
+++ b/app/src/main/res/layout/fragment_main.xml
@@ -33,15 +33,6 @@
android:textAppearance="@android:style/TextAppearance.DeviceDefault"
android:fontFamily="sans-serif"
android:layout_centerHorizontal="true" android:id="@+id/textView_app_name"/>
-