commit d2feefdddb69d6ea4285d1d6b12e44d7b845e06c Author: lexi dsnake@protonmail.com Date: Wed May 8 12:24:57 2019 -0400
Removed Obsolete @TaretApi Annotations for API Levels that are lower than Orbot's minimum, API Level 16 --- app/src/main/java/org/torproject/android/OrbotApp.java | 14 ++------------ .../java/org/torproject/android/settings/Languages.java | 1 - .../java/org/torproject/android/vpn/VPNEnableActivity.java | 10 +--------- .../java/org/torproject/android/service/TorService.java | 6 ------ .../torproject/android/service/vpn/OrbotVpnManager.java | 1 - .../org/torproject/android/service/vpn/TorVpnService.java | 14 +++----------- .../java/org/torproject/android/service/vpn/Tun2Socks.java | 3 --- 7 files changed, 6 insertions(+), 43 deletions(-)
diff --git a/app/src/main/java/org/torproject/android/OrbotApp.java b/app/src/main/java/org/torproject/android/OrbotApp.java index 7279c8e2..0aeb59ed 100644 --- a/app/src/main/java/org/torproject/android/OrbotApp.java +++ b/app/src/main/java/org/torproject/android/OrbotApp.java @@ -2,7 +2,6 @@ package org.torproject.android;
import android.annotation.SuppressLint; -import android.annotation.TargetApi; import android.app.Activity; import android.app.Application; import android.app.Notification; @@ -12,30 +11,22 @@ import android.content.Context; import android.content.Intent; import android.content.pm.PackageManager; import android.content.res.Configuration; -import android.net.VpnService; -import android.os.Build; import android.support.v4.app.NotificationCompat; -import android.util.Log; -import android.widget.RemoteViews;
import com.github.javiersantos.appupdater.AppUpdater; import com.github.javiersantos.appupdater.enums.Display; import com.github.javiersantos.appupdater.enums.UpdateFrom;
import org.torproject.android.service.OrbotConstants; -import org.torproject.android.service.TorEventHandler; -import org.torproject.android.service.TorService; import org.torproject.android.service.util.Prefs;
import org.torproject.android.settings.Languages; import org.torproject.android.settings.LocaleHelper;
import java.util.Locale; -import java.util.Set;
-public class OrbotApp extends Application implements OrbotConstants -{ +public class OrbotApp extends Application implements OrbotConstants {
private Locale locale;
@@ -118,6 +109,5 @@ public class OrbotApp extends Application implements OrbotConstants Notification notification = notifyBuilder.build();
notificationManager.notify(notifyId, notification); - } - + } } diff --git a/app/src/main/java/org/torproject/android/settings/Languages.java b/app/src/main/java/org/torproject/android/settings/Languages.java index b7425996..58566f12 100644 --- a/app/src/main/java/org/torproject/android/settings/Languages.java +++ b/app/src/main/java/org/torproject/android/settings/Languages.java @@ -139,7 +139,6 @@ public class Languages { return singleton; }
- //@TargetApi(Build.VERSION_CODES.JELLY_BEAN_MR1) @SuppressLint("NewApi") public static void setLanguage(final ContextWrapper contextWrapper, String language, boolean refresh) { if (locale != null && TextUtils.equals(locale.getLanguage(), language) && (!refresh)) { diff --git a/app/src/main/java/org/torproject/android/vpn/VPNEnableActivity.java b/app/src/main/java/org/torproject/android/vpn/VPNEnableActivity.java index 551f2e62..e883913f 100644 --- a/app/src/main/java/org/torproject/android/vpn/VPNEnableActivity.java +++ b/app/src/main/java/org/torproject/android/vpn/VPNEnableActivity.java @@ -1,15 +1,9 @@ package org.torproject.android.vpn;
-import org.torproject.android.R; import org.torproject.android.service.util.Prefs; import org.torproject.android.service.TorService; import org.torproject.android.service.TorServiceConstants;
-import android.annotation.TargetApi; -import android.app.Activity; -import android.app.AlertDialog; -import android.app.Dialog; -import android.content.DialogInterface; import android.content.Intent; import android.net.VpnService; import android.os.Build; @@ -19,11 +13,9 @@ import android.support.v7.app.AppCompatActivity; import android.util.Log; import android.view.Window;
-/* +/** * To combat background service being stopped/swiped */ - -@TargetApi(14) public class VPNEnableActivity extends AppCompatActivity { private final static int REQUEST_VPN = 7777; diff --git a/orbotservice/src/main/java/org/torproject/android/service/TorService.java b/orbotservice/src/main/java/org/torproject/android/service/TorService.java index 7f2b37cc..66889b5f 100644 --- a/orbotservice/src/main/java/org/torproject/android/service/TorService.java +++ b/orbotservice/src/main/java/org/torproject/android/service/TorService.java @@ -9,8 +9,6 @@ package org.torproject.android.service;
import android.annotation.SuppressLint; -import android.annotation.TargetApi; -import android.app.Application; import android.app.Notification; import android.app.NotificationChannel; import android.app.NotificationManager; @@ -40,9 +38,7 @@ import android.text.TextUtils; import android.util.Log;
import com.jaredrummler.android.shell.CommandResult; -import com.jaredrummler.android.shell.Shell;
-import org.torproject.android.binary.TorResourceInstaller; import org.torproject.android.control.ConfigEntry; import org.torproject.android.control.TorControlConnection; import org.torproject.android.service.util.CustomShell; @@ -61,7 +57,6 @@ import java.io.DataInputStream; import java.io.File; import java.io.FileInputStream; import java.io.FileNotFoundException; -import java.io.FileOutputStream; import java.io.FileReader; import java.io.FileWriter; import java.io.IOException; @@ -1911,7 +1906,6 @@ public class TorService extends Service implements TorServiceConstants, OrbotCon }
- @TargetApi(14) public void clearVpnProxy () { debug ("clearing VPN Proxy"); diff --git a/orbotservice/src/main/java/org/torproject/android/service/vpn/OrbotVpnManager.java b/orbotservice/src/main/java/org/torproject/android/service/vpn/OrbotVpnManager.java index 5ca4505c..90a13336 100644 --- a/orbotservice/src/main/java/org/torproject/android/service/vpn/OrbotVpnManager.java +++ b/orbotservice/src/main/java/org/torproject/android/service/vpn/OrbotVpnManager.java @@ -52,7 +52,6 @@ import java.net.InetAddress; import java.util.ArrayList; import java.util.concurrent.TimeoutException;
-@TargetApi(Build.VERSION_CODES.ICE_CREAM_SANDWICH) public class OrbotVpnManager implements Handler.Callback { private static final String TAG = "OrbotVpnService";
diff --git a/orbotservice/src/main/java/org/torproject/android/service/vpn/TorVpnService.java b/orbotservice/src/main/java/org/torproject/android/service/vpn/TorVpnService.java index 7d18ffd8..34d89b49 100644 --- a/orbotservice/src/main/java/org/torproject/android/service/vpn/TorVpnService.java +++ b/orbotservice/src/main/java/org/torproject/android/service/vpn/TorVpnService.java @@ -1,36 +1,28 @@ package org.torproject.android.service.vpn;
-import android.annotation.TargetApi; import android.app.Service; import android.content.Intent; import android.net.VpnService; -import android.os.Build;
/** * Created by n8fr8 on 9/26/16. */ -@TargetApi(Build.VERSION_CODES.ICE_CREAM_SANDWICH) public class TorVpnService extends VpnService { - - OrbotVpnManager mVpnManager;
- @Override public void onCreate() { super.onCreate(); - mVpnManager = new OrbotVpnManager(this); }
/* (non-Javadoc) - * @see android.app.Service#onStart(android.content.Intent, int) - */ + * @see android.app.Service#onStart(android.content.Intent, int) + */ public int onStartCommand(Intent intent, int flags, int startId) {
- mVpnManager.handleIntent(new Builder(),intent); + mVpnManager.handleIntent(new Builder(), intent);
return Service.START_STICKY; } - } diff --git a/orbotservice/src/main/java/org/torproject/android/service/vpn/Tun2Socks.java b/orbotservice/src/main/java/org/torproject/android/service/vpn/Tun2Socks.java index ff1ac949..958fb9ad 100644 --- a/orbotservice/src/main/java/org/torproject/android/service/vpn/Tun2Socks.java +++ b/orbotservice/src/main/java/org/torproject/android/service/vpn/Tun2Socks.java @@ -19,15 +19,12 @@ package org.torproject.android.service.vpn; * */
-import android.annotation.TargetApi; -import android.os.Build; import android.os.ParcelFileDescriptor; import android.util.Log;
import java.net.DatagramSocket; import java.net.Socket;
-@TargetApi(Build.VERSION_CODES.HONEYCOMB_MR1) public class Tun2Socks {
tor-commits@lists.torproject.org