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