mirror of
https://framagit.org/tom79/nitterizeme
synced 2025-03-10 08:20:12 +01:00
Update lib + some cleaning
This commit is contained in:
parent
3999cb1657
commit
0863f5d5e3
@ -1,11 +1,11 @@
|
||||
apply plugin: 'com.android.application'
|
||||
|
||||
android {
|
||||
compileSdkVersion 29
|
||||
buildToolsVersion "29.0.3"
|
||||
compileSdkVersion 30
|
||||
buildToolsVersion "30.0.2"
|
||||
defaultConfig {
|
||||
minSdkVersion 15
|
||||
targetSdkVersion 29
|
||||
targetSdkVersion 30
|
||||
versionCode 21
|
||||
versionName "1.12.0"
|
||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||
@ -49,13 +49,13 @@ android {
|
||||
|
||||
dependencies {
|
||||
implementation fileTree(dir: 'libs', include: ['*.jar'])
|
||||
implementation 'androidx.appcompat:appcompat:1.1.0'
|
||||
implementation 'androidx.appcompat:appcompat:1.2.0'
|
||||
implementation 'androidx.localbroadcastmanager:localbroadcastmanager:1.0.0'
|
||||
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
|
||||
implementation 'com.google.android.material:material:1.1.0'
|
||||
implementation 'androidx.constraintlayout:constraintlayout:2.0.1'
|
||||
implementation 'com.google.android.material:material:1.2.0'
|
||||
implementation 'androidx.preference:preference:1.1.1'
|
||||
implementation 'org.jsoup:jsoup:1.13.1'
|
||||
testImplementation 'junit:junit:4.13'
|
||||
androidTestImplementation 'androidx.test.ext:junit:1.1.1'
|
||||
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
|
||||
androidTestImplementation 'androidx.test.ext:junit:1.1.2'
|
||||
androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'
|
||||
}
|
||||
|
@ -19,10 +19,10 @@
|
||||
tools:replace="android:label,android:icon,android:roundIcon">
|
||||
|
||||
<activity
|
||||
tools:replace="android:label"
|
||||
android:name=".activities.MainActivity"
|
||||
android:label="@string/app_name"
|
||||
android:theme="@style/AppTheme.NoActionBar">
|
||||
android:theme="@style/AppTheme.NoActionBar"
|
||||
tools:replace="android:label">
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.MAIN" />
|
||||
<category android:name="android.intent.category.LAUNCHER" />
|
||||
@ -32,8 +32,8 @@
|
||||
<activity-alias
|
||||
android:name=".activities.TransformActivity"
|
||||
android:noHistory="true"
|
||||
android:theme="@style/Theme.AppCompat.Translucent"
|
||||
android:targetActivity=".activities.TransformActivity">
|
||||
android:targetActivity=".activities.TransformActivity"
|
||||
android:theme="@style/Theme.AppCompat.Translucent">
|
||||
<!-- The app should handle these domains, more can be added here -->
|
||||
|
||||
<intent-filter>
|
||||
@ -142,7 +142,6 @@
|
||||
<data android:host="youtube-nocookie.com" />
|
||||
|
||||
|
||||
|
||||
<data android:host="*" />
|
||||
|
||||
<data android:mimeType="text/plain" />
|
||||
@ -196,44 +195,44 @@
|
||||
<activity-alias
|
||||
android:name=".activities.AppsPickerActivity"
|
||||
android:noHistory="true"
|
||||
android:theme="@style/Theme.AppCompat.Translucent"
|
||||
android:targetActivity=".activities.AppsPickerActivity" />
|
||||
android:targetActivity=".activities.AppsPickerActivity"
|
||||
android:theme="@style/Theme.AppCompat.Translucent" />
|
||||
<activity-alias
|
||||
android:name=".activities.InstanceActivity"
|
||||
android:excludeFromRecents="true"
|
||||
android:theme="@style/AppThemeDialog"
|
||||
android:targetActivity=".activities.InstanceActivity" />
|
||||
android:targetActivity=".activities.InstanceActivity"
|
||||
android:theme="@style/AppThemeDialog" />
|
||||
<activity-alias
|
||||
android:name=".activities.AboutActivity"
|
||||
android:configChanges="orientation|screenSize"
|
||||
android:label="@string/app_name"
|
||||
android:theme="@style/AppTheme"
|
||||
android:targetActivity=".activities.AboutActivity" />
|
||||
android:targetActivity=".activities.AboutActivity"
|
||||
android:theme="@style/AppTheme" />
|
||||
<activity-alias
|
||||
android:name=".activities.CheckAppActivity"
|
||||
android:configChanges="orientation|screenSize"
|
||||
android:label="@string/app_name"
|
||||
android:theme="@style/AppTheme"
|
||||
android:targetActivity=".activities.CheckAppActivity" />
|
||||
android:targetActivity=".activities.CheckAppActivity"
|
||||
android:theme="@style/AppTheme" />
|
||||
<activity-alias
|
||||
android:name=".activities.DefaultAppActivity"
|
||||
android:configChanges="orientation|screenSize"
|
||||
android:label="@string/app_name"
|
||||
android:theme="@style/AppTheme"
|
||||
android:targetActivity=".activities.DefaultAppActivity" />
|
||||
android:targetActivity=".activities.DefaultAppActivity"
|
||||
android:theme="@style/AppTheme" />
|
||||
<activity-alias
|
||||
android:name=".activities.InvidiousSettingsActivity"
|
||||
android:configChanges="orientation|screenSize"
|
||||
android:label="@string/invidious_settings"
|
||||
android:theme="@style/AppTheme"
|
||||
android:targetActivity=".activities.InvidiousSettingsActivity" />
|
||||
android:targetActivity=".activities.InvidiousSettingsActivity"
|
||||
android:theme="@style/AppTheme" />
|
||||
<activity-alias
|
||||
android:name=".activities.WebviewPlayerActivity"
|
||||
android:configChanges="keyboardHidden|orientation|screenSize"
|
||||
android:label="@string/app_name"
|
||||
android:launchMode="singleTask"
|
||||
android:theme="@style/AppTheme"
|
||||
android:targetActivity=".activities.WebviewPlayerActivity" />
|
||||
android:targetActivity=".activities.WebviewPlayerActivity"
|
||||
android:theme="@style/AppTheme" />
|
||||
</application>
|
||||
|
||||
</manifest>
|
@ -8,7 +8,6 @@
|
||||
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
|
||||
|
||||
<application
|
||||
tools:node="replace"
|
||||
android:allowBackup="false"
|
||||
android:icon="@mipmap/ic_launcher_lite"
|
||||
android:label="@string/app_name_lite"
|
||||
@ -16,7 +15,8 @@
|
||||
android:supportsRtl="true"
|
||||
android:theme="@style/AppTheme"
|
||||
android:usesCleartextTraffic="true"
|
||||
tools:ignore="GoogleAppIndexingWarning,UnusedAttribute">
|
||||
tools:ignore="GoogleAppIndexingWarning,UnusedAttribute"
|
||||
tools:node="replace">
|
||||
|
||||
<activity
|
||||
android:name=".activities.MainActivity"
|
||||
|
@ -94,9 +94,9 @@ public class Utils {
|
||||
public static final Pattern maps = Pattern.compile("/maps/place/([^@]+@)?([\\d.,z]+).*");
|
||||
public static final Pattern ampExtract = Pattern.compile("amp/s/(.*)");
|
||||
public static final String RECEIVE_STREAMING_URL = "receive_streaming_url";
|
||||
public static final Pattern outlookRedirect = Pattern.compile("(.*)safelinks\\.protection\\.outlook\\.com/?[?]?((?!url).)*url=([^&]+)");
|
||||
private static final Pattern extractPlace = Pattern.compile("/maps/place/(((?!/data).)*)");
|
||||
private static final Pattern googleRedirect = Pattern.compile("https?://(www\\.)?google(\\.\\w{2,})?(\\.\\w{2,})/url\\?q=(.*)");
|
||||
public static final Pattern outlookRedirect = Pattern.compile("(.*)safelinks\\.protection\\.outlook\\.com/?[?]?((?!url).)*url=([^&]+)");
|
||||
private static final String[] G_TRACKING = {
|
||||
"sourceid",
|
||||
"aqs",
|
||||
@ -233,7 +233,9 @@ public class Utils {
|
||||
if (Arrays.asList(twitter_domains).contains(host)) {
|
||||
boolean nitter_enabled = sharedpreferences.getBoolean(SET_NITTER_ENABLED, true);
|
||||
if (nitter_enabled) {
|
||||
String nitterHost = sharedpreferences.getString(MainActivity.SET_NITTER_HOST, MainActivity.DEFAULT_NITTER_HOST).toLowerCase();
|
||||
String nitterHost = sharedpreferences.getString(MainActivity.SET_NITTER_HOST, MainActivity.DEFAULT_NITTER_HOST);
|
||||
assert nitterHost != null;
|
||||
nitterHost = nitterHost.toLowerCase();
|
||||
if (nitterHost.startsWith("http")) {
|
||||
scheme = "";
|
||||
}
|
||||
@ -263,7 +265,9 @@ public class Utils {
|
||||
} else if (Arrays.asList(instagram_domains).contains(host)) {
|
||||
boolean bibliogram_enabled = sharedpreferences.getBoolean(SET_BIBLIOGRAM_ENABLED, true);
|
||||
if (bibliogram_enabled) {
|
||||
String bibliogramHost = sharedpreferences.getString(MainActivity.SET_BIBLIOGRAM_HOST, MainActivity.DEFAULT_BIBLIOGRAM_HOST).toLowerCase();
|
||||
String bibliogramHost = sharedpreferences.getString(MainActivity.SET_BIBLIOGRAM_HOST, MainActivity.DEFAULT_BIBLIOGRAM_HOST);
|
||||
assert bibliogramHost != null;
|
||||
bibliogramHost = bibliogramHost.toLowerCase();
|
||||
if (bibliogramHost.startsWith("http")) {
|
||||
scheme = "";
|
||||
}
|
||||
@ -306,7 +310,9 @@ public class Utils {
|
||||
} else {
|
||||
zoom = "16";
|
||||
}
|
||||
String osmHost = sharedpreferences.getString(MainActivity.SET_OSM_HOST, MainActivity.DEFAULT_OSM_HOST).toLowerCase();
|
||||
String osmHost = sharedpreferences.getString(MainActivity.SET_OSM_HOST, MainActivity.DEFAULT_OSM_HOST);
|
||||
assert osmHost != null;
|
||||
osmHost = osmHost.toLowerCase();
|
||||
boolean geo_uri_enabled = sharedpreferences.getBoolean(MainActivity.SET_GEO_URIS, false);
|
||||
if (!geo_uri_enabled) {
|
||||
newUrl = scheme + osmHost + "/#map=" + zoom + "/" + data[0] + "/" + data[1];
|
||||
@ -329,7 +335,9 @@ public class Utils {
|
||||
} else if (Arrays.asList(youtube_domains).contains(host)) { //Youtube URL
|
||||
boolean invidious_enabled = sharedpreferences.getBoolean(SET_INVIDIOUS_ENABLED, true);
|
||||
if (invidious_enabled) {
|
||||
String invidiousHost = sharedpreferences.getString(MainActivity.SET_INVIDIOUS_HOST, MainActivity.DEFAULT_INVIDIOUS_HOST).toLowerCase();
|
||||
String invidiousHost = sharedpreferences.getString(MainActivity.SET_INVIDIOUS_HOST, MainActivity.DEFAULT_INVIDIOUS_HOST);
|
||||
assert invidiousHost != null;
|
||||
invidiousHost = invidiousHost.toLowerCase();
|
||||
if (invidiousHost.startsWith("http")) {
|
||||
scheme = "";
|
||||
}
|
||||
@ -367,6 +375,7 @@ public class Utils {
|
||||
SharedPreferences sharedpreferences = PreferenceManager.getDefaultSharedPreferences(context);
|
||||
//Theme
|
||||
String theme = sharedpreferences.getString(context.getString(R.string.invidious_dark_mode), "0");
|
||||
assert theme != null;
|
||||
if (theme.compareTo("-1") == 0) { //Remove value
|
||||
newUrl = newUrl.replaceAll("&?dark_mode=(true|false)", "");
|
||||
} else if (theme.compareTo("0") != 0) { //Change value
|
||||
@ -379,6 +388,7 @@ public class Utils {
|
||||
|
||||
//Thin mode
|
||||
String thin = sharedpreferences.getString(context.getString(R.string.invidious_thin_mode), "0");
|
||||
assert thin != null;
|
||||
if (thin.compareTo("-1") == 0) { //Remove value
|
||||
newUrl = newUrl.replaceAll("&?thin_mode=(true|false)", "");
|
||||
} else if (thin.compareTo("0") != 0) { //Change value
|
||||
@ -391,6 +401,7 @@ public class Utils {
|
||||
|
||||
//Language
|
||||
String language = sharedpreferences.getString(context.getString(R.string.invidious_language_mode), "0");
|
||||
assert language != null;
|
||||
if (language.compareTo("-1") == 0) { //Remove value
|
||||
newUrl = newUrl.replaceAll("&?hl=\\w{2}(-\\w{2})?", "");
|
||||
} else if (language.compareTo("0") != 0) { //Change value
|
||||
@ -403,6 +414,7 @@ public class Utils {
|
||||
|
||||
//Annotations
|
||||
String annotations = sharedpreferences.getString(context.getString(R.string.invidious_annotations_mode), "0");
|
||||
assert annotations != null;
|
||||
if (annotations.compareTo("-1") == 0) { //Remove value
|
||||
newUrl = newUrl.replaceAll("&?iv_load_policy=\\d", "");
|
||||
} else if (annotations.compareTo("0") != 0) { //Change value
|
||||
@ -415,6 +427,7 @@ public class Utils {
|
||||
|
||||
//Autoplay
|
||||
String autoplay = sharedpreferences.getString(context.getString(R.string.invidious_autoplay_mode), "0");
|
||||
assert autoplay != null;
|
||||
if (autoplay.compareTo("-1") == 0) { //Remove value
|
||||
newUrl = newUrl.replaceAll("&?autoplay=\\d", "");
|
||||
} else if (autoplay.compareTo("0") != 0) { //Change value
|
||||
@ -427,6 +440,7 @@ public class Utils {
|
||||
|
||||
//Continue
|
||||
String continueMode = sharedpreferences.getString(context.getString(R.string.invidious_continue_mode), "0");
|
||||
assert continueMode != null;
|
||||
if (continueMode.compareTo("-1") == 0) { //Remove value
|
||||
newUrl = newUrl.replaceAll("&?continue=\\d", "");
|
||||
} else if (continueMode.compareTo("0") != 0) { //Change value
|
||||
@ -439,6 +453,7 @@ public class Utils {
|
||||
|
||||
//Listen
|
||||
String listen = sharedpreferences.getString(context.getString(R.string.invidious_listen_mode), "0");
|
||||
assert listen != null;
|
||||
if (listen.compareTo("-1") == 0) { //Remove value
|
||||
newUrl = newUrl.replaceAll("&?listen=(true|false)", "");
|
||||
} else if (listen.compareTo("0") != 0) { //Change value
|
||||
@ -452,6 +467,7 @@ public class Utils {
|
||||
//Local
|
||||
String local = sharedpreferences.getString(context.getString(R.string.invidious_local_mode), "local=true");
|
||||
if (!url.contains("/channel/")) {
|
||||
assert local != null;
|
||||
if (local.compareTo("-1") == 0) { //Remove value
|
||||
newUrl = newUrl.replaceAll("&?local=(true|false)", "");
|
||||
} else if (local.compareTo("0") != 0) { //Change value
|
||||
@ -465,6 +481,7 @@ public class Utils {
|
||||
|
||||
//Subtitles
|
||||
String subtitles = sharedpreferences.getString(context.getString(R.string.invidious_subtitles_mode), "0");
|
||||
assert subtitles != null;
|
||||
if (subtitles.compareTo("-1") == 0) { //Remove value
|
||||
newUrl = newUrl.replaceAll("&?subtitles=\\w+", "");
|
||||
} else if (subtitles.compareTo("0") != 0) { //Change value
|
||||
@ -477,6 +494,7 @@ public class Utils {
|
||||
|
||||
//Quality
|
||||
String quality = sharedpreferences.getString(context.getString(R.string.invidious_quality_mode), "0");
|
||||
assert quality != null;
|
||||
if (quality.compareTo("-1") == 0) { //Remove value
|
||||
newUrl = newUrl.replaceAll("&?quality=\\w+", "");
|
||||
} else if (quality.compareTo("0") != 0) { //Change value
|
||||
@ -489,6 +507,7 @@ public class Utils {
|
||||
|
||||
//Loop
|
||||
String loop = sharedpreferences.getString(context.getString(R.string.invidious_loop_mode), "0");
|
||||
assert loop != null;
|
||||
if (loop.compareTo("-1") == 0) { //Remove value
|
||||
newUrl = newUrl.replaceAll("&?loop=\\d", "");
|
||||
} else if (loop.compareTo("0") != 0) { //Change value
|
||||
@ -502,6 +521,7 @@ public class Utils {
|
||||
|
||||
//Volume
|
||||
String volume = sharedpreferences.getString(context.getString(R.string.invidious_volume_mode), "0");
|
||||
assert volume != null;
|
||||
if (volume.compareTo("-1") == 0) { //Remove value
|
||||
newUrl = newUrl.replaceAll("&?volume=\\d{1,3}", "");
|
||||
} else if (volume.compareTo("0") != 0) { //Change value
|
||||
@ -515,6 +535,7 @@ public class Utils {
|
||||
|
||||
//Player style
|
||||
String player_style = sharedpreferences.getString(context.getString(R.string.invidious_player_style_mode), "0");
|
||||
assert player_style != null;
|
||||
if (player_style.compareTo("-1") == 0) { //Remove value
|
||||
newUrl = newUrl.replaceAll("&?player_style=\\w+", "");
|
||||
} else if (player_style.compareTo("0") != 0) { //Change value
|
||||
@ -812,7 +833,9 @@ public class Utils {
|
||||
String newUrlFinal = notShortnedURLDialog.get(notShortnedURLDialog.size() - 1);
|
||||
while (matcher.find()) {
|
||||
final String nitter_directory = matcher.group(2);
|
||||
String nitterHost = sharedpreferences.getString(MainActivity.SET_NITTER_HOST, MainActivity.DEFAULT_NITTER_HOST).toLowerCase();
|
||||
String nitterHost = sharedpreferences.getString(MainActivity.SET_NITTER_HOST, MainActivity.DEFAULT_NITTER_HOST);
|
||||
assert nitterHost != null;
|
||||
nitterHost = nitterHost.toLowerCase();
|
||||
newUrlFinal = scheme + nitterHost + nitter_directory;
|
||||
}
|
||||
String newExtraText = extraText.replaceAll(Pattern.quote(url), Matcher.quoteReplacement(newUrlFinal));
|
||||
@ -826,7 +849,9 @@ public class Utils {
|
||||
String newUrlFinal = notShortnedURLDialog.get(notShortnedURLDialog.size() - 1);
|
||||
while (matcher.find()) {
|
||||
final String youtubeId = matcher.group(3);
|
||||
String invidiousHost = sharedpreferences.getString(MainActivity.SET_INVIDIOUS_HOST, MainActivity.DEFAULT_INVIDIOUS_HOST).toLowerCase();
|
||||
String invidiousHost = sharedpreferences.getString(MainActivity.SET_INVIDIOUS_HOST, MainActivity.DEFAULT_INVIDIOUS_HOST);
|
||||
assert invidiousHost != null;
|
||||
invidiousHost = invidiousHost.toLowerCase();
|
||||
if (Objects.requireNonNull(matcher.group(2)).compareTo("youtu.be") == 0) {
|
||||
newUrlFinal = scheme + invidiousHost + "/watch?v=" + youtubeId;
|
||||
} else {
|
||||
@ -855,7 +880,9 @@ public class Utils {
|
||||
} else {
|
||||
zoom = data[2];
|
||||
}
|
||||
String osmHost = sharedpreferences.getString(MainActivity.SET_OSM_HOST, MainActivity.DEFAULT_OSM_HOST).toLowerCase();
|
||||
String osmHost = sharedpreferences.getString(MainActivity.SET_OSM_HOST, MainActivity.DEFAULT_OSM_HOST);
|
||||
assert osmHost != null;
|
||||
osmHost = osmHost.toLowerCase();
|
||||
newUrlFinal = scheme + osmHost + "/#map=" + zoom + "/" + data[0] + "/" + data[1];
|
||||
}
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<background android:drawable="@color/ic_launcher_lite_background"/>
|
||||
<foreground android:drawable="@drawable/ic_launcher_lite_foreground"/>
|
||||
<background android:drawable="@color/ic_launcher_lite_background" />
|
||||
<foreground android:drawable="@drawable/ic_launcher_lite_foreground" />
|
||||
</adaptive-icon>
|
@ -1,5 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<background android:drawable="@color/ic_launcher_lite_background"/>
|
||||
<foreground android:drawable="@drawable/ic_launcher_lite_foreground"/>
|
||||
<background android:drawable="@color/ic_launcher_lite_background" />
|
||||
<foreground android:drawable="@drawable/ic_launcher_lite_foreground" />
|
||||
</adaptive-icon>
|
@ -35,8 +35,8 @@
|
||||
|
||||
|
||||
<PreferenceCategory
|
||||
android:title="@string/pref_invidious_head2"
|
||||
android:key="@string/invidious_category_player_parameters"
|
||||
android:title="@string/pref_invidious_head2"
|
||||
app:iconSpaceReserved="false">
|
||||
<ListPreference
|
||||
android:defaultValue="0"
|
||||
@ -125,12 +125,12 @@
|
||||
|
||||
<SeekBarPreference
|
||||
android:defaultValue="60"
|
||||
app:showSeekBarValue="true"
|
||||
app:iconSpaceReserved="false"
|
||||
android:key="@string/invidious_volume_value"
|
||||
android:max="100"
|
||||
android:title="@string/invidious_volume_mode_value"
|
||||
app:summary="@string/invidious_volume_mode_value_indication"
|
||||
android:max="100" />
|
||||
app:iconSpaceReserved="false"
|
||||
app:showSeekBarValue="true"
|
||||
app:summary="@string/invidious_volume_mode_value_indication" />
|
||||
</PreferenceCategory>
|
||||
|
||||
<PreferenceCategory
|
||||
|
@ -7,7 +7,7 @@ buildscript {
|
||||
|
||||
}
|
||||
dependencies {
|
||||
classpath 'com.android.tools.build:gradle:4.0.0'
|
||||
classpath 'com.android.tools.build:gradle:4.0.1'
|
||||
|
||||
// NOTE: Do not place your application dependencies here; they belong
|
||||
// in the individual module build.gradle files
|
||||
|
Loading…
x
Reference in New Issue
Block a user