-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- HideMusicVideoAds - MinimizedPlayback - RemoveUpgradeButton - HideGetPremium
- Loading branch information
0 parents
commit 5bcc3c5
Showing
23 changed files
with
1,005 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
.idea | ||
*.iml | ||
.gradle | ||
/local.properties | ||
/.idea/caches | ||
/.idea/libraries | ||
/.idea/modules.xml | ||
/.idea/workspace.xml | ||
/.idea/navEditor.xml | ||
/.idea/assetWizardSettings.xml | ||
.DS_Store | ||
/build | ||
/captures | ||
.externalNativeBuild | ||
.cxx | ||
local.properties |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
/build |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
plugins { | ||
alias(libs.plugins.android.application) | ||
alias(libs.plugins.jetbrains.kotlin.android) | ||
} | ||
|
||
android { | ||
namespace = "io.github.chsbuffer.revancedxposed" | ||
compileSdk = 34 | ||
|
||
defaultConfig { | ||
applicationId = "io.github.chsbuffer.revancedxposed" | ||
minSdk = 24 | ||
targetSdk = 34 | ||
versionCode = 1 | ||
versionName = "1.0" | ||
ndk { | ||
abiFilters.add("arm64-v8a") | ||
} | ||
} | ||
|
||
packagingOptions.resources { | ||
excludes.addAll( | ||
arrayOf( | ||
"META-INF/**", "kotlin/**", "**.bin" | ||
) | ||
) | ||
} | ||
buildTypes { | ||
release { | ||
isMinifyEnabled = true | ||
isShrinkResources = true | ||
proguardFiles( | ||
getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro" | ||
) | ||
signingConfig = signingConfigs.getByName("debug") | ||
} | ||
} | ||
compileOptions { | ||
sourceCompatibility = JavaVersion.VERSION_11 | ||
targetCompatibility = JavaVersion.VERSION_11 | ||
} | ||
kotlinOptions { | ||
jvmTarget = "11" | ||
compileOptions { | ||
freeCompilerArgs = listOf( | ||
"-Xno-param-assertions", "-Xno-receiver-assertions", "-Xno-call-assertions" | ||
) | ||
} | ||
} | ||
} | ||
|
||
dependencies { | ||
implementation(libs.dexkit) | ||
compileOnly(libs.xposed) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# Add project specific ProGuard rules here. | ||
# You can control the set of applied configuration files using the | ||
# proguardFiles setting in build.gradle. | ||
# | ||
# For more details, see | ||
# http://developer.android.com/guide/developing/tools/proguard.html | ||
|
||
-optimizations | ||
# If your project uses WebView with JS, uncomment the following | ||
# and specify the fully qualified class name to the JavaScript interface | ||
# class: | ||
#-keepclassmembers class fqcn.of.javascript.interface.for.webview { | ||
# public *; | ||
#} | ||
|
||
-keep class io.github.chsbuffer.revancedxposed.MainHook | ||
|
||
# Uncomment this to preserve the line number information for | ||
# debugging stack traces. | ||
#-keepattributes SourceFile,LineNumberTable | ||
|
||
# If you keep the line number information, uncomment this to | ||
# hide the original source file name. | ||
#-renamesourcefileattribute SourceFile |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<manifest xmlns:android="http://schemas.android.com/apk/res/android" | ||
xmlns:tools="http://schemas.android.com/tools"> | ||
|
||
<application | ||
android:icon="@mipmap/ic_launcher" | ||
android:label="@string/app_name" | ||
android:supportsRtl="true" | ||
android:theme="@style/MainTheme" | ||
tools:targetApi="31"> | ||
|
||
<meta-data | ||
android:name="xposedmodule" | ||
android:value="true" /> | ||
<meta-data | ||
android:name="xposeddescription" | ||
android:value="@string/app_description" /> | ||
<meta-data | ||
android:name="xposedminversion" | ||
android:value="93" /> | ||
<meta-data | ||
android:name="xposedscope" | ||
android:resource="@array/scope" /> | ||
|
||
</application> | ||
</manifest> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
io.github.chsbuffer.revancedxposed.MainHook |
34 changes: 34 additions & 0 deletions
34
app/src/main/java/io/github/chsbuffer/revancedxposed/MainHook.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
package io.github.chsbuffer.revancedxposed | ||
|
||
import android.app.Application | ||
import de.robv.android.xposed.IXposedHookLoadPackage | ||
import de.robv.android.xposed.XC_MethodHook | ||
import de.robv.android.xposed.XposedBridge | ||
import de.robv.android.xposed.XposedHelpers | ||
import de.robv.android.xposed.callbacks.XC_LoadPackage.LoadPackageParam | ||
import kotlin.system.measureTimeMillis | ||
|
||
class MainHook : IXposedHookLoadPackage { | ||
override fun handleLoadPackage(lpparam: LoadPackageParam) { | ||
when (lpparam.packageName) { | ||
"com.google.android.apps.youtube.music" -> { | ||
inContext(lpparam) { app -> | ||
val t = measureTimeMillis { | ||
MusicHook(app, lpparam).Hook() | ||
} | ||
XposedBridge.log("Youtube Music handleLoadPackage: ${t}ms") | ||
} | ||
} | ||
} | ||
} | ||
} | ||
|
||
fun inContext(lpparam: LoadPackageParam, f: (Application) -> Unit) { | ||
val appClazz = XposedHelpers.findClass(lpparam.appInfo.className, lpparam.classLoader) | ||
XposedBridge.hookMethod(appClazz.getMethod("onCreate"), object : XC_MethodHook() { | ||
override fun afterHookedMethod(param: MethodHookParam) { | ||
val app = param.thisObject as Application | ||
f(app) | ||
} | ||
}) | ||
} |
Oops, something went wrong.
5bcc3c5
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ReVanced/revanced-patches@124198e