mirror of
https://github.com/revanced/revanced-integrations.git
synced 2024-06-07 05:38:03 +02:00
20 lines
786 B
Java
20 lines
786 B
Java
package app.revanced.integrations.patches;
|
|
|
|
import app.revanced.integrations.settings.SettingsEnum;
|
|
|
|
public class OpenLinksExternallyPatch {
|
|
/**
|
|
* Override 'android.support.customtabs.action.CustomTabsService',
|
|
* in order to open links in the default browser. This is done by returning an empty string,
|
|
* for the service that handles custom tabs in the Android support library
|
|
* which opens links in the default service instead.
|
|
*
|
|
* @param original The original custom tabs service.
|
|
* @return The new, default service to open links with or the original service.
|
|
*/
|
|
public static String enableExternalBrowser(String original) {
|
|
if (SettingsEnum.ENABLE_EXTERNAL_BROWSER.getBoolean()) original = "";
|
|
return original;
|
|
}
|
|
}
|