mirror of
https://github.com/revanced/revanced-patches
synced 2025-02-14 14:36:49 +01:00
chore: Refactor build files
This commit improves the build files by using Gradle version catalogs and modernizes the Android build files. Additionally dependencies have been updated and some source files refactored.
This commit is contained in:
parent
c9c5f5f8e4
commit
d52d9ff238
@ -1,5 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
|
||||
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
|
||||
<uses-permission android:name="android.permission.SCHEDULE_EXACT_ALARM" />
|
||||
</manifest>
|
||||
|
@ -28,7 +28,7 @@ public class AppCompatActivityHook {
|
||||
public static void startSettingsActivity() {
|
||||
Logger.printDebug(() -> "Launching ReVanced settings");
|
||||
|
||||
final var context = app.revanced.integrations.shared.Utils.getContext();
|
||||
final var context = Utils.getContext();
|
||||
|
||||
if (context != null) {
|
||||
Intent intent = new Intent(context, SettingsActivity.class);
|
||||
|
@ -422,7 +422,7 @@ public final class AlternativeThumbnailsPatch {
|
||||
private static final int CACHE_LIMIT = 1000;
|
||||
|
||||
@Override
|
||||
protected boolean removeEldestEntry(Map.Entry eldest) {
|
||||
protected boolean removeEldestEntry(Entry eldest) {
|
||||
return size() > CACHE_LIMIT; // Evict the oldest entry if over the cache limit.
|
||||
}
|
||||
};
|
||||
|
@ -667,7 +667,7 @@ public class ReturnYouTubeDislikePatch {
|
||||
*
|
||||
* Called when the user likes or dislikes.
|
||||
*
|
||||
* @param vote int that matches {@link ReturnYouTubeDislike.Vote#value}
|
||||
* @param vote int that matches {@link Vote#value}
|
||||
*/
|
||||
public static void sendVote(int vote) {
|
||||
try {
|
||||
|
@ -45,7 +45,7 @@ public final class ReturnYouTubeDislikeFilterPatch extends Filter {
|
||||
private static final int NUMBER_OF_LAST_VIDEO_IDS_TO_TRACK = 5;
|
||||
|
||||
@Override
|
||||
protected boolean removeEldestEntry(Map.Entry eldest) {
|
||||
protected boolean removeEldestEntry(Entry eldest) {
|
||||
return size() > NUMBER_OF_LAST_VIDEO_IDS_TO_TRACK;
|
||||
}
|
||||
};
|
||||
|
@ -2,10 +2,10 @@ package app.revanced.integrations.youtube.requests;
|
||||
|
||||
public class Route {
|
||||
private final String route;
|
||||
private final Route.Method method;
|
||||
private final Method method;
|
||||
private final int paramCount;
|
||||
|
||||
public Route(Route.Method method, String route) {
|
||||
public Route(Method method, String route) {
|
||||
this.method = method;
|
||||
this.route = route;
|
||||
this.paramCount = countMatches(route, '{');
|
||||
@ -14,11 +14,11 @@ public class Route {
|
||||
throw new IllegalArgumentException("Not enough parameters");
|
||||
}
|
||||
|
||||
public Route.Method getMethod() {
|
||||
public Method getMethod() {
|
||||
return method;
|
||||
}
|
||||
|
||||
public Route.CompiledRoute compile(String... params) {
|
||||
public CompiledRoute compile(String... params) {
|
||||
if (params.length != paramCount)
|
||||
throw new IllegalArgumentException("Error compiling route [" + route + "], incorrect amount of parameters provided. " +
|
||||
"Expected: " + paramCount + ", provided: " + params.length);
|
||||
@ -29,7 +29,7 @@ public class Route {
|
||||
int paramEnd = compiledRoute.indexOf("}");
|
||||
compiledRoute.replace(paramStart, paramEnd + 1, params[i]);
|
||||
}
|
||||
return new Route.CompiledRoute(this, compiledRoute.toString());
|
||||
return new CompiledRoute(this, compiledRoute.toString());
|
||||
}
|
||||
|
||||
public static class CompiledRoute {
|
||||
@ -45,7 +45,7 @@ public class Route {
|
||||
return compiledRoute;
|
||||
}
|
||||
|
||||
public Route.Method getMethod() {
|
||||
public Method getMethod() {
|
||||
return baseRoute.method;
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user