This repository has been archived by the owner on Oct 26, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 250
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: some more refactoring and cleanup (#21)
* refactor: integrations and prepare new patches * bugfixes * fix critical bug * prepare BrandingWaterMark patch * fixing create button * dont use Strings in ReVancedSettingsFragment when we have a wonderful enum for that * rename classes from fenster to Swipe * push * exclude android packages from build
- Loading branch information
1 parent
0938f6c
commit 9b1dce4
Showing
47 changed files
with
990 additions
and
1,227 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 12 additions & 0 deletions
12
app/src/main/java/app/revanced/integrations/patches/AutoRepeatPatch.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
package app.revanced.integrations.patches; | ||
|
||
import app.revanced.integrations.settings.SettingsEnum; | ||
|
||
public class AutoRepeatPatch { | ||
|
||
//ToDo: Write Patch for it. | ||
//See https://drive.google.com/file/d/1hLl71Mm3oAtgTjNvsYZi3CUutCPx2gjS/view?usp=sharing for where it needs to be used. | ||
public static boolean shouldAutoRepeat() { | ||
return SettingsEnum.PREFERRED_AUTO_REPEAT_BOOLEAN.getBoolean(); | ||
} | ||
} |
12 changes: 12 additions & 0 deletions
12
app/src/main/java/app/revanced/integrations/patches/BrandingWaterMarkPatch.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
package app.revanced.integrations.patches; | ||
|
||
import app.revanced.integrations.adremover.AdRemoverAPI; | ||
import app.revanced.integrations.settings.SettingsEnum; | ||
|
||
public class BrandingWaterMarkPatch { | ||
|
||
//Used by: app.revanced.patches.youtube.layout.watermark.patch.HideWatermarkPatch | ||
public static boolean isBrandingWatermarkShown() { | ||
return SettingsEnum.BRANDING_SHOWN_BOOLEAN.getBoolean(); | ||
} | ||
} |
15 changes: 15 additions & 0 deletions
15
app/src/main/java/app/revanced/integrations/patches/HDRMaxBrightnessPatch.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
package app.revanced.integrations.patches; | ||
|
||
import app.revanced.integrations.settings.SettingsEnum; | ||
import app.revanced.integrations.videoswipecontrols.helpers.BrightnessHelper; | ||
|
||
public class HDRMaxBrightnessPatch { | ||
|
||
//ToDo: Write Patch for it. | ||
//See https://drive.google.com/file/d/1rIJzsaMQouH_2__EcVY5Dg6l7ji9vsyP/view?usp=sharing for where it needs to be used. | ||
public static float getHDRBrightness(float original) { | ||
if (!SettingsEnum.USE_HDR_BRIGHTNESS_BOOLEAN.getBoolean()) return original; | ||
return SettingsEnum.ENABLE_SWIPE_BRIGHTNESS_BOOLEAN.getBoolean() ? BrightnessHelper.getBrightness() : -1.0f; | ||
} | ||
|
||
} |
14 changes: 14 additions & 0 deletions
14
app/src/main/java/app/revanced/integrations/patches/MiniplayerOverridePatch.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
package app.revanced.integrations.patches; | ||
|
||
import app.revanced.integrations.settings.SettingsEnum; | ||
|
||
public class MiniplayerOverridePatch { | ||
|
||
//ToDo: Write Patch for it. | ||
//See https://drive.google.com/file/d/1G7jn2EdWgNls0Htgs-wPPjjObZL1emzK/view?usp=sharing | ||
//And https://drive.google.com/file/d/1-QlgSiKzqQ5lHXQnvRUpijk0GH9T1Sn7/view?usp=sharing | ||
// for where it needs to be used. | ||
public static boolean getTabletMiniplayerOverride() { | ||
return SettingsEnum.USE_TABLET_MINIPLAYER_BOOLEAN.getBoolean(); | ||
} | ||
} |
13 changes: 13 additions & 0 deletions
13
app/src/main/java/app/revanced/integrations/patches/NewActionbarPatch.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
package app.revanced.integrations.patches; | ||
|
||
import app.revanced.integrations.settings.SettingsEnum; | ||
|
||
public class NewActionbarPatch { | ||
|
||
//ToDo: Write Patch for it. | ||
//See https://drive.google.com/file/d/1Jg2WK9wwSABCiIcqclzhedy3J3RCf3Hn/view?usp=sharing for where it needs to be used. | ||
public static boolean getNewActionBar() { | ||
return SettingsEnum.USE_NEW_ACTIONBAR_BOOLEAN.getBoolean(); | ||
} | ||
|
||
} |
13 changes: 13 additions & 0 deletions
13
app/src/main/java/app/revanced/integrations/patches/OverrideCodecPatch.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
package app.revanced.integrations.patches; | ||
|
||
import app.revanced.integrations.settings.SettingsEnum; | ||
|
||
public class OverrideCodecPatch { | ||
|
||
//ToDo: Write Patch for it. | ||
//See https://drive.google.com/file/d/14d2R-5JF97gOZggoobVEVazPWbORbZVp/view?usp=sharing for where it needs to be used. | ||
public static boolean isOverrideCodedUsed() { | ||
return SettingsEnum.CODEC_OVERRIDE_BOOLEAN.getBoolean(); | ||
} | ||
|
||
} |
26 changes: 26 additions & 0 deletions
26
app/src/main/java/app/revanced/integrations/patches/VideoBufferPatch.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
package app.revanced.integrations.patches; | ||
|
||
import app.revanced.integrations.settings.SettingsEnum; | ||
|
||
public class VideoBufferPatch { | ||
|
||
//ToDo: Write Patch for it. | ||
//See https://drive.google.com/file/d/1LSZZX4NgBIlN0dDCzyI7cECtgbXVg_1j/view?usp=sharing for where it needs to be used. | ||
public static int getMaxBuffer(int original) { | ||
return SettingsEnum.MAX_BUFFER_INTEGER.getInt(); | ||
} | ||
|
||
//ToDo: Write Patch for it. | ||
//See https://drive.google.com/file/d/1gIUqPIMq-XP-edT_9wQN1RbmVnk9tJN8/view?usp=sharing for where it needs to be used. | ||
public static int getPlaybackBuffer(int original) { | ||
return SettingsEnum.PLAYBACK_MAX_BUFFER_INTEGER.getInt(); | ||
} | ||
|
||
//ToDo: Write Patch for it. | ||
//See https://drive.google.com/file/d/1ywL7SxvWrBIIbuZ1YoUIKdZM-U8H_w-p/view?usp=sharing for where it needs to be used. | ||
public static int getReBuffer(int original) { | ||
return SettingsEnum.MAX_PLAYBACK_BUFFER_AFTER_REBUFFER_INTEGER.getInt(); | ||
} | ||
|
||
|
||
} |
17 changes: 17 additions & 0 deletions
17
app/src/main/java/app/revanced/integrations/patches/VideoQualityPatch.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
package app.revanced.integrations.patches; | ||
|
||
import app.revanced.integrations.videoplayer.videosettings.VideoQuality; | ||
|
||
public class VideoQualityPatch { | ||
|
||
//ToDo: Write Patch for it. | ||
//See https://drive.google.com/file/d/1goodaU0JWrO9BAOUn6El-Id1SNuMGHR9/view?usp=sharing for where it needs to be used. | ||
public static int setVideoQuality(Object[] qualities, int quality, Object qInterface) { | ||
return VideoQuality.setVideoQuality(qualities, quality, qInterface); | ||
} | ||
|
||
//See https://drive.google.com/file/d/1_cgCf603XKk4gEbbsmWGtndNt5UJ0np7/view?usp=sharing for usage | ||
public static void userChangedQuality() { | ||
VideoQuality.userChangedQuality(); | ||
} | ||
} |
51 changes: 51 additions & 0 deletions
51
app/src/main/java/app/revanced/integrations/patches/VideoSwipeControlsPatch.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
package app.revanced.integrations.patches; | ||
|
||
import android.content.Context; | ||
import android.view.MotionEvent; | ||
import android.view.ViewConfiguration; | ||
import android.view.ViewGroup; | ||
|
||
import app.revanced.integrations.settings.SettingsEnum; | ||
import app.revanced.integrations.sponsorblock.player.PlayerType; | ||
import app.revanced.integrations.utils.ReVancedUtils; | ||
import app.revanced.integrations.utils.SwipeHelper; | ||
import app.revanced.integrations.videoswipecontrols.SwipeControlAPI; | ||
|
||
public class VideoSwipeControlsPatch { | ||
|
||
//ToDo: Write Patch for it. | ||
//See https://drive.google.com/file/d/1FTPRrp6NcIF5LC_ByST1a0wcNoGKcAYS/view?usp=sharing for where it needs to be used. | ||
public static void InitializeFensterController(Context context, ViewGroup viewGroup, ViewConfiguration viewConfiguration) { | ||
SwipeControlAPI.InitializeFensterController(context, viewGroup, viewConfiguration); | ||
} | ||
|
||
//ToDo: Write Patch for it. | ||
//See https://drive.google.com/file/d/1Q9TIDDKvc-nQuJWLmCh7jx3ohxPdFIrZ/view?usp=sharing | ||
//And https://drive.google.com/file/d/1byP5SItks9MYB3fDVC39xH_6nBbaH9NY/view?usp=sharing | ||
// for where it needs to be used. | ||
public static boolean FensterTouchEvent(MotionEvent motionEvent) { | ||
return SwipeControlAPI.FensterTouchEvent(motionEvent); | ||
} | ||
|
||
//ToDo: Write Patch for it. | ||
//See https://drive.google.com/file/d/1qKmaX4yzAjzYM6T5uUiRtbMxk2zJlwtd/view?usp=sharing for where it needs to be used. | ||
public static boolean isSwipeControlBrightnessEnabled() { | ||
return SettingsEnum.ENABLE_SWIPE_BRIGHTNESS_BOOLEAN.getBoolean(); | ||
} | ||
|
||
//ToDo: Write Patch for it. | ||
//See https://drive.google.com/file/d/1TMQxs0ul2_p5_GomE-3J1QWO__M189Da/view?usp=sharing for where it needs to be used. | ||
public static void PlayerTypeChanged(PlayerType playerType) { | ||
SwipeControlAPI.PlayerTypeChanged(playerType); | ||
} | ||
|
||
//ToDo: Write Patch for it. | ||
//See https://drive.google.com/file/d/1EoVAyqWOMGUDCovuDb27yeQJBk_CyKsY/view?usp=sharing for where it needs to be used. | ||
public static boolean isSwipeControlEnabled() { | ||
if (ReVancedUtils.getPlayerType() != null && ReVancedUtils.getPlayerType() == PlayerType.WATCH_WHILE_FULLSCREEN && !SwipeHelper.IsControlsShown()) { | ||
return SettingsEnum.ENABLE_SWIPE_BRIGHTNESS_BOOLEAN.getBoolean() || SettingsEnum.ENABLE_SWIPE_VOLUME_BOOLEAN.getBoolean(); | ||
} | ||
return false; | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.