Skip to content

Commit

Permalink
Remove Lock Screen Album Art
Browse files Browse the repository at this point in the history
  • Loading branch information
jeffshee committed Dec 26, 2020
1 parent 98a3470 commit 859c1db
Show file tree
Hide file tree
Showing 5 changed files with 43 additions and 10 deletions.
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,11 @@ _Before_
![](images/daydream.jpg)
_After_
![](images/daydream_fixed.jpg)

- Japan Post Bank
```
USB debug mode bypass for Japan Post Bank app.
```

- Remove Lock Screen Album Art (Android 10 only)
![](images/album_art_removed.jpg)
14 changes: 7 additions & 7 deletions app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
apply plugin: 'com.android.application'

android {
compileSdkVersion 29
compileSdkVersion 30
buildToolsVersion "29.0.2"

defaultConfig {
applicationId "io.github.jeffshee.nekumorimod"
minSdkVersion 16
targetSdkVersion 29
versionCode 1
versionName "1.0"
targetSdkVersion 30
versionCode 2
versionName "1.1"

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

implementation 'androidx.appcompat:appcompat:1.1.0'
implementation 'androidx.appcompat:appcompat:1.2.0'
compileOnly 'de.robv.android.xposed:api:82:sources'
compileOnly 'de.robv.android.xposed:api:82'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test.ext:junit:1.1.1'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
androidTestImplementation 'androidx.test.ext:junit:1.1.2'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'
}// created with XposedModuleTemplate by dvdandroid
// http://github.com/dvdandroid/XposedModuleTemplate

29 changes: 27 additions & 2 deletions app/src/main/java/io/github/jeffshee/nekumorimod/XposedMod.java
Original file line number Diff line number Diff line change
@@ -1,22 +1,25 @@
package io.github.jeffshee.nekumorimod;

import android.content.ContentResolver;
import android.os.Build;
import android.provider.Settings;

import java.util.HashMap;
import java.util.Map;

import de.robv.android.xposed.XC_MethodHook;
import de.robv.android.xposed.XposedHelpers;
import de.robv.android.xposed.IXposedHookLoadPackage;
import de.robv.android.xposed.XC_MethodHook;
import de.robv.android.xposed.XC_MethodReplacement;
import de.robv.android.xposed.XposedBridge;
import de.robv.android.xposed.XposedHelpers;
import de.robv.android.xposed.callbacks.XC_LoadPackage.LoadPackageParam;

public class XposedMod implements IXposedHookLoadPackage {

private static final String RAKUTEN_EDY = "jp.edy.edyapp";
private static final String GOOGLE_DAYDREAM = "com.google.android.vr.home";
private static final String JAPAN_POST = "jp.japanpost.jp_bank.bankbookapp";
private static final String SYSYEM_UI = "com.android.systemui";

private static final Map<String, String> BUILD_NEXUS_6 = new HashMap<String, String>() {
{
Expand Down Expand Up @@ -69,6 +72,15 @@ public void handleLoadPackage(final LoadPackageParam lpparam) throws Throwable {
XposedBridge.log("(NekumoriMOD) " + lpparam.packageName);
debugModeSpoofing(lpparam.classLoader);
break;
case SYSYEM_UI:
/*
Disable lock screen album art (Android 10 only)
*/
if (android.os.Build.VERSION.SDK_INT == Build.VERSION_CODES.Q) {
XposedBridge.log("(NekumoriMOD) " + lpparam.packageName);
disableLockScreenAlbumArt(lpparam.classLoader);
}
break;
}
}

Expand Down Expand Up @@ -119,4 +131,17 @@ protected void afterHookedMethod(MethodHookParam param) throws Throwable {
});
}

private void disableLockScreenAlbumArt(ClassLoader classLoader) {
/*
Since only updateMediaMetaData called getMediaMetadata, replacing this method to return null should be OK
*/
XposedHelpers.findAndHookMethod("com.android.systemui.statusbar.NotificationMediaManager", classLoader, "getMediaMetadata", new XC_MethodReplacement() {
@Override
protected Object replaceHookedMethod(MethodHookParam param) throws Throwable {
XposedBridge.log("(NekumoriMOD) " + "disableLockScreenAlbumArt");
return null;
}
});
}

}
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ buildscript {

}
dependencies {
classpath 'com.android.tools.build:gradle:4.0.0'
classpath 'com.android.tools.build:gradle:4.0.2'


// NOTE: Do not place your application dependencies here; they belong
Expand Down
Binary file added 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.

0 comments on commit 859c1db

Please sign in to comment.