mirror of
https://github.com/inotia00/revanced-patches.git
synced 2025-06-12 21:27:43 +02:00
refactor(GmsCore support): Remove unnecessary constants and disable unused services (#119)
* fix(GmsCore support): Firebase installations error * feat: Remove unnecessary Constants (Match with uDrop) * feat: Remove signature spoofing that degrades performance (No longer resolves playback issues) * Move `SSLGuard disabler` to `GmsCore support` patch * feat: Disable `PrimeApi` * revert: Do not disable Cast V2 * feat: Disable ECatcher spam logging * revert: Disable Advertising Id (Advertising Id can no longer be fetched from GmsCore) --------- Co-authored-by: inotia00 <108592928+inotia00@users.noreply.github.com>
This commit is contained in:
@ -36,9 +36,6 @@ public class GmsCoreSupport {
|
||||
private static final String DONT_KILL_MY_APP_LINK
|
||||
= "https://dontkillmyapp.com";
|
||||
|
||||
private static final String META_SPOOF_PACKAGE_NAME =
|
||||
GMS_CORE_PACKAGE_NAME + ".SPOOFED_PACKAGE_NAME";
|
||||
|
||||
private static void open(Activity mActivity, String queryOrLink) {
|
||||
Intent intent;
|
||||
try {
|
||||
@ -178,52 +175,6 @@ public class GmsCoreSupport {
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Injection point.
|
||||
*/
|
||||
public static String spoofPackageName(Context context) {
|
||||
// Package name of ReVanced.
|
||||
final String packageName = context.getPackageName();
|
||||
|
||||
try {
|
||||
final PackageManager packageManager = context.getPackageManager();
|
||||
|
||||
// Package name of YouTube or YouTube Music.
|
||||
String originalPackageName;
|
||||
|
||||
try {
|
||||
originalPackageName = packageManager
|
||||
.getPackageInfo(packageName, PackageManager.GET_META_DATA)
|
||||
.applicationInfo
|
||||
.metaData
|
||||
.getString(META_SPOOF_PACKAGE_NAME);
|
||||
} catch (PackageManager.NameNotFoundException exception) {
|
||||
Logger.printDebug(() -> "Failed to parsing metadata");
|
||||
return packageName;
|
||||
}
|
||||
|
||||
if (StringUtils.isBlank(originalPackageName)) {
|
||||
Logger.printDebug(() -> "Failed to parsing spoofed package name");
|
||||
return packageName;
|
||||
}
|
||||
|
||||
try {
|
||||
packageManager.getPackageInfo(originalPackageName, PackageManager.GET_ACTIVITIES);
|
||||
} catch (PackageManager.NameNotFoundException exception) {
|
||||
Logger.printDebug(() -> "Original app '" + originalPackageName + "' was not found");
|
||||
return packageName;
|
||||
}
|
||||
|
||||
Logger.printDebug(() -> "Package name of '" + packageName + "' spoofed to '" + originalPackageName + "'");
|
||||
|
||||
return originalPackageName;
|
||||
} catch (Exception ex) {
|
||||
Logger.printException(() -> "spoofPackageName failure", ex);
|
||||
}
|
||||
|
||||
return packageName;
|
||||
}
|
||||
|
||||
private static boolean isAndroidAutomotive(Context context) {
|
||||
return context.getPackageManager().hasSystemFeature(PackageManager.FEATURE_AUTOMOTIVE);
|
||||
}
|
||||
|
Reference in New Issue
Block a user