From 8b079e8115a76efd2426eb0dc8d78875f213f8f1 Mon Sep 17 00:00:00 2001 From: yjj38 Date: Fri, 30 May 2025 12:24:32 +0800 Subject: [PATCH] Add configuration files and remove redundant code Added IntelliJ IDEA project configuration, lint baseline, and inspection profiles for consistency and static analysis. Removed redundant null-check for intent in `MainActivity` to simplify logic and improve readability. --- .idea/google-java-format.xml | 6 + .idea/inspectionProfiles/Project_Default.xml | 6 + .idea/misc.xml | 1 - .idea/vcs.xml | 6 + app/lint-baseline.xml | 179 ++++++++++++++++++ .../com/example/studyapp/MainActivity.java | 6 - 6 files changed, 197 insertions(+), 7 deletions(-) create mode 100644 .idea/google-java-format.xml create mode 100644 .idea/inspectionProfiles/Project_Default.xml create mode 100644 .idea/vcs.xml create mode 100644 app/lint-baseline.xml diff --git a/.idea/google-java-format.xml b/.idea/google-java-format.xml new file mode 100644 index 0000000..2aa056d --- /dev/null +++ b/.idea/google-java-format.xml @@ -0,0 +1,6 @@ + + + + + \ No newline at end of file diff --git a/.idea/inspectionProfiles/Project_Default.xml b/.idea/inspectionProfiles/Project_Default.xml new file mode 100644 index 0000000..cf247ce --- /dev/null +++ b/.idea/inspectionProfiles/Project_Default.xml @@ -0,0 +1,6 @@ + + + + \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml index cb150cf..8562ed5 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -1,4 +1,3 @@ - diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 0000000..94a25f7 --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/app/lint-baseline.xml b/app/lint-baseline.xml new file mode 100644 index 0000000..56f5523 --- /dev/null +++ b/app/lint-baseline.xml @@ -0,0 +1,179 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/app/src/main/java/com/example/studyapp/MainActivity.java b/app/src/main/java/com/example/studyapp/MainActivity.java index 5779511..32e5a2e 100644 --- a/app/src/main/java/com/example/studyapp/MainActivity.java +++ b/app/src/main/java/com/example/studyapp/MainActivity.java @@ -247,12 +247,6 @@ public class MainActivity extends AppCompatActivity { intent = new Intent(this, CustomVpnService.class); - if (intent == null) { - Log.e("handleVpnPermissionResult", "Intent is null. Cannot start service."); - showToastOnUiThread(this, "Failed to start VPN service due to null intent."); - return; - } - try { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { startForegroundService(intent);