Skip to content

Commit

Permalink
Fixed Executor and Lint and TV
Browse files Browse the repository at this point in the history
Create dependabot.yml

Bump actions/setup-java from 3 to 4

Bumps [actions/setup-java](https://github.com/actions/setup-java) from 3 to 4.
- [Release notes](https://github.com/actions/setup-java/releases)
- [Commits](actions/setup-java@v3...v4)

---
updated-dependencies:
- dependency-name: actions/setup-java
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <[email protected]>

Bump actions/checkout from 3 to 4

Bumps [actions/checkout](https://github.com/actions/checkout) from 3 to 4.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](actions/checkout@v3...v4)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <[email protected]>

Bump actions/setup-go from 4 to 5

Bumps [actions/setup-go](https://github.com/actions/setup-go) from 4 to 5.
- [Release notes](https://github.com/actions/setup-go/releases)
- [Commits](actions/setup-go@v4...v5)

---
updated-dependencies:
- dependency-name: actions/setup-go
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <[email protected]>
  • Loading branch information
DanielcoderX authored and markpash committed Jun 3, 2024
1 parent fecbdcf commit d2bd505
Show file tree
Hide file tree
Showing 19 changed files with 123 additions and 308 deletions.
2 changes: 1 addition & 1 deletion app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@
<activity
android:name="org.bepass.oblivion.SettingsActivity"
android:exported="false"
android:windowSoftInputMode="stateAlwaysHidden" />
android:windowSoftInputMode="adjustResize" />

<activity
android:name=".SplitTunnelActivity"
Expand Down
25 changes: 25 additions & 0 deletions app/src/main/java/org/bepass/oblivion/OblivionVpnService.java
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
import java.util.Map;
import java.util.Set;
import java.util.concurrent.Executor;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.TimeUnit;

Expand Down Expand Up @@ -285,6 +286,11 @@ private void clearLogFile() {
}

private void start() {
// If there's an existing running service, revoke it first
if (lastKnownState != ConnectionState.DISCONNECTED) {
onRevoke();
}

fileManager = FileManager.getInstance(this);

setLastKnownState(ConnectionState.CONNECTING);
Expand Down Expand Up @@ -367,6 +373,7 @@ public void onDestroy() {
public void onRevoke() {
setLastKnownState(ConnectionState.DISCONNECTED);
Log.i(TAG, "Stopping VPN");
// Stop foreground service and notification
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
NotificationManager notificationManager = getSystemService(NotificationManager.class);
if (notificationManager != null) {
Expand All @@ -379,11 +386,13 @@ public void onRevoke() {
e.printStackTrace();
}

// Release the wake lock if held
if (wLock != null && wLock.isHeld()) {
wLock.release();
wLock = null;
}

// Close the VPN interface
if (mInterface != null) {
try {
mInterface.close();
Expand All @@ -392,9 +401,25 @@ public void onRevoke() {
}
}

// Stop Tun2socks
Tun2socks.stop();

// Shutdown executor service
if (executorService instanceof ExecutorService) {
((ExecutorService) executorService).shutdownNow();
}

// Ensure all tasks are completed or terminated
try {
if (!((ExecutorService) executorService).awaitTermination(1, TimeUnit.SECONDS)) {
Log.e(TAG, "Executor service did not terminate in the specified time.");
}
} catch (InterruptedException e) {
Log.e(TAG, "Executor service termination interrupted.", e);
}
}


private void publishConnectionState(ConnectionState state) {
if (!connectionStateObservers.isEmpty()) {
for (String observerKey : connectionStateObservers.keySet())
Expand Down
3 changes: 2 additions & 1 deletion app/src/main/java/org/bepass/oblivion/PublicIPUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

import java.net.InetSocketAddress;
import java.net.Proxy;
import java.util.Locale;
import java.util.Objects;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
Expand Down Expand Up @@ -61,7 +62,7 @@ public void getIPDetails(IPDetailsCallback callback) {
}
details.ip = jsonData.getString("ip");
details.country = jsonData.getString("country");
details.flag = EmojiManager.getForAlias(jsonData.getString("country").toLowerCase()).getUnicode();
details.flag = EmojiManager.getForAlias(jsonData.getString("country").toLowerCase(Locale.ROOT)).getUnicode();
handler.post(() -> callback.onDetailsReceived(details));
return;
} catch (Exception e) {
Expand Down
Binary file removed app/src/main/res/drawable-hdpi/ic_ircf.png
Binary file not shown.
Binary file removed app/src/main/res/drawable-hdpi/ic_power.png
Binary file not shown.
Binary file removed app/src/main/res/drawable-hdpi/ic_twitter.png
Binary file not shown.
31 changes: 0 additions & 31 deletions app/src/main/res/drawable-v24/ic_launcher_foreground.xml

This file was deleted.

170 changes: 0 additions & 170 deletions app/src/main/res/drawable/ic_launcher_background.xml

This file was deleted.

19 changes: 0 additions & 19 deletions app/src/main/res/drawable/layout_border_bottom.xml

This file was deleted.

Binary file removed app/src/main/res/drawable/quote.png
Binary file not shown.
6 changes: 4 additions & 2 deletions app/src/main/res/layout/activity_info.xml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@
android:fontFamily="@font/shabnamlight"
android:text="@string/aboutApp"
android:textColor="@color/black"
android:textSize="32sp" />
android:textSize="32sp"
tools:ignore="RelativeOverlap" />

</RelativeLayout>

Expand All @@ -49,7 +50,8 @@
android:text='@string/aboutAppDesc'
android:textAlignment="center"
android:textColor="@color/black"
android:textSize="16sp" />
android:textSize="16sp"
tools:ignore="RtlCompat" />

<RelativeLayout
android:id="@+id/github_layout"
Expand Down
3 changes: 2 additions & 1 deletion app/src/main/res/layout/activity_log.xml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@
android:fontFamily="@font/shabnamlight"
android:text="@string/logApp"
android:textColor="@color/black"
android:textSize="32sp" />
android:textSize="32sp"
tools:ignore="RelativeOverlap" />

</RelativeLayout>

Expand Down
11 changes: 6 additions & 5 deletions app/src/main/res/layout/activity_settings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@
android:fontFamily="@font/shabnamlight"
android:text="@string/settingsText"
android:textColor="@color/black"
android:textSize="24sp" />
android:textSize="24sp"
tools:ignore="RelativeOverlap" />

</RelativeLayout>

Expand Down Expand Up @@ -240,7 +241,7 @@


<LinearLayout
android:layout_width="115dp"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="2">

Expand Down Expand Up @@ -305,7 +306,7 @@
android:gravity="end">

<LinearLayout
android:layout_width="wrap_content"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="2"
>
Expand Down Expand Up @@ -371,7 +372,7 @@

<Spinner
android:id="@+id/country"
android:layout_width="wrap_content"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1" />

Expand Down Expand Up @@ -486,7 +487,7 @@
android:layout_height="wrap_content">

<LinearLayout
android:layout_width="wrap_content"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="2"
>
Expand Down
Loading

0 comments on commit d2bd505

Please sign in to comment.