diff --git a/app/src/fullLinks/AndroidManifest.xml b/app/src/fullLinks/AndroidManifest.xml
index 7d5d620..d3bdac6 100644
--- a/app/src/fullLinks/AndroidManifest.xml
+++ b/app/src/fullLinks/AndroidManifest.xml
@@ -63,13 +63,13 @@
+
-
@@ -84,7 +84,6 @@
-
@@ -92,6 +91,11 @@
+
+
+
+
+
@@ -118,6 +122,9 @@
+
+
+
@@ -160,6 +167,7 @@
+
@@ -197,6 +205,11 @@
+
+
+
+
+
diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml
index a3b5acc..71fd700 100644
--- a/app/src/main/AndroidManifest.xml
+++ b/app/src/main/AndroidManifest.xml
@@ -59,6 +59,7 @@
+
@@ -80,7 +81,6 @@
-
@@ -88,6 +88,11 @@
+
+
+
+
+
@@ -127,6 +132,7 @@
+
@@ -146,7 +152,6 @@
-
@@ -154,6 +159,11 @@
+
+
+
+
+
diff --git a/app/src/main/assets/rules.json b/app/src/main/assets/rules.json
index 7cbe6ef..7120eae 100644
--- a/app/src/main/assets/rules.json
+++ b/app/src/main/assets/rules.json
@@ -239,6 +239,22 @@
"exceptions": [],
"redirections": []
},
+ "tiktok": {
+ "urlPattern": "(https:\\/\\/|http:\\/\\/)([a-zA-Z0-9-]*\\.)?(tiktok)(\\.[a-zA-Z]{2,})(.*\\?.*)",
+ "completeProvider": false,
+ "rules": [
+ "_[a-z]=[^\\/|\\?|&]*(\\/|&(amp;)?)?",
+ "(sec_)?(u|user_)id=[^\\/|\\?|&]*(\\/|&(amp;)?)?",
+ "share_[a-z_]+=[^\\/|\\?|&]*(\\/|&(amp;)?)?",
+ "source=[^\\/|\\?|&]*(\\/|&(amp;)?)?",
+ "timestamp=[^\\/|\\?|&]*(\\/|&(amp;)?)?",
+ "u_code=[^\\/|\\?|&]*(\\/|&(amp;)?)?",
+ "ugbiz_name=[^\\/|\\?|&]*(\\/|&(amp;)?)?",
+ "utm_[a-z_]+=[^\\/|\\?|&]*(\\/|&(amp;)?)?"
+ ],
+ "exceptions": [],
+ "redirections": []
+ },
"techcrunch": {
"urlPattern": "(https:\\/\\/|http:\\/\\/)([a-zA-Z0-9-]*\\.)?([\\.]?techcrunch\\.com)(.*\\?.*)",
"completeProvider": false,
diff --git a/app/src/main/java/app/fedilab/nitterizeme/activities/CheckAppActivity.java b/app/src/main/java/app/fedilab/nitterizeme/activities/CheckAppActivity.java
index 1048230..6f4129b 100644
--- a/app/src/main/java/app/fedilab/nitterizeme/activities/CheckAppActivity.java
+++ b/app/src/main/java/app/fedilab/nitterizeme/activities/CheckAppActivity.java
@@ -80,6 +80,12 @@ public class CheckAppActivity extends AppCompatActivity {
"www.wikipedia.org"
};
+ public static String[] tiktok_domains = {
+ "tiktok.com",
+ "www.tiktok.com",
+ "us.tiktok.com"
+ };
+
public static String[] shortener_domains = {
"t.co",
"nyti.ms",
@@ -98,7 +104,8 @@ public class CheckAppActivity extends AppCompatActivity {
"ow.ly",
"bl.ink",
"buff.ly",
- "maps.app.goo.gl"
+ "maps.app.goo.gl",
+ "vm.tiktok.com"
};
//Supported instances to redirect one instance to another faster for the user
public static String[] invidious_instances = {
@@ -127,6 +134,10 @@ public class CheckAppActivity extends AppCompatActivity {
"bibliogram.dsrev.ru",
"bibliogram.pussthecat.org"
};
+ public static String[] proxitok_instances = {
+ "proxitok.herokuapp.com",
+ "proxitok.pussthecat.org"
+ };
public static String outlook_safe_domain = "safelinks.protection.outlook.com";
@@ -153,23 +164,26 @@ public class CheckAppActivity extends AppCompatActivity {
twitter_domains.length
+ youtube_domains.length
+ reddit_domains.length
- + shortener_domains.length
+ instagram_domains.length
+ + wikipedia_domains.length
+ + medium_domains.length
+ + tiktok_domains.length
+ + shortener_domains.length
+ invidious_instances.length
+ nitter_instances.length
+ bibliogram_instances.length
- + wikipedia_domains.length
- + medium_domains.length
+ + proxitok_instances.length
];
} else {
domains = new String[
twitter_domains.length
+ youtube_domains.length
+ reddit_domains.length
- + shortener_domains.length
+ instagram_domains.length
+ wikipedia_domains.length
- + medium_domains.length];
+ + medium_domains.length
+ + tiktok_domains.length
+ + shortener_domains.length];
}
int i = 0;
for (String host : twitter_domains) {
@@ -196,6 +210,10 @@ public class CheckAppActivity extends AppCompatActivity {
domains[i] = host;
i++;
}
+ for (String host : tiktok_domains) {
+ domains[i] = host;
+ i++;
+ }
for (String host : shortener_domains) {
domains[i] = host;
i++;
@@ -213,6 +231,10 @@ public class CheckAppActivity extends AppCompatActivity {
domains[i] = host;
i++;
}
+ for (String host : proxitok_instances) {
+ domains[i] = host;
+ i++;
+ }
}
final LinearLayoutManager mLayoutManager;
@@ -291,6 +313,10 @@ public class CheckAppActivity extends AppCompatActivity {
AppInfo appInfo = new AppInfo();
appInfo.setTitle("Wikipedia");
appInfos.add(appInfo);
+ } else if (Arrays.asList(tiktok_domains).contains(domain)) {
+ AppInfo appInfo = new AppInfo();
+ appInfo.setTitle("TikTok");
+ appInfos.add(appInfo);
} else if (Arrays.asList(shortener_domains).contains(domain)) {
AppInfo appInfo = new AppInfo();
appInfo.setTitle(getString(R.string.shortener_services));
@@ -307,6 +333,10 @@ public class CheckAppActivity extends AppCompatActivity {
AppInfo appInfo = new AppInfo();
appInfo.setTitle(getString(R.string.bibliogram_instances));
appInfos.add(appInfo);
+ } else if (Arrays.asList(proxitok_instances).contains(domain)) {
+ AppInfo appInfo = new AppInfo();
+ appInfo.setTitle(getString(R.string.proxitok_instances));
+ appInfos.add(appInfo);
}
AppInfo appInfo = new AppInfo();
appInfo.setDomain(domain);
diff --git a/app/src/main/java/app/fedilab/nitterizeme/activities/InstanceActivity.java b/app/src/main/java/app/fedilab/nitterizeme/activities/InstanceActivity.java
index 56f3827..5d41947 100644
--- a/app/src/main/java/app/fedilab/nitterizeme/activities/InstanceActivity.java
+++ b/app/src/main/java/app/fedilab/nitterizeme/activities/InstanceActivity.java
@@ -67,6 +67,7 @@ public class InstanceActivity extends AppCompatActivity {
String tedditHost = sharedpreferences.getString(MainActivity.SET_TEDDIT_HOST, MainActivity.DEFAULT_TEDDIT_HOST);
String scribeHost = sharedpreferences.getString(MainActivity.SET_SCRIBERIP_HOST, MainActivity.DEFAULT_SCRIBERIP_HOST);
String wikilessHost = sharedpreferences.getString(MainActivity.SET_WIKILESS_HOST, MainActivity.DEFAULT_WIKILESS_HOST);
+ String proxitokHost = sharedpreferences.getString(MainActivity.SET_PROXITOK_HOST, MainActivity.DEFAULT_PROXITOK_HOST);
ArrayList invidiousInstances = new ArrayList<>();
ArrayList nitterInstances = new ArrayList<>();
@@ -74,6 +75,7 @@ public class InstanceActivity extends AppCompatActivity {
ArrayList tedditInstances = new ArrayList<>();
ArrayList scribeInstances = new ArrayList<>();
ArrayList wikilessInstances = new ArrayList<>();
+ ArrayList proxitokInstances = new ArrayList<>();
boolean customInvidiousInstance = true;
boolean customNitterInstance = true;
@@ -81,6 +83,7 @@ public class InstanceActivity extends AppCompatActivity {
boolean customTedditInstance = true;
boolean customScribeInstance = true;
boolean customWikilessInstance = true;
+ boolean customProxitokInstance = true;
for (Instance instance : result) {
if (instance.getInstanceType() == Instance.instanceType.YOUTUBE) {
@@ -113,6 +116,11 @@ public class InstanceActivity extends AppCompatActivity {
if (wikilessHost != null && wikilessHost.trim().toLowerCase().compareTo(instance.getDomain()) == 0) {
customWikilessInstance = false;
}
+ } else if (instance.getInstanceType() == Instance.instanceType.PROXITOK) {
+ proxitokInstances.add(instance);
+ if (proxitokHost != null && proxitokHost.trim().toLowerCase().compareTo(instance.getDomain()) == 0) {
+ customProxitokInstance = false;
+ }
}
}
List defaultLocales = new ArrayList<>();
@@ -160,6 +168,13 @@ public class InstanceActivity extends AppCompatActivity {
instance.setLocales(defaultLocales);
wikilessInstances.add(0, instance);
}
+ if (customProxitokInstance) {
+ Instance instance = new Instance();
+ instance.setChecked(true);
+ instance.setDomain(proxitokHost);
+ instance.setLocales(defaultLocales);
+ proxitokInstances.add(0, instance);
+ }
binding.instanceContainer.setVisibility(View.VISIBLE);
binding.loader.setVisibility(View.GONE);
@@ -202,11 +217,20 @@ public class InstanceActivity extends AppCompatActivity {
binding.wikilessInstances.setLayoutManager(wLayoutManager);
binding.wikilessInstances.setNestedScrollingEnabled(false);
+ final LinearLayoutManager pLayoutManager = new LinearLayoutManager(this);
+ InstanceAdapter proxitokAdapter = new InstanceAdapter(proxitokInstances);
+ binding.proxitokInstances.setAdapter(proxitokAdapter);
+ binding.proxitokInstances.setLayoutManager(pLayoutManager);
+ binding.proxitokInstances.setNestedScrollingEnabled(false);
+
binding.latencyTest.setOnClickListener(v -> {
invidiousAdapter.evalLatency();
nitterAdapter.evalLatency();
bibliogramAdapter.evalLatency();
tedditAdapter.evalLatency();
+ scribeAdapter.evalLatency();
+ wikilessAdapter.evalLatency();
+ proxitokAdapter.evalLatency();
}
);
diff --git a/app/src/main/java/app/fedilab/nitterizeme/activities/MainActivity.java b/app/src/main/java/app/fedilab/nitterizeme/activities/MainActivity.java
index 19eb58d..e10de34 100644
--- a/app/src/main/java/app/fedilab/nitterizeme/activities/MainActivity.java
+++ b/app/src/main/java/app/fedilab/nitterizeme/activities/MainActivity.java
@@ -14,6 +14,8 @@ package app.fedilab.nitterizeme.activities;
* You should have received a copy of the GNU General Public License along with UntrackMe; if not,
* see . */
+import static app.fedilab.nitterizeme.helpers.Utils.KILL_ACTIVITY;
+
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
@@ -40,8 +42,6 @@ import app.fedilab.nitterizeme.R;
import app.fedilab.nitterizeme.databinding.ActivityMainBinding;
import app.fedilab.nitterizeme.databinding.ContentMainBinding;
-import static app.fedilab.nitterizeme.helpers.Utils.KILL_ACTIVITY;
-
public class MainActivity extends AppCompatActivity {
public static final String APP_PREFS = "app_prefs";
@@ -52,6 +52,7 @@ public class MainActivity extends AppCompatActivity {
public static final String SET_BIBLIOGRAM_HOST = "set_bibliogram_host";
public static final String SET_SCRIBERIP_HOST = "set_scriberip_host";
public static final String SET_WIKILESS_HOST = "set_wikiless_host";
+ public static final String SET_PROXITOK_HOST = "set_proxitok_host";
@SuppressWarnings({"unused", "RedundantSuppression"})
public static String TAG = "UntrackMe";
public static String DEFAULT_NITTER_HOST = "nitter.net";
@@ -62,12 +63,14 @@ public class MainActivity extends AppCompatActivity {
public static String SET_SCRIBERIP_ENABLED = "set_scriberip_enabled";
public static String SET_WIKILESS_ENABLED = "set_wikiless_enabled";
public static String SET_OSM_ENABLED = "set_osm_enabled";
+ public static String SET_PROXITOK_ENABLED = "set_osm_enabled";
public static String DEFAULT_OSM_HOST = "www.openstreetmap.org";
public static String SET_BIBLIOGRAM_ENABLED = "set_bibliogram_enabled";
public static String DEFAULT_BIBLIOGRAM_HOST = "bibliogram.art";
public static String DEFAULT_SCRIBERIP_HOST = "scribe.rip";
public static String DEFAULT_WIKILESS_HOST = "wikiless.org";
public static String DEFAULT_TEDDIT_HOST = "teddit.net";
+ public static String DEFAULT_PROXITOK_HOST = "proxitok.herokuapp.com";
public static String SET_GEO_URIS = "set_geo_uris";
public static String SET_EMBEDDED_PLAYER = "set_embedded_player";
BroadcastReceiver broadcastReceiver = new BroadcastReceiver() {
@@ -88,6 +91,7 @@ public class MainActivity extends AppCompatActivity {
private String scriberipHost;
private String wikilessHost;
private String osmHost;
+ private String proxitokHost;
private ContentMainBinding binding;
@Override
@@ -111,6 +115,7 @@ public class MainActivity extends AppCompatActivity {
boolean teddit_enabled = sharedpreferences.getBoolean(SET_TEDDIT_ENABLED, true);
boolean scriberip_enabled = sharedpreferences.getBoolean(SET_SCRIBERIP_ENABLED, true);
boolean wikiless_enabled = sharedpreferences.getBoolean(SET_WIKILESS_ENABLED, true);
+ boolean proxitok_enabled = sharedpreferences.getBoolean(SET_PROXITOK_ENABLED, true);
boolean geouri_enabled = sharedpreferences.getBoolean(SET_GEO_URIS, false);
boolean embedded_player = sharedpreferences.getBoolean(SET_EMBEDDED_PLAYER, false);
@@ -121,6 +126,7 @@ public class MainActivity extends AppCompatActivity {
binding.enableScriberip.setChecked(scriberip_enabled);
binding.enableWikiless.setChecked(wikiless_enabled);
binding.enableOsm.setChecked(osm_enabled);
+ binding.enableProxitok.setChecked(proxitok_enabled);
@@ -131,6 +137,7 @@ public class MainActivity extends AppCompatActivity {
scriberipHost = sharedpreferences.getString(SET_SCRIBERIP_HOST, null);
wikilessHost = sharedpreferences.getString(SET_WIKILESS_HOST, null);
osmHost = sharedpreferences.getString(SET_OSM_HOST, null);
+ proxitokHost = sharedpreferences.getString(SET_PROXITOK_HOST, null);
binding.groupCurrentInvidious.setVisibility(invidious_enabled ? View.VISIBLE : View.GONE);
binding.groupCurrentNitter.setVisibility(nitter_enabled ? View.VISIBLE : View.GONE);
@@ -139,6 +146,7 @@ public class MainActivity extends AppCompatActivity {
binding.groupCurrentScriberip.setVisibility(scriberip_enabled ? View.VISIBLE : View.GONE);
binding.groupCurrentWikiless.setVisibility(wikiless_enabled ? View.VISIBLE : View.GONE);
binding.groupCurrentOsm.setVisibility((osm_enabled && geouri_enabled) ? View.VISIBLE : View.GONE);
+ binding.groupCurrentProxitok.setVisibility(proxitok_enabled ? View.VISIBLE : View.GONE);
binding.enableGeoUris.setVisibility(osm_enabled ? View.VISIBLE : View.GONE);
binding.enableEmbedPlayer.setVisibility(invidious_enabled ? View.VISIBLE : View.GONE);
@@ -210,6 +218,14 @@ public class MainActivity extends AppCompatActivity {
binding.groupCurrentOsm.setVisibility(View.GONE);
}
});
+ binding.enableProxitok.setOnCheckedChangeListener((buttonView, isChecked) -> {
+ SharedPreferences.Editor editor = sharedpreferences.edit();
+ editor.putBoolean(SET_PROXITOK_ENABLED, isChecked);
+ editor.apply();
+ binding.groupCurrentProxitok.setVisibility(isChecked ? View.VISIBLE : View.GONE);
+ binding.groupCustomProxitok.setVisibility(View.GONE);
+ binding.buttonExpandInstanceProxitok.setRotation(0);
+ });
binding.buttonExpandInstanceNitter.setOnClickListener(v -> {
@@ -323,6 +339,22 @@ public class MainActivity extends AppCompatActivity {
binding.osmInstance.setText("");
}
});
+ binding.buttonExpandInstanceProxitok.setOnClickListener(v -> {
+ boolean custom_instance_visibility = binding.groupCustomProxitok.getVisibility() == View.VISIBLE;
+ if (custom_instance_visibility) {
+ binding.buttonExpandInstanceProxitok.setRotation(0f);
+ binding.groupCustomProxitok.setVisibility(View.GONE);
+ } else {
+ binding.buttonExpandInstanceProxitok.setRotation(180f);
+ binding.groupCustomProxitok.setVisibility(View.VISIBLE);
+ }
+
+ if (proxitokHost != null) {
+ binding.proxitokInstance.setText(proxitokHost);
+ } else {
+ binding.proxitokInstance.setText("");
+ }
+ });
if (nitterHost != null) {
@@ -376,6 +408,12 @@ public class MainActivity extends AppCompatActivity {
} else {
binding.groupCustomOsm.setVisibility(View.GONE);
}
+ if (proxitokHost != null) {
+ binding.proxitokInstance.setText(proxitokHost);
+ binding.currentInstanceProxitok.setText(proxitokHost);
+ } else {
+ binding.currentInstanceProxitok.setText(DEFAULT_PROXITOK_HOST);
+ }
binding.enableEmbedPlayer.setChecked(embedded_player);
binding.buttonSaveInstanceNitter.setOnClickListener(v -> {
@@ -461,6 +499,18 @@ public class MainActivity extends AppCompatActivity {
}
editor.apply();
});
+ binding.buttonSaveInstanceProxitok.setOnClickListener(v -> {
+ SharedPreferences.Editor editor = sharedpreferences.edit();
+ if (binding.proxitokInstance.getText() != null && binding.proxitokInstance.getText().toString().trim().length() > 0) {
+ String custom_instance = binding.proxitokInstance.getText().toString().toLowerCase().trim();
+ editor.putString(SET_PROXITOK_HOST, custom_instance);
+ binding.currentInstanceProxitok.setText(custom_instance);
+ } else {
+ editor.putString(SET_PROXITOK_HOST, null);
+ binding.currentInstanceProxitok.setText(DEFAULT_PROXITOK_HOST);
+ }
+ editor.apply();
+ });
binding.configure.setOnClickListener(v -> {
Intent intent = new Intent(Settings.ACTION_APPLICATION_DETAILS_SETTINGS);
@@ -566,9 +616,18 @@ public class MainActivity extends AppCompatActivity {
binding.currentInstanceOsm.setText(DEFAULT_OSM_HOST);
binding.buttonExpandInstanceOsm.setRotation(0f);
break;
+ case SET_PROXITOK_HOST:
+ proxitokHost = sharedpreferences.getString(SET_PROXITOK_HOST, null);
+ binding.groupCustomProxitok.setVisibility(View.GONE);
+ if (proxitokHost != null && proxitokHost.trim().length() > 0)
+ binding.currentInstanceProxitok.setText(proxitokHost);
+ else
+ binding.currentInstanceProxitok.setText(DEFAULT_PROXITOK_HOST);
+ binding.buttonExpandInstanceProxitok.setRotation(0f);
+ break;
}
- if (key.equals(SET_NITTER_HOST) || key.equals(SET_INVIDIOUS_HOST) || key.equals(SET_BIBLIOGRAM_HOST) || key.equals(SET_TEDDIT_HOST) || key.equals(SET_OSM_HOST)) {
+ if (key.equals(SET_NITTER_HOST) || key.equals(SET_INVIDIOUS_HOST) || key.equals(SET_BIBLIOGRAM_HOST) || key.equals(SET_TEDDIT_HOST) || key.equals(SET_OSM_HOST) || key.equals(SET_PROXITOK_HOST)) {
View parentLayout = findViewById(android.R.id.content);
Snackbar.make(parentLayout, R.string.instances_saved, Snackbar.LENGTH_LONG).show();
}
@@ -632,6 +691,7 @@ public class MainActivity extends AppCompatActivity {
String tedditHost = sharedpreferences.getString(SET_TEDDIT_HOST, null);
String scriberipHost = sharedpreferences.getString(SET_SCRIBERIP_HOST, null);
String wikilessHost = sharedpreferences.getString(SET_WIKILESS_HOST, null);
+ String proxitokHost = sharedpreferences.getString(SET_PROXITOK_HOST, null);
if (nitterHost != null) {
binding.nitterInstance.setText(nitterHost);
binding.currentInstanceNitter.setText(nitterHost);
@@ -656,6 +716,10 @@ public class MainActivity extends AppCompatActivity {
binding.wikilessInstance.setText(wikilessHost);
binding.currentInstanceWikiless.setText(wikilessHost);
}
+ if (proxitokHost != null) {
+ binding.proxitokInstance.setText(proxitokHost);
+ binding.currentInstanceProxitok.setText(proxitokHost);
+ }
if (BuildConfig.fullLinks) {
List resolveInfos = getPackageManager().queryIntentActivities(new Intent(Intent.ACTION_VIEW, Uri.parse("https://fedilab.app")), PackageManager.MATCH_DEFAULT_ONLY);
String thisPackageName = getApplicationContext().getPackageName();
diff --git a/app/src/main/java/app/fedilab/nitterizeme/adapters/InstanceAdapter.java b/app/src/main/java/app/fedilab/nitterizeme/adapters/InstanceAdapter.java
index aee585a..d78caa3 100644
--- a/app/src/main/java/app/fedilab/nitterizeme/adapters/InstanceAdapter.java
+++ b/app/src/main/java/app/fedilab/nitterizeme/adapters/InstanceAdapter.java
@@ -14,6 +14,15 @@ package app.fedilab.nitterizeme.adapters;
* You should have received a copy of the GNU General Public License along with UntrackMe; if not,
* see . */
+import static app.fedilab.nitterizeme.activities.MainActivity.APP_PREFS;
+import static app.fedilab.nitterizeme.activities.MainActivity.SET_BIBLIOGRAM_HOST;
+import static app.fedilab.nitterizeme.activities.MainActivity.SET_INVIDIOUS_HOST;
+import static app.fedilab.nitterizeme.activities.MainActivity.SET_NITTER_HOST;
+import static app.fedilab.nitterizeme.activities.MainActivity.SET_PROXITOK_HOST;
+import static app.fedilab.nitterizeme.activities.MainActivity.SET_SCRIBERIP_HOST;
+import static app.fedilab.nitterizeme.activities.MainActivity.SET_TEDDIT_HOST;
+import static app.fedilab.nitterizeme.activities.MainActivity.SET_WIKILESS_HOST;
+
import android.annotation.SuppressLint;
import android.content.Context;
import android.content.SharedPreferences;
@@ -35,14 +44,6 @@ import app.fedilab.nitterizeme.databinding.DrawerInstanceBinding;
import app.fedilab.nitterizeme.entities.Instance;
import app.fedilab.nitterizeme.helpers.Utils;
-import static app.fedilab.nitterizeme.activities.MainActivity.APP_PREFS;
-import static app.fedilab.nitterizeme.activities.MainActivity.SET_BIBLIOGRAM_HOST;
-import static app.fedilab.nitterizeme.activities.MainActivity.SET_INVIDIOUS_HOST;
-import static app.fedilab.nitterizeme.activities.MainActivity.SET_NITTER_HOST;
-import static app.fedilab.nitterizeme.activities.MainActivity.SET_SCRIBERIP_HOST;
-import static app.fedilab.nitterizeme.activities.MainActivity.SET_TEDDIT_HOST;
-import static app.fedilab.nitterizeme.activities.MainActivity.SET_WIKILESS_HOST;
-
public class InstanceAdapter extends RecyclerView.Adapter {
@@ -165,6 +166,14 @@ public class InstanceAdapter extends RecyclerView.Adapter. */
+import static android.content.Context.DOWNLOAD_SERVICE;
+import static app.fedilab.nitterizeme.activities.CheckAppActivity.bibliogram_instances;
+import static app.fedilab.nitterizeme.activities.CheckAppActivity.instagram_domains;
+import static app.fedilab.nitterizeme.activities.CheckAppActivity.invidious_instances;
+import static app.fedilab.nitterizeme.activities.CheckAppActivity.medium_domains;
+import static app.fedilab.nitterizeme.activities.CheckAppActivity.nitter_instances;
+import static app.fedilab.nitterizeme.activities.CheckAppActivity.outlook_safe_domain;
+import static app.fedilab.nitterizeme.activities.CheckAppActivity.reddit_domains;
+import static app.fedilab.nitterizeme.activities.CheckAppActivity.shortener_domains;
+import static app.fedilab.nitterizeme.activities.CheckAppActivity.tiktok_domains;
+import static app.fedilab.nitterizeme.activities.CheckAppActivity.twitter_domains;
+import static app.fedilab.nitterizeme.activities.CheckAppActivity.wikipedia_domains;
+import static app.fedilab.nitterizeme.activities.CheckAppActivity.youtube_domains;
+import static app.fedilab.nitterizeme.activities.MainActivity.SET_BIBLIOGRAM_ENABLED;
+import static app.fedilab.nitterizeme.activities.MainActivity.SET_EMBEDDED_PLAYER;
+import static app.fedilab.nitterizeme.activities.MainActivity.SET_INVIDIOUS_ENABLED;
+import static app.fedilab.nitterizeme.activities.MainActivity.SET_NITTER_ENABLED;
+import static app.fedilab.nitterizeme.activities.MainActivity.SET_PROXITOK_ENABLED;
+import static app.fedilab.nitterizeme.activities.MainActivity.SET_SCRIBERIP_ENABLED;
+import static app.fedilab.nitterizeme.activities.MainActivity.SET_TEDDIT_ENABLED;
+import static app.fedilab.nitterizeme.activities.MainActivity.SET_TEDDIT_HOST;
+import static app.fedilab.nitterizeme.activities.MainActivity.SET_WIKILESS_ENABLED;
+
import android.app.Activity;
import android.app.DownloadManager;
import android.content.ComponentName;
@@ -78,27 +101,6 @@ import app.fedilab.nitterizeme.activities.AppsPickerActivity;
import app.fedilab.nitterizeme.activities.MainActivity;
import app.fedilab.nitterizeme.activities.WebviewPlayerActivity;
-import static android.content.Context.DOWNLOAD_SERVICE;
-import static app.fedilab.nitterizeme.activities.CheckAppActivity.bibliogram_instances;
-import static app.fedilab.nitterizeme.activities.CheckAppActivity.instagram_domains;
-import static app.fedilab.nitterizeme.activities.CheckAppActivity.invidious_instances;
-import static app.fedilab.nitterizeme.activities.CheckAppActivity.medium_domains;
-import static app.fedilab.nitterizeme.activities.CheckAppActivity.nitter_instances;
-import static app.fedilab.nitterizeme.activities.CheckAppActivity.outlook_safe_domain;
-import static app.fedilab.nitterizeme.activities.CheckAppActivity.reddit_domains;
-import static app.fedilab.nitterizeme.activities.CheckAppActivity.shortener_domains;
-import static app.fedilab.nitterizeme.activities.CheckAppActivity.twitter_domains;
-import static app.fedilab.nitterizeme.activities.CheckAppActivity.wikipedia_domains;
-import static app.fedilab.nitterizeme.activities.CheckAppActivity.youtube_domains;
-import static app.fedilab.nitterizeme.activities.MainActivity.SET_BIBLIOGRAM_ENABLED;
-import static app.fedilab.nitterizeme.activities.MainActivity.SET_EMBEDDED_PLAYER;
-import static app.fedilab.nitterizeme.activities.MainActivity.SET_INVIDIOUS_ENABLED;
-import static app.fedilab.nitterizeme.activities.MainActivity.SET_NITTER_ENABLED;
-import static app.fedilab.nitterizeme.activities.MainActivity.SET_SCRIBERIP_ENABLED;
-import static app.fedilab.nitterizeme.activities.MainActivity.SET_TEDDIT_ENABLED;
-import static app.fedilab.nitterizeme.activities.MainActivity.SET_TEDDIT_HOST;
-import static app.fedilab.nitterizeme.activities.MainActivity.SET_WIKILESS_ENABLED;
-
public class Utils {
public static final String KILL_ACTIVITY = "kill_activity";
@@ -112,7 +114,7 @@ public class Utils {
public static final Pattern scriberipPattern = Pattern.compile("(www\\.)?medium.com/(((?!([\"'<])).)*)");
public static final Pattern scriberipSubdomainPattern = Pattern.compile("([\\w_-]+)\\.medium.com/(((?!([\"'<])).)*)");
-
+ public static final Pattern tiktokPattern = Pattern.compile("(www\\.|us\\.)?tiktok.com/(((?!([\"'<])).)*)");
public static final Pattern wikilessPattern = Pattern.compile("([\\w_-]+)\\.(?:m\\.)?wikipedia.org/(((?!([\"'<])).)*)");
public static final Pattern bibliogramAccountPattern = Pattern.compile("(m\\.|www\\.)?instagram.com(((?!/p/).)+)");
@@ -466,6 +468,26 @@ public class Utils {
} else {
return url;
}
+ } else if (host != null && Arrays.asList(tiktok_domains).contains(host)) {
+ boolean proxitok_enabled = sharedpreferences.getBoolean(SET_PROXITOK_ENABLED, true);
+ if (proxitok_enabled) {
+ String proxitokHost = sharedpreferences.getString(MainActivity.SET_PROXITOK_HOST, MainActivity.DEFAULT_PROXITOK_HOST);
+ assert proxitokHost != null;
+ proxitokHost = proxitokHost.toLowerCase();
+ Matcher matcher = tiktokPattern.matcher(url);
+ while (matcher.find()) {
+ String path = matcher.group(2);
+ if (path == null || path.trim().equals("") || path.startsWith("@") || path.startsWith("music") || path.startsWith("tag")) {
+ newUrl = url.replace(host, proxitokHost);
+ }
+ }
+ if (newUrl == null) {
+ newUrl = url;
+ }
+ return newUrl;
+ } else {
+ return url;
+ }
} else if (Arrays.asList(invidious_instances).contains(host)) {
boolean invidious_enabled = sharedpreferences.getBoolean(SET_INVIDIOUS_ENABLED, true);
newUrl = url;
@@ -1257,7 +1279,8 @@ public class Utils {
|| Arrays.asList(instagram_domains).contains(host) || Arrays.asList(bibliogram_instances).contains(host)
|| url.contains("/maps/place") || url.contains("/amp/s/") || (host != null && host.contains(outlook_safe_domain))
|| Arrays.asList(youtube_domains).contains(host) || Arrays.asList(invidious_instances).contains(host)
- || (host != null && host.endsWith(medium_domains[0]) || (host != null && host.endsWith(wikipedia_domains[0])));
+ || Arrays.asList(tiktok_domains).contains(host) || (host != null && host.endsWith(medium_domains[0])
+ || (host != null && host.endsWith(wikipedia_domains[0])));
}
public static boolean routerEnabledForHost(Context context, String url) {
@@ -1281,6 +1304,8 @@ public class Utils {
return sharedpreferences.getBoolean(SET_INVIDIOUS_ENABLED, true);
} else if (Arrays.asList(reddit_domains).contains(host)) {
return sharedpreferences.getBoolean(SET_TEDDIT_ENABLED, true);
+ } else if (Arrays.asList(tiktok_domains).contains(host)) {
+ return sharedpreferences.getBoolean(SET_PROXITOK_ENABLED, true);
} else if (host != null && host.endsWith(medium_domains[0])) {
return sharedpreferences.getBoolean(SET_SCRIBERIP_ENABLED, true);
} else if (host != null && host.endsWith(wikipedia_domains[0])) {
diff --git a/app/src/main/res/layout/activity_popup_instance.xml b/app/src/main/res/layout/activity_popup_instance.xml
index a071080..3adf8bf 100644
--- a/app/src/main/res/layout/activity_popup_instance.xml
+++ b/app/src/main/res/layout/activity_popup_instance.xml
@@ -102,6 +102,19 @@
android:layout_width="match_parent"
android:layout_height="wrap_content" />
+
+
+
+
diff --git a/app/src/main/res/layout/content_main.xml b/app/src/main/res/layout/content_main.xml
index 4b566fa..b2d244e 100644
--- a/app/src/main/res/layout/content_main.xml
+++ b/app/src/main/res/layout/content_main.xml
@@ -916,7 +916,7 @@
style="@style/containerCard"
android:layout_width="match_parent"
android:layout_height="wrap_content"
- app:layout_constraintBottom_toTopOf="@id/buttons_container"
+ app:layout_constraintBottom_toTopOf="@id/proxitok_container"
app:layout_constraintTop_toBottomOf="@id/teddit_container">
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ app:layout_constraintTop_toBottomOf="@id/proxitok_container">
Redirect YouTube to Invidious
Redirect Twitter to Nitter
+ Redirect TikTok to ProxiTok
Redirect Instagram to Bibliogram
Redirect Reddit to Teddit
Redirect Medium to Scribe.rip
@@ -52,6 +53,7 @@
Custom Scribe.rip instance
Custom Wikiless instance
Custom Teddit instance
+ Custom ProxiTok instance
Redirect Google Map to Geo URI
Configure
Display supported links
@@ -71,6 +73,7 @@
Teddit instances
Scribe instances
Wikiless instances
+ ProxiTok instances
Latency
Check your Internet connection
Instance: