Skip to content

Commit

Permalink
Remove Lock Screen Album Art for OxygenOS 11
Browse files Browse the repository at this point in the history
  • Loading branch information
jeffshee committed Jun 2, 2021
1 parent 859c1db commit dd924b1
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 6 deletions.
10 changes: 8 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,11 @@ _After_
USB debug mode bypass for Japan Post Bank app.
```

- Remove Lock Screen Album Art (Android 10 only)
![](images/album_art_removed.jpg)
- Remove Lock Screen Album Art (OxygenOS 10)
![](images/album_art_removed.jpg)
- Remove Lock Screen Album Art (OxygenOS 11)
```
OnePlus added the shyt functionality back to the OxygenOS 11?
Don't worry, I got your back!
```
![](images/album_art_removed_a11.jpg)
6 changes: 3 additions & 3 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ android {
applicationId "io.github.jeffshee.nekumorimod"
minSdkVersion 16
targetSdkVersion 30
versionCode 2
versionName "1.1"
versionCode 3
versionName "1.2"

testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
Expand All @@ -26,7 +26,7 @@ android {
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])

implementation 'androidx.appcompat:appcompat:1.2.0'
implementation 'androidx.appcompat:appcompat:1.3.0'
compileOnly 'de.robv.android.xposed:api:82:sources'
compileOnly 'de.robv.android.xposed:api:82'
testImplementation 'junit:junit:4.12'
Expand Down
14 changes: 13 additions & 1 deletion app/src/main/java/io/github/jeffshee/nekumorimod/XposedMod.java
Original file line number Diff line number Diff line change
Expand Up @@ -74,11 +74,14 @@ public void handleLoadPackage(final LoadPackageParam lpparam) throws Throwable {
break;
case SYSYEM_UI:
/*
Disable lock screen album art (Android 10 only)
Disable lock screen album art (Android 10, 11 only)
*/
if (android.os.Build.VERSION.SDK_INT == Build.VERSION_CODES.Q) {
XposedBridge.log("(NekumoriMOD) " + lpparam.packageName);
disableLockScreenAlbumArt(lpparam.classLoader);
} else if (android.os.Build.VERSION.SDK_INT == Build.VERSION_CODES.R) {
XposedBridge.log("(NekumoriMOD) " + lpparam.packageName);
disableLockScreenAlbumArtA11(lpparam.classLoader);
}
break;
}
Expand Down Expand Up @@ -144,4 +147,13 @@ protected Object replaceHookedMethod(MethodHookParam param) throws Throwable {
});
}

private void disableLockScreenAlbumArtA11(ClassLoader classLoader) {
/*
Google finally removed this shyt from Android 11, but why it's still enabled in OxygenOS 11?
*/
Class findClass = XposedHelpers.findClass("com.android.systemui.statusbar.phone.StatusBar", classLoader);
XposedHelpers.setStaticObjectField(findClass, "SHOW_LOCKSCREEN_MEDIA_ARTWORK", false);
XposedBridge.log("(NekumoriMOD) " + "disableLockScreenAlbumArtA11");
}

}
Binary file modified images/album_art_removed.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/album_art_removed_a11.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit dd924b1

Please sign in to comment.