1
mirror of https://github.com/revanced/revanced-integrations synced 2025-11-21 18:35:37 +01:00

Compare commits

...

8 Commits

Author SHA1 Message Date
semantic-release-bot
32dc8a846c chore(release): 0.94.0-dev.3 [skip ci]
# [0.94.0-dev.3](https://github.com/revanced/revanced-integrations/compare/v0.94.0-dev.2...v0.94.0-dev.3) (2023-01-22)

### Bug Fixes

* **youtube/return-youtube-dislike:** gracefully exit if Vanced MicroG is missing or not running ([#303](https://github.com/revanced/revanced-integrations/issues/303)) ([03764bc](03764bcc65))
2023-01-22 19:23:44 +00:00
LisoUseInAIKyrios
03764bcc65 fix(youtube/return-youtube-dislike): gracefully exit if Vanced MicroG is missing or not running (#303)
Co-authored-by: oSumAtrIX <johan.melkonyan1@web.de>
2023-01-22 20:22:02 +01:00
semantic-release-bot
0127e7251c chore(release): 0.94.0-dev.2 [skip ci]
# [0.94.0-dev.2](https://github.com/revanced/revanced-integrations/compare/v0.94.0-dev.1...v0.94.0-dev.2) (2023-01-22)

### Features

* **youtube/microg-support:** check if Vanced MicroG is running in the background ([#301](https://github.com/revanced/revanced-integrations/issues/301)) ([6e31b78](6e31b7889a))
2023-01-22 16:21:15 +00:00
reis
6e31b7889a feat(youtube/microg-support): check if Vanced MicroG is running in the background (#301)
Signed-off-by: oSumAtrIX <johan.melkonyan1@web.de>
Co-authored-by: oSumAtrIX <johan.melkonyan1@web.de>
2023-01-22 17:18:55 +01:00
semantic-release-bot
057e599aec chore(release): 0.94.0-dev.1 [skip ci]
# [0.94.0-dev.1](https://github.com/revanced/revanced-integrations/compare/v0.93.2-dev.1...v0.94.0-dev.1) (2023-01-22)

### Features

* **youtube:** `open-links-externally` patch ([4cbe833](4cbe8338b3))
2023-01-22 14:51:44 +00:00
Rizwan
4cbe8338b3 feat(youtube): open-links-externally patch 2023-01-22 15:49:14 +01:00
semantic-release-bot
d65a107c53 chore(release): 0.93.2-dev.1 [skip ci]
## [0.93.2-dev.1](https://github.com/revanced/revanced-integrations/compare/v0.93.1...v0.93.2-dev.1) (2023-01-21)

### Bug Fixes

* **youtube:** save new instead of default value ([#298](https://github.com/revanced/revanced-integrations/issues/298)) ([559bbf9](559bbf9778))
2023-01-21 22:20:12 +00:00
LisoUseInAIKyrios
559bbf9778 fix(youtube): save new instead of default value (#298) 2023-01-21 23:17:50 +01:00
5 changed files with 79 additions and 14 deletions

View File

@@ -1,3 +1,31 @@
# [0.94.0-dev.3](https://github.com/revanced/revanced-integrations/compare/v0.94.0-dev.2...v0.94.0-dev.3) (2023-01-22)
### Bug Fixes
* **youtube/return-youtube-dislike:** gracefully exit if Vanced MicroG is missing or not running ([#303](https://github.com/revanced/revanced-integrations/issues/303)) ([03764bc](https://github.com/revanced/revanced-integrations/commit/03764bcc651c6b723a999a58ed9cc9d253075905))
# [0.94.0-dev.2](https://github.com/revanced/revanced-integrations/compare/v0.94.0-dev.1...v0.94.0-dev.2) (2023-01-22)
### Features
* **youtube/microg-support:** check if Vanced MicroG is running in the background ([#301](https://github.com/revanced/revanced-integrations/issues/301)) ([6e31b78](https://github.com/revanced/revanced-integrations/commit/6e31b7889a2488b3d61042111437a6ed4eec019c))
# [0.94.0-dev.1](https://github.com/revanced/revanced-integrations/compare/v0.93.2-dev.1...v0.94.0-dev.1) (2023-01-22)
### Features
* **youtube:** `open-links-externally` patch ([4cbe833](https://github.com/revanced/revanced-integrations/commit/4cbe8338b3f4ab49139168d7a3d0c9ebebf68952))
## [0.93.2-dev.1](https://github.com/revanced/revanced-integrations/compare/v0.93.1...v0.93.2-dev.1) (2023-01-21)
### Bug Fixes
* **youtube:** save new instead of default value ([#298](https://github.com/revanced/revanced-integrations/issues/298)) ([559bbf9](https://github.com/revanced/revanced-integrations/commit/559bbf9778f20ac0f5ce3af677230a1ec28a55ff))
## [0.93.1](https://github.com/revanced/revanced-integrations/compare/v0.93.0...v0.93.1) (2023-01-17)

View File

@@ -2,11 +2,14 @@ package app.revanced.integrations.patches;
import static app.revanced.integrations.sponsorblock.StringRef.str;
import android.content.Context;
import android.content.Intent;
import android.content.pm.PackageManager;
import android.net.Uri;
import android.widget.Toast;
import java.util.Objects;
import app.revanced.integrations.utils.LogHelper;
import app.revanced.integrations.utils.ReVancedUtils;
@@ -14,21 +17,35 @@ public class MicroGSupport {
private static final String MICROG_VENDOR = "com.mgoogle";
private static final String MICROG_PACKAGE_NAME = "com.mgoogle.android.gms";
private static final String VANCED_MICROG_DOWNLOAD_LINK = "https://github.com/TeamVanced/VancedMicroG/releases/latest";
private static final String DONT_KILL_MY_APP_LINK = "https://dontkillmyapp.com";
private static final Uri VANCED_MICROG_PROVIDER = Uri.parse("content://com.mgoogle.android.gsf.gservices/prefix");
private static void startIntent(Context context, String uriString, String message) {
Toast.makeText(context, message, Toast.LENGTH_LONG).show();
var intent = new Intent(Intent.ACTION_VIEW);
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
intent.setData(Uri.parse(uriString));
context.startActivity(intent);
}
public static void checkAvailability() {
var context = ReVancedUtils.getContext();
assert context != null;
var context = Objects.requireNonNull(ReVancedUtils.getContext());
try {
context.getPackageManager().getPackageInfo(MICROG_PACKAGE_NAME, PackageManager.GET_ACTIVITIES);
LogHelper.printDebug(() -> "MicroG is installed on the device");
} catch (PackageManager.NameNotFoundException exception) {
LogHelper.printException(() -> ("MicroG was not found"), exception);
Toast.makeText(context, str("microg_not_installed_warning"), Toast.LENGTH_LONG).show();
LogHelper.printException(() -> ("Vanced MicroG was not found"), exception);
startIntent(context, VANCED_MICROG_DOWNLOAD_LINK, str("microg_not_installed_warning"));
var intent = new Intent(Intent.ACTION_VIEW);
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
intent.setData(Uri.parse(VANCED_MICROG_DOWNLOAD_LINK));
context.startActivity(intent);
// Gracefully exit the app, so it does not crash.
System.exit(0);
}
try (var client = context.getContentResolver().acquireContentProviderClient(VANCED_MICROG_PROVIDER)) {
if (client != null) return;
LogHelper.printException(() -> ("Vanced MicroG is not running in the background"));
startIntent(context, DONT_KILL_MY_APP_LINK, str("microg_not_running_warning"));
}
}
}

View File

@@ -0,0 +1,19 @@
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;
}
}

View File

@@ -100,6 +100,7 @@ public enum SettingsEnum {
ENABLE_MINIMIZED_PLAYBACK("revanced_enable_minimized_playback", true, ReturnType.BOOLEAN),
OPEN_LINKS_DIRECTLY("revanced_uri_redirect", true, ReturnType.BOOLEAN, true),
DISABLE_ZOOM_HAPTICS("revanced_disable_zoom_haptics", true, ReturnType.BOOLEAN, false),
ENABLE_EXTERNAL_BROWSER("revanced_enable_external_browser", true, ReturnType.BOOLEAN, true),
// Swipe controls
ENABLE_SWIPE_BRIGHTNESS("revanced_enable_swipe_brightness", true, ReturnType.BOOLEAN),
@@ -343,19 +344,19 @@ public enum SettingsEnum {
switch (getReturnType()) {
case FLOAT:
SharedPrefHelper.saveFloat(sharedPref, path, (float) defaultValue);
SharedPrefHelper.saveFloat(sharedPref, path, (float) newValue);
break;
case LONG:
SharedPrefHelper.saveLong(sharedPref, path, (long) defaultValue);
SharedPrefHelper.saveLong(sharedPref, path, (long) newValue);
break;
case BOOLEAN:
SharedPrefHelper.saveBoolean(sharedPref, path, (boolean) newValue);
break;
case INTEGER:
SharedPrefHelper.saveInt(sharedPref, path, (int) defaultValue);
SharedPrefHelper.saveInt(sharedPref, path, (int) newValue);
break;
case STRING:
SharedPrefHelper.saveString(sharedPref, path, (String) defaultValue);
SharedPrefHelper.saveString(sharedPref, path, (String) newValue);
break;
default:
LogHelper.printException(() -> ("Setting does not have a valid Type. Name is: " + name()));

View File

@@ -1,3 +1,3 @@
org.gradle.jvmargs = -Xmx2048m
android.useAndroidX = true
version = 0.93.1
version = 0.94.0-dev.3