1
mirror of https://github.com/revanced/revanced-integrations synced 2025-11-19 03:23:27 +01:00

Compare commits

...

24 Commits

Author SHA1 Message Date
semantic-release-bot
8301fa07fd chore(release): 0.101.0-dev.1 [skip ci]
# [0.101.0-dev.1](https://github.com/revanced/revanced-integrations/compare/v0.100.2-dev.3...v0.101.0-dev.1) (2023-03-17)

### Features

* **youtube/spoof-signature-verification:** automatic signature spoofing ([d16980e](d16980ef2f))
2023-03-17 18:00:46 +00:00
LisoUseInAIKyrios
d16980ef2f feat(youtube/spoof-signature-verification): automatic signature spoofing
Co-authored-by: oSumAtrIX <johan.melkonyan1@web.de>
2023-03-17 21:59:04 +04:00
semantic-release-bot
83510e51b3 chore(release): 0.100.2-dev.3 [skip ci]
## [0.100.2-dev.3](https://github.com/revanced/revanced-integrations/compare/v0.100.2-dev.2...v0.100.2-dev.3) (2023-03-15)

### Bug Fixes

* **youtube/spoof-signature-verification:** fix audio during home feed video playback ([#336](https://github.com/revanced/revanced-integrations/issues/336)) ([68d0930](68d09305b9))
2023-03-15 17:41:14 +00:00
LisoUseInAIKyrios
68d09305b9 fix(youtube/spoof-signature-verification): fix audio during home feed video playback (#336)
Co-authored-by: oSumAtrIX <johan.melkonyan1@web.de>
2023-03-15 21:39:18 +04:00
semantic-release-bot
dc5c1b45ba chore(release): 0.100.2-dev.2 [skip ci]
## [0.100.2-dev.2](https://github.com/revanced/revanced-integrations/compare/v0.100.2-dev.1...v0.100.2-dev.2) (2023-03-14)

### Bug Fixes

* **youtube/return-youtube-dislike:** layout fix for low dpi devices ([#335](https://github.com/revanced/revanced-integrations/issues/335)) ([46e0272](46e0272f9e))
2023-03-14 22:46:09 +00:00
LisoUseInAIKyrios
46e0272f9e fix(youtube/return-youtube-dislike): layout fix for low dpi devices (#335) 2023-03-15 02:44:05 +04:00
semantic-release-bot
69ccb5fc05 chore(release): 0.100.2-dev.1 [skip ci]
## [0.100.2-dev.1](https://github.com/revanced/revanced-integrations/compare/v0.100.1...v0.100.2-dev.1) (2023-03-14)

### Bug Fixes

* **youtube/return-youtube-dislike:** fix right to left text layout ([#333](https://github.com/revanced/revanced-integrations/issues/333)) ([2dd1431](2dd14313a6))
2023-03-14 18:54:35 +00:00
LisoUseInAIKyrios
2dd14313a6 fix(youtube/return-youtube-dislike): fix right to left text layout (#333) 2023-03-14 22:52:45 +04:00
LisoUseInAIKyrios
5e518855d1 fixing LTR layout 2023-03-14 22:40:05 +04:00
semantic-release-bot
52ac4acff3 chore(release): 0.100.1 [skip ci]
## [0.100.1](https://github.com/revanced/revanced-integrations/compare/v0.100.0...v0.100.1) (2023-03-14)

### Bug Fixes

* minor syntax issue ([1e1504d](1e1504d118))
2023-03-14 15:28:44 +00:00
oSumAtrIX
a08bc53828 chore: merge branch dev to main (#332) 2023-03-14 16:26:48 +01:00
semantic-release-bot
5d7dc94d8d chore(release): 0.100.1-dev.1 [skip ci]
## [0.100.1-dev.1](https://github.com/revanced/revanced-integrations/compare/v0.100.0...v0.100.1-dev.1) (2023-03-14)

### Bug Fixes

* minor syntax issue ([1e1504d](1e1504d118))
2023-03-14 15:25:08 +00:00
oSumAtrIX
1e1504d118 fix: minor syntax issue 2023-03-14 16:23:20 +01:00
semantic-release-bot
393d6e62f2 chore(release): 0.100.0 [skip ci]
# [0.100.0](https://github.com/revanced/revanced-integrations/compare/v0.99.0...v0.100.0) (2023-03-14)

### Bug Fixes

* **youtube/general-ads:** hide any kind of buttoned ad ([0b3508b](0b3508bd8d))
* **youtube/general-ads:** hide chapters in video description ([#326](https://github.com/revanced/revanced-integrations/issues/326)) ([f31e3a0](f31e3a02a0))
* **youtube/hide-floating-microphone-button:** reboot when changing settings ([919f285](919f2855ed))
* **youtube/remember-video-quality:** treat any connection as wifi except mobile and bluetooth ([1f90f7b](1f90f7b9cc))
* **youtube/return-youtube-dislike:** improve segmented like/dislike layout ([416c695](416c695837))

### Features

* **youtube/general-ads:** do not hide components in library tab ([3c00e58](3c00e58c13))
* **youtube/general-ads:** hide image shelf from search results ([db6ce55](db6ce55477))
* **youtube/general-ads:** hide new type of ad ([844bc3b](844bc3b24f))
* **youtube/general-ads:** hide new type of ad ([#331](https://github.com/revanced/revanced-integrations/issues/331)) ([7e64e05](7e64e05709))
* **youtube/hide-autoplay-button:** do not disable autoplay button when hidden ([519c2bd](519c2bd511))
* **youtube:** `hide-floating-microphone-button` patch ([cb77e96](cb77e96da9))
* **youtube:** remove `custom-video-buffer` patch ([#1718](https://github.com/revanced/revanced-integrations/issues/1718)) ([d5919a8](d5919a8a2c))
2023-03-14 15:01:22 +00:00
oSumAtrIX
1361595076 chore: merge branch dev to main (#324) 2023-03-14 15:59:09 +01:00
semantic-release-bot
2f5c839613 chore(release): 0.100.0-dev.6 [skip ci]
# [0.100.0-dev.6](https://github.com/revanced/revanced-integrations/compare/v0.100.0-dev.5...v0.100.0-dev.6) (2023-03-14)

### Bug Fixes

* **youtube/hide-floating-microphone-button:** reboot when changing settings ([919f285](919f2855ed))
* **youtube/remember-video-quality:** treat any connection as wifi except mobile and bluetooth ([1f90f7b](1f90f7b9cc))
* **youtube/return-youtube-dislike:** improve segmented like/dislike layout ([416c695](416c695837))

### Features

* **youtube/general-ads:** hide new type of ad ([844bc3b](844bc3b24f))
* **youtube/general-ads:** hide new type of ad ([#331](https://github.com/revanced/revanced-integrations/issues/331)) ([7e64e05](7e64e05709))
* **youtube:** remove `custom-video-buffer` patch ([#1718](https://github.com/revanced/revanced-integrations/issues/1718)) ([d5919a8](d5919a8a2c))
2023-03-14 14:30:11 +00:00
johnconner122
7e64e05709 feat(youtube/general-ads): hide new type of ad (#331)
Co-authored-by: oSumAtrIX <johan.melkonyan1@web.de>
2023-03-14 15:26:31 +01:00
oSumAtrIX
d5919a8a2c feat(youtube): remove custom-video-buffer patch (#1718) 2023-03-14 15:26:30 +01:00
oSumAtrIX
844bc3b24f feat(youtube/general-ads): hide new type of ad 2023-03-14 15:26:30 +01:00
oSumAtrIX
67fa87051f chore: fix logging message 2023-03-14 15:26:30 +01:00
oSumAtrIX
1f90f7b9cc fix(youtube/remember-video-quality): treat any connection as wifi except mobile and bluetooth 2023-03-14 15:26:29 +01:00
semantic-release-bot
0c725218fd chore(release): 0.100.0-dev.6 [skip ci]
# [0.100.0-dev.6](https://github.com/revanced/revanced-integrations/compare/v0.100.0-dev.5...v0.100.0-dev.6) (2023-02-26)

### Bug Fixes

* **youtube/hide-floating-microphone-button:** reboot when changing settings ([919f285](919f2855ed))
2023-03-14 15:26:00 +01:00
LisousEinaiKyrios
416c695837 fix(youtube/return-youtube-dislike): improve segmented like/dislike layout 2023-03-14 15:26:00 +01:00
oSumAtrIX
919f2855ed fix(youtube/hide-floating-microphone-button): reboot when changing settings
Signed-off-by: oSumAtrIX <johan.melkonyan1@web.de>
2023-02-27 00:23:59 +01:00
9 changed files with 411 additions and 295 deletions

View File

@@ -1,3 +1,90 @@
# [0.101.0-dev.1](https://github.com/revanced/revanced-integrations/compare/v0.100.2-dev.3...v0.101.0-dev.1) (2023-03-17)
### Features
* **youtube/spoof-signature-verification:** automatic signature spoofing ([d16980e](https://github.com/revanced/revanced-integrations/commit/d16980ef2f18b7b5752be36f0183985c6c398ea1))
## [0.100.2-dev.3](https://github.com/revanced/revanced-integrations/compare/v0.100.2-dev.2...v0.100.2-dev.3) (2023-03-15)
### Bug Fixes
* **youtube/spoof-signature-verification:** fix audio during home feed video playback ([#336](https://github.com/revanced/revanced-integrations/issues/336)) ([68d0930](https://github.com/revanced/revanced-integrations/commit/68d09305b990b411efffeeb02aa638e59eee9e5d))
## [0.100.2-dev.2](https://github.com/revanced/revanced-integrations/compare/v0.100.2-dev.1...v0.100.2-dev.2) (2023-03-14)
### Bug Fixes
* **youtube/return-youtube-dislike:** layout fix for low dpi devices ([#335](https://github.com/revanced/revanced-integrations/issues/335)) ([46e0272](https://github.com/revanced/revanced-integrations/commit/46e0272f9e96e7893e6fbb919d90248f59addaf9))
## [0.100.2-dev.1](https://github.com/revanced/revanced-integrations/compare/v0.100.1...v0.100.2-dev.1) (2023-03-14)
### Bug Fixes
* **youtube/return-youtube-dislike:** fix right to left text layout ([#333](https://github.com/revanced/revanced-integrations/issues/333)) ([2dd1431](https://github.com/revanced/revanced-integrations/commit/2dd14313a64930acbb544f4ad971c51dcfbb80e1))
## [0.100.1](https://github.com/revanced/revanced-integrations/compare/v0.100.0...v0.100.1) (2023-03-14)
### Bug Fixes
* minor syntax issue ([1e1504d](https://github.com/revanced/revanced-integrations/commit/1e1504d118d656492df0bee30364e966a8dc99b4))
## [0.100.1-dev.1](https://github.com/revanced/revanced-integrations/compare/v0.100.0...v0.100.1-dev.1) (2023-03-14)
### Bug Fixes
* minor syntax issue ([1e1504d](https://github.com/revanced/revanced-integrations/commit/1e1504d118d656492df0bee30364e966a8dc99b4))
# [0.100.0](https://github.com/revanced/revanced-integrations/compare/v0.99.0...v0.100.0) (2023-03-14)
### Bug Fixes
* **youtube/general-ads:** hide any kind of buttoned ad ([0b3508b](https://github.com/revanced/revanced-integrations/commit/0b3508bd8dcd6e031f1a7625ee5214fd093ee3f5))
* **youtube/general-ads:** hide chapters in video description ([#326](https://github.com/revanced/revanced-integrations/issues/326)) ([f31e3a0](https://github.com/revanced/revanced-integrations/commit/f31e3a02a0965da0c1f901e9d6afcfe4f6f6b608))
* **youtube/hide-floating-microphone-button:** reboot when changing settings ([919f285](https://github.com/revanced/revanced-integrations/commit/919f2855edff0acc96c42ea733fff41a55211e48))
* **youtube/remember-video-quality:** treat any connection as wifi except mobile and bluetooth ([1f90f7b](https://github.com/revanced/revanced-integrations/commit/1f90f7b9cca2445c776f4f0c8af1ddd0c9bde5f0))
* **youtube/return-youtube-dislike:** improve segmented like/dislike layout ([416c695](https://github.com/revanced/revanced-integrations/commit/416c695837debefb4762d381f25157de480614cc))
### Features
* **youtube/general-ads:** do not hide components in library tab ([3c00e58](https://github.com/revanced/revanced-integrations/commit/3c00e58c13fa11da68ff21f4d76e341bc24c5737))
* **youtube/general-ads:** hide image shelf from search results ([db6ce55](https://github.com/revanced/revanced-integrations/commit/db6ce554779d58b23685b1794e17f89342abbd87))
* **youtube/general-ads:** hide new type of ad ([844bc3b](https://github.com/revanced/revanced-integrations/commit/844bc3b24fe9a2d6b69367d79ad99e452e8a7604))
* **youtube/general-ads:** hide new type of ad ([#331](https://github.com/revanced/revanced-integrations/issues/331)) ([7e64e05](https://github.com/revanced/revanced-integrations/commit/7e64e05709c63b4631e845799e756a678138813b))
* **youtube/hide-autoplay-button:** do not disable autoplay button when hidden ([519c2bd](https://github.com/revanced/revanced-integrations/commit/519c2bd5118db41fc512a665d9454b902134ba2c))
* **youtube:** `hide-floating-microphone-button` patch ([cb77e96](https://github.com/revanced/revanced-integrations/commit/cb77e96da91bb4707d8559757cd86a7583f8048b))
* **youtube:** remove `custom-video-buffer` patch ([#1718](https://github.com/revanced/revanced-integrations/issues/1718)) ([d5919a8](https://github.com/revanced/revanced-integrations/commit/d5919a8a2cff09bb884ea01ca6b01d8d2d0b8980))
# [0.100.0-dev.6](https://github.com/revanced/revanced-integrations/compare/v0.100.0-dev.5...v0.100.0-dev.6) (2023-03-14)
### Bug Fixes
* **youtube/hide-floating-microphone-button:** reboot when changing settings ([919f285](https://github.com/revanced/revanced-integrations/commit/919f2855edff0acc96c42ea733fff41a55211e48))
* **youtube/remember-video-quality:** treat any connection as wifi except mobile and bluetooth ([1f90f7b](https://github.com/revanced/revanced-integrations/commit/1f90f7b9cca2445c776f4f0c8af1ddd0c9bde5f0))
* **youtube/return-youtube-dislike:** improve segmented like/dislike layout ([416c695](https://github.com/revanced/revanced-integrations/commit/416c695837debefb4762d381f25157de480614cc))
### Features
* **youtube/general-ads:** hide new type of ad ([844bc3b](https://github.com/revanced/revanced-integrations/commit/844bc3b24fe9a2d6b69367d79ad99e452e8a7604))
* **youtube/general-ads:** hide new type of ad ([#331](https://github.com/revanced/revanced-integrations/issues/331)) ([7e64e05](https://github.com/revanced/revanced-integrations/commit/7e64e05709c63b4631e845799e756a678138813b))
* **youtube:** remove `custom-video-buffer` patch ([#1718](https://github.com/revanced/revanced-integrations/issues/1718)) ([d5919a8](https://github.com/revanced/revanced-integrations/commit/d5919a8a2cff09bb884ea01ca6b01d8d2d0b8980))
# [0.100.0-dev.6](https://github.com/revanced/revanced-integrations/compare/v0.100.0-dev.5...v0.100.0-dev.6) (2023-02-26)
### Bug Fixes
* **youtube/hide-floating-microphone-button:** reboot when changing settings ([919f285](https://github.com/revanced/revanced-integrations/commit/919f2855edff0acc96c42ea733fff41a55211e48))
# [0.100.0-dev.5](https://github.com/revanced/revanced-integrations/compare/v0.100.0-dev.4...v0.100.0-dev.5) (2023-02-26)

View File

@@ -59,7 +59,9 @@ public final class GeneralAdsPatch extends Filter {
"watch_metadata_app_promo",
"video_display_full_layout",
"hero_promo_image",
"statement_banner"
"statement_banner",
"carousel_footered_layout",
"text_image_button_layout"
);
var movieAds = new BlockRule(
SettingsEnum.ADREMOVER_MOVIE_REMOVAL,

View File

@@ -3,7 +3,7 @@ package app.revanced.integrations.patches;
import app.revanced.integrations.settings.SettingsEnum;
public final class HideFloatingMicrophoneButtonPatch {
public static boolean hideFloatingMicrophoneButton(boolean original) {
public static boolean hideFloatingMicrophoneButton(final boolean original) {
return SettingsEnum.HIDE_FLOATING_MICROPHONE_BUTTON.getBoolean() || original;
}
}

View File

@@ -0,0 +1,83 @@
package app.revanced.integrations.patches;
import android.widget.Toast;
import app.revanced.integrations.settings.SettingsEnum;
import app.revanced.integrations.utils.LogHelper;
import app.revanced.integrations.utils.ReVancedUtils;
public class SpoofSignatureVerificationPatch {
/**
* Protobuf parameters used by the player.
* Known issue: video preview not showing when using the seekbar.
*/
private static final String PROTOBUF_PARAMETER_GENERAL = "CgIQBg";
/**
* Protobuf parameter of shorts and YouTube stories.
* Known issue: captions are positioned on upper area in the player.
*/
private static final String PROTOBUF_PARAMETER_SHORTS = "8AEB"; // "8AEByAMTuAQP"
/**
* Target Protobuf parameters.
* Used by the generic player.
*/
private static final String PROTOBUF_PARAMETER_TARGET = "YADI";
/**
* Injection point.
*
* @param originalValue originalValue protobuf parameter
*/
public static String overrideProtobufParameter(String originalValue) {
try {
if (!SettingsEnum.SIGNATURE_SPOOFING.getBoolean()) {
return originalValue;
}
LogHelper.printDebug(() -> "Original protobuf parameter value: " + originalValue);
if (originalValue.startsWith(PROTOBUF_PARAMETER_TARGET) || originalValue.isEmpty()) {
return PROTOBUF_PARAMETER_SHORTS;
}
} catch (Exception ex) {
LogHelper.printException(() -> "overrideProtobufParameter failure", ex);
}
return originalValue;
}
/**
* Injection point. Runs off the main thread.
* <p>
* Used to check the response code of video playback requests made by YouTube.
* Response code of interest is 403 that indicate a signature verification failure for the current request
*
* @param responseCode HTTP status code of the completed YouTube connection
*/
public static void onResponse(int responseCode) {
try {
if (responseCode < 400 || responseCode >= 500) {
return; // everything normal
}
LogHelper.printDebug(() -> "YouTube HTTP status code: " + responseCode);
if (SettingsEnum.SIGNATURE_SPOOFING.getBoolean()) {
return; // already enabled
}
SettingsEnum.SIGNATURE_SPOOFING.saveValue(true);
ReVancedUtils.runOnMainThread(() -> {
Toast.makeText(
ReVancedUtils.getContext(),
"Spoofing app signature to prevent playback issues", Toast.LENGTH_LONG
).show();
// it would be great if the video could be forcefully reloaded, but currently there is no code to do this
});
} catch (Exception ex) {
LogHelper.printException(() -> "onResponse failure", ex);
}
}
}

View File

@@ -1,26 +0,0 @@
package app.revanced.integrations.patches;
import app.revanced.integrations.settings.SettingsEnum;
public class VideoBufferPatch {
public static int getMaxBuffer() {
int confVal = SettingsEnum.MAX_BUFFER.getInt();
if (confVal < 1) confVal = 1;
return confVal;
}
public static int getPlaybackBuffer() {
int confVal = SettingsEnum.PLAYBACK_MAX_BUFFER.getInt();
if (confVal < 1) confVal = 1;
return confVal;
}
public static int getReBuffer() {
int confVal = SettingsEnum.MAX_PLAYBACK_BUFFER_AFTER_REBUFFER.getInt();
if (confVal < 1) confVal = 1;
return confVal;
}
}

View File

@@ -1,21 +1,18 @@
package app.revanced.integrations.patches.playback.quality;
import android.annotation.SuppressLint;
import android.content.Context;
import android.net.ConnectivityManager;
import android.net.NetworkInfo;
import android.widget.Toast;
import app.revanced.integrations.settings.SettingsEnum;
import app.revanced.integrations.utils.LogHelper;
import app.revanced.integrations.utils.ReVancedUtils;
import app.revanced.integrations.utils.SharedPrefHelper;
import java.lang.reflect.Field;
import java.lang.reflect.Method;
import java.util.ArrayList;
import java.util.Collections;
import app.revanced.integrations.settings.SettingsEnum;
import app.revanced.integrations.utils.LogHelper;
import app.revanced.integrations.utils.ReVancedUtils;
import app.revanced.integrations.utils.SharedPrefHelper;
public class RememberVideoQualityPatch {
public static int selectedQuality1 = -2;
@@ -24,38 +21,37 @@ public class RememberVideoQualityPatch {
public static void changeDefaultQuality(int defaultQuality) {
Context context = ReVancedUtils.getContext();
if (isConnectedWifi(context)) {
try {
SharedPrefHelper.saveString(SharedPrefHelper.SharedPrefNames.REVANCED_PREFS, "wifi_quality", defaultQuality + "");
String message = "Changing default Wi-Fi quality to: " + defaultQuality;
LogHelper.printDebug(() -> message);
Toast.makeText(context, message, Toast.LENGTH_SHORT).show();
} catch (Exception ex) {
LogHelper.printException(() -> "Failed to change default WI-FI quality", ex);
}
} else if (isConnectedMobile(context)) {
try {
SharedPrefHelper.saveString(SharedPrefHelper.SharedPrefNames.REVANCED_PREFS, "mobile_quality", defaultQuality + "");
String message = "Changing default mobile data quality to:" + defaultQuality;
LogHelper.printDebug(() -> message);
Toast.makeText(context, message, Toast.LENGTH_SHORT).show();
} catch (Exception ex) {
LogHelper.printException(() -> "Failed to change default mobile data quality", ex);
}
} else {
var networkType = getNetworType(context);
if (networkType == NetworkType.NONE) {
String message = "No internet connection.";
LogHelper.printDebug(() -> message);
Toast.makeText(context, message, Toast.LENGTH_SHORT).show();
} else {
var preferenceKey = "wifi_quality";
var networkTypeMessage = "WIFI";
if (networkType == NetworkType.MOBILE) {
networkTypeMessage = "mobile";
preferenceKey = "mobile_quality";
}
SharedPrefHelper.saveString(SharedPrefHelper.SharedPrefNames.REVANCED_PREFS, preferenceKey, defaultQuality + "");
String message = "Changing default " + networkTypeMessage + " quality to: " + defaultQuality;
Toast.makeText(context, message, Toast.LENGTH_SHORT).show();
}
userChangedQuality = false;
}
public static int setVideoQuality(Object[] qualities, int quality, Object qInterface, String qIndexMethod) {
int preferredQuality;
Field[] fields;
if (!(newVideo || userChangedQuality) || qInterface == null) {
return quality;
}
Class<?> intType = Integer.TYPE;
ArrayList<Integer> iStreamQualities = new ArrayList<>();
try {
@@ -93,51 +89,48 @@ public class RememberVideoQualityPatch {
LogHelper.printException(() -> "Context is null or settings not initialized, returning quality: " + qualityToLog);
return quality;
}
if (isConnectedWifi(context)) {
preferredQuality = SharedPrefHelper.getInt(SharedPrefHelper.SharedPrefNames.REVANCED_PREFS, "wifi_quality", -2);
LogHelper.printDebug(() -> "Wi-Fi connection detected, preferred quality: " + preferredQuality);
} else if (isConnectedMobile(context)) {
preferredQuality = SharedPrefHelper.getInt(SharedPrefHelper.SharedPrefNames.REVANCED_PREFS, "mobile_quality", -2);
LogHelper.printDebug(() -> "Mobile data connection detected, preferred quality: " + preferredQuality);
} else {
var networkType = getNetworType(context);
if (networkType == NetworkType.NONE) {
LogHelper.printDebug(() -> "No Internet connection!");
return quality;
}
if (preferredQuality == -2) {
return quality;
}
for (int streamQuality2 : iStreamQualities) {
final int indexToLog = index;
LogHelper.printDebug(() -> "Quality at index " + indexToLog + ": " + streamQuality2);
index++;
}
for (Integer iStreamQuality : iStreamQualities) {
int streamQuality3 = iStreamQuality;
if (streamQuality3 <= preferredQuality) {
quality = streamQuality3;
} else {
var preferenceKey = "wifi_quality";
if (networkType == NetworkType.MOBILE) preferenceKey = "mobile_quality";
int preferredQuality = SharedPrefHelper.getInt(SharedPrefHelper.SharedPrefNames.REVANCED_PREFS, preferenceKey, -2);
if (preferredQuality == -2) return quality;
for (int streamQuality2 : iStreamQualities) {
final int indexToLog = index;
LogHelper.printDebug(() -> "Quality at index " + indexToLog + ": " + streamQuality2);
index++;
}
for (Integer iStreamQuality : iStreamQualities) {
int streamQuality3 = iStreamQuality;
if (streamQuality3 <= preferredQuality) {
quality = streamQuality3;
}
}
if (quality == -2) return quality;
int qualityIndex = iStreamQualities.indexOf(quality);
final int qualityToLog2 = quality;
LogHelper.printDebug(() -> "Index of quality " + qualityToLog2 + " is " + qualityIndex);
try {
Class<?> cl = qInterface.getClass();
Method m = cl.getMethod(qIndexMethod, Integer.TYPE);
LogHelper.printDebug(() -> "Method is: " + qIndexMethod);
m.invoke(qInterface, iStreamQualities.get(qualityIndex));
LogHelper.printDebug(() -> "Quality changed to: " + qualityIndex);
return qualityIndex;
} catch (Exception ex) {
LogHelper.printException(() -> "Failed to set quality", ex);
return qualityIndex;
}
}
if (quality == -2) {
return quality;
}
int qualityIndex = iStreamQualities.indexOf(quality);
final int qualityToLog2 = quality;
LogHelper.printDebug(() -> "Index of quality " + qualityToLog2 + " is " + qualityIndex);
try {
Class<?> cl = qInterface.getClass();
Method m = cl.getMethod(qIndexMethod, Integer.TYPE);
LogHelper.printDebug(() -> "Method is: " + qIndexMethod);
m.invoke(qInterface, iStreamQualities.get(qualityIndex));
LogHelper.printDebug(() -> "Quality changed to: " + qualityIndex);
return qualityIndex;
} catch (Exception ex) {
LogHelper.printException(() -> "Failed to set quality", ex);
return qualityIndex;
}
}
public static void userChangedQuality(int selectedQuality) {
// Do not remember a **new** quality if REMEMBER_VIDEO_QUALITY is false
if (!SettingsEnum.REMEMBER_VIDEO_QUALITY_LAST_SELECTED.getBoolean()) return;
selectedQuality1 = selectedQuality;
@@ -148,20 +141,23 @@ public class RememberVideoQualityPatch {
newVideo = true;
}
@SuppressLint("MissingPermission")
private static NetworkInfo getNetworkInfo(Context context) {
private static NetworkType getNetworType(Context context) {
ConnectivityManager cm = (ConnectivityManager) context.getSystemService(Context.CONNECTIVITY_SERVICE);
return cm.getActiveNetworkInfo();
var networkInfo = cm.getActiveNetworkInfo();
if (networkInfo == null || !networkInfo.isConnected()) {
return NetworkType.NONE;
} else {
var type = networkInfo.getType();
return type == ConnectivityManager.TYPE_MOBILE || type == ConnectivityManager.TYPE_BLUETOOTH ? NetworkType.MOBILE : NetworkType.OTHER;
}
}
private static boolean isConnectedWifi(Context context) {
NetworkInfo info = getNetworkInfo(context);
return info != null && info.isConnected() && info.getType() == 1;
}
private static boolean isConnectedMobile(Context context) {
NetworkInfo info = getNetworkInfo(context);
return info != null && info.isConnected() && info.getType() == 0;
enum NetworkType {
MOBILE,
OTHER,
NONE
}
}

View File

@@ -93,10 +93,10 @@ public enum SettingsEnum {
HIDE_WATCH_IN_VR("revanced_hide_watch_in_vr", false, ReturnType.BOOLEAN, true),
HIDE_BREAKING_NEWS("revanced_hide_breaking_news", true, ReturnType.BOOLEAN, true),
HIDE_PLAYER_BUTTONS("revanced_hide_player_buttons", false, ReturnType.BOOLEAN),
HIDE_FLOATING_MICROPHONE_BUTTON("revanced_hide_floating_microphone_button", true, ReturnType.BOOLEAN),
HIDE_FLOATING_MICROPHONE_BUTTON("revanced_hide_floating_microphone_button", true, ReturnType.BOOLEAN, true),
// Misc. Settings
FIX_PLAYBACK("revanced_fix_playback", false, ReturnType.BOOLEAN),
SIGNATURE_SPOOFING("revanced_spoof_signature_verification", false, ReturnType.BOOLEAN),
CAPTIONS_ENABLED("revanced_autocaptions_enabled", false, ReturnType.BOOLEAN),
PREFERRED_AUTO_REPEAT("revanced_pref_auto_repeat", false, ReturnType.BOOLEAN),
USE_HDR_AUTO_BRIGHTNESS("revanced_pref_hdr_autobrightness", true, ReturnType.BOOLEAN),
@@ -116,11 +116,6 @@ public enum SettingsEnum {
SWIPE_OVERLAY_BACKGROUND_ALPHA("revanced_swipe_overlay_background_alpha", 127, ReturnType.INTEGER),
SWIPE_MAGNITUDE_THRESHOLD("revanced_swipe_magnitude_threshold", 30f, ReturnType.FLOAT),
// Buffer settings
MAX_BUFFER("revanced_pref_max_buffer_ms", 120000, ReturnType.INTEGER),
PLAYBACK_MAX_BUFFER("revanced_pref_buffer_for_playback_ms", 2500, ReturnType.INTEGER),
MAX_PLAYBACK_BUFFER_AFTER_REBUFFER("revanced_pref_buffer_for_playback_after_rebuffer_ms", 5000, ReturnType.INTEGER),
// Debug settings
DEBUG("revanced_debug_enabled", false, ReturnType.BOOLEAN),
DEBUG_STACKTRACE("revanced_debug_stacktrace_enabled", false, ReturnType.BOOLEAN),

View File

@@ -1,3 +1,3 @@
org.gradle.jvmargs = -Xmx2048m
android.useAndroidX = true
version = 0.100.0-dev.5
version = 0.101.0-dev.1