mirror of
https://github.com/revanced/revanced-integrations.git
synced 2024-11-09 13:47:02 +01:00
parent
a061614d86
commit
0be0ffd42a
@ -18,6 +18,7 @@ import android.preference.PreferenceFragment;
|
|||||||
import android.preference.PreferenceScreen;
|
import android.preference.PreferenceScreen;
|
||||||
import android.preference.SwitchPreference;
|
import android.preference.SwitchPreference;
|
||||||
|
|
||||||
|
import com.google.android.apps.youtube.app.YouTubeTikTokRoot_Application;
|
||||||
import com.google.android.apps.youtube.app.application.Shell_HomeActivity;
|
import com.google.android.apps.youtube.app.application.Shell_HomeActivity;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@ -173,7 +174,7 @@ public class ReVancedSettingsFragment extends PreferenceFragment {
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
private String getPackageName() {
|
private String getPackageName() {
|
||||||
Context context = ReVancedUtils.getContext();
|
Context context = YouTubeTikTokRoot_Application.getAppContext();
|
||||||
if (context == null) {
|
if (context == null) {
|
||||||
LogHelper.printException(ReVancedSettingsFragment.class, "Context is null, returning com.google.android.youtube!");
|
LogHelper.printException(ReVancedSettingsFragment.class, "Context is null, returning com.google.android.youtube!");
|
||||||
return "com.google.android.youtube";
|
return "com.google.android.youtube";
|
||||||
|
@ -5,6 +5,8 @@ import android.content.res.Resources;
|
|||||||
import android.os.Handler;
|
import android.os.Handler;
|
||||||
import android.os.Looper;
|
import android.os.Looper;
|
||||||
|
|
||||||
|
import com.google.android.apps.youtube.app.YouTubeTikTokRoot_Application;
|
||||||
|
|
||||||
import app.revanced.integrations.sponsorblock.player.PlayerType;
|
import app.revanced.integrations.sponsorblock.player.PlayerType;
|
||||||
|
|
||||||
public class ReVancedUtils {
|
public class ReVancedUtils {
|
||||||
@ -15,6 +17,13 @@ public class ReVancedUtils {
|
|||||||
//Used by Integrations patch
|
//Used by Integrations patch
|
||||||
public static Context context;
|
public static Context context;
|
||||||
//Used by Integrations patch
|
//Used by Integrations patch
|
||||||
|
public static Context getAppContext() {
|
||||||
|
if (context != null) {
|
||||||
|
return context;
|
||||||
|
}
|
||||||
|
LogHelper.printException(ReVancedUtils.class, "Context is null!");
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
public static void setNewVideo(boolean started) {
|
public static void setNewVideo(boolean started) {
|
||||||
LogHelper.debug(ReVancedUtils.class, "New video started: " + started);
|
LogHelper.debug(ReVancedUtils.class, "New video started: " + started);
|
||||||
@ -52,6 +61,7 @@ public class ReVancedUtils {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static Context getContext() {
|
public static Context getContext() {
|
||||||
|
Context context = YouTubeTikTokRoot_Application.getAppContext();
|
||||||
if (context != null) {
|
if (context != null) {
|
||||||
return context;
|
return context;
|
||||||
} else {
|
} else {
|
||||||
|
@ -0,0 +1,10 @@
|
|||||||
|
package com.google.android.apps.youtube.app;
|
||||||
|
|
||||||
|
import android.app.Application;
|
||||||
|
import android.content.Context;
|
||||||
|
|
||||||
|
public class YouTubeTikTokRoot_Application extends Application {
|
||||||
|
public static Context getAppContext() {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user