[GUIDE]MTK LockScreen - Android Themes

Hello all! This is basicly a easy build.prop mod for changing lockscreen on mtk devices like Alcatel ot-991, ot-918, Spice Mi-350n Hero 7300, Star A3...
What Is Required :
PHP:
? Rooted phone
? Notepad++(for opening build.prop files)
? Android Commander
? Tool for decompiling jar files - apkmanager/apktool/virtous or...
Weel if u had all mentioned above u have to find build.prop file. On alcatel stock roms that file is used to be in custpack folder but often is in system folder. When u find it open it and search for line :
curlockscreen=[number/letter]
Click to expand...
Click to collapse
and now depending on what device you have that number/letter could be for example :
>>HERO 7300<<
*LOCK_SCREEN_ORI:I = 1
*LOCK_SCREEN_SLIDE:I = 2
*LOCK_SCREEN_SENSE:I = 3
*LOCK_SCREEN_SENSE_G11:I = 4
*LOCK_SCREEN_GLASS:I = 5
*LOCK_SCREEN_SENSE_G11_PLUS:I = 6
*LOCK_SCREEN_SENSE_PLUS:I = 7
*LOCK_SCREEN_GLASS_G2:I = 8
*LOCK_SCREEN_IPHONE:I = 9
*LOCK_SCREEN_SENSE_G14:I = a
*LOCK_SCREEN_WAVE:I = b
*LOCK_SCREEN_ROLLER:I = c
>>STAR A3<<
*LOCK_SCREEN_ORI:I = 1
*LOCK_SCREEN_SLIDE:I = 2
*LOCK_SCREEN_SENSE:I = 3
*LOCK_SCREEN_SENSE_G11:I = 4
*LOCK_SCREEN_GLASS:I = 5
*LOCK_SCREEN_SENSE_G11_PLUS:I = 6
*LOCK_SCREEN_SENSE_PLUS:I = 7
*LOCK_SCREEN_GLASS_G2:I = 8
*LOCK_SCREEN_IPHONE:I = 9
>>SPICE Mi-350n<<
*LOCK_SCREEN_ORI:I = 0x1
*LOCK_SCREEN_SLIDE:I = 0x2
*LOCK_SCREEN_WINDBELL:I = 0x3
>>ALCATEl OT-991 / OT-918<<
*LOCK_SCREEN_ORI:I = 0x1
*LOCK_SCREEN_SLIDE:I = 0x2
*LOCK_SCREEN_JRD:I = 0x3
and this is how it should look like in case of OT-991/918
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
lockscreen1 lockscreen2 lockscreen3
...but if you having custom rom there is a chance that developers already modify strings so u can't make that chances.
Best way is to decompile android.policy.jar (if u dont know how find it here) and search for LockPatternKeyguardView.smali which is located in :
com/android/internal/policy/impl
Click to expand...
Click to collapse
When u open "LockPatternKeyguardView.smali" look for ... (or something like that) :
# static fields
.field static final ACTION_EMERGENCY_DIAL:Ljava/lang/String; = "com.android.phone.EmergencyDialer.DIAL"
.field private static final DEBUG:Z = false
.field static final DEBUG_CONFIGURATION:Z = false
.field private static final EMERGENCY_CALL_TIMEOUT:I = 0x2710
.field public static final LOCK_SCREEN_JRD:I = 0x3
.field public static final LOCK_SCREEN_ORI:I = 0x1
.field public static final LOCK_SCREEN_SLIDE:I = 0x2
.field private static final TAG:Ljava/lang/String; = "LockPatternKeyguardView"
Click to expand...
Click to collapse
As u can see in this case, /Alcatel ot-991/ there is 3 lock screens (bolded strings). So that is the best to find out what number u have to write after "curlockscreen" string in build.prop.
Little explanation - "JRD" is Alcatel lockscreen - vertical pull down (pict. 3), "ORI" is Gingerbread original - horizontal slide (pict. 1) and "SLIDE" in this case is pull up lock with weekdays in bootom (pict. 2).
Oh and one last thing if u miss the number/letter that is not present in android.policy (for example u write 22 instead of 2) it should be fine, just ur lockscreen is gonna be set to default one.
After changing build.prop push it back to folder and reboot phone.

Vesavoj said:
Hello all! This is basicly a easy build.prop mod for changing lockscreen on mtk devices like Alcatel ot-991, ot-918, Spice Mi-350n Hero 7300, Star A3...
What Is Required :
PHP:
? Rooted phone
? Notepad++(for opening build.prop files)
? Android Commander
? Tool for decompiling jar files - apkmanager/apktool/virtous or...
Weel if u had all mentioned above u have to find build.prop file. On alcatel stock roms that file is used to be in custpack folder but often is in system folder. When u find it open it and search for line :
and now depending on what device you have that number/letter could be for example :
>>HERO 7300<<
*LOCK_SCREEN_ORI:I = 1
*LOCK_SCREEN_SLIDE:I = 2
*LOCK_SCREEN_SENSE:I = 3
*LOCK_SCREEN_SENSE_G11:I = 4
*LOCK_SCREEN_GLASS:I = 5
*LOCK_SCREEN_SENSE_G11_PLUS:I = 6
*LOCK_SCREEN_SENSE_PLUS:I = 7
*LOCK_SCREEN_GLASS_G2:I = 8
*LOCK_SCREEN_IPHONE:I = 9
*LOCK_SCREEN_SENSE_G14:I = a
*LOCK_SCREEN_WAVE:I = b
*LOCK_SCREEN_ROLLER:I = c
>>STAR A3<<
*LOCK_SCREEN_ORI:I = 1
*LOCK_SCREEN_SLIDE:I = 2
*LOCK_SCREEN_SENSE:I = 3
*LOCK_SCREEN_SENSE_G11:I = 4
*LOCK_SCREEN_GLASS:I = 5
*LOCK_SCREEN_SENSE_G11_PLUS:I = 6
*LOCK_SCREEN_SENSE_PLUS:I = 7
*LOCK_SCREEN_GLASS_G2:I = 8
*LOCK_SCREEN_IPHONE:I = 9
>>SPICE Mi-350n<<
*LOCK_SCREEN_ORI:I = 0x1
*LOCK_SCREEN_SLIDE:I = 0x2
*LOCK_SCREEN_WINDBELL:I = 0x3
>>ALCATEl OT-991 / OT-918<<
*LOCK_SCREEN_ORI:I = 0x1
*LOCK_SCREEN_SLIDE:I = 0x2
*LOCK_SCREEN_JRD:I = 0x3
and this is how it should look like in case of OT-991/918
View attachment 2216448 View attachment 2216502 View attachment 2216450
lockscreen1 lockscreen2 lockscreen3
...but if you having custom rom there is a chance that developers already modify strings so u can't make that chances.
Best way is to decompile android.policy.jar (if u dont know how find it here) and search for LockPatternKeyguardView.smali which is located in :
When u open "LockPatternKeyguardView.smali" look for ... (or something like that) :
As u can see in this case, /Alcatel ot-991/ there is 3 lock screens (bolded strings). So that is the best to find out what number u have to write after "curlockscreen" string in build.prop.
Little explanation - "JRD" is Alcatel lockscreen - vertical pull down (pict. 3), "ORI" is Gingerbread original - horizontal slide (pict. 1) and "SLIDE" in this case is pull up lock with weekdays in bootom (pict. 2).
Oh and one last thing if u miss the number/letter that is not present in android.policy (for example u write 22 instead of 2) it should be fine, just ur lockscreen is gonna be set to default one.
After changing build.prop push it back to folder and reboot phone.
Click to expand...
Click to collapse
i tried the mod but my device got bootloop. my phone is ot-918n. how to make this work on my device?

What have u tried, did u check LockPatternKeyguardView.smali in order to hit the right numbers? If u have custom rom installed it could be changed.

Vesavoj said:
What have u tried, did u check LockPatternKeyguardView.smali in order to hit the right numbers? If u have custom rom installed it could be changed.
Click to expand...
Click to collapse
I did check LockPatternKeyguardView.smali. here's what's written there
"# static fields
.field static final ACTION_EMERGENCY_DIAL:Ljava/lang/String; = "com.android.phone.EmergencyDialer.DIAL"
.field private static final DEBUG:Z = false
.field static final DEBUG_CONFIGURATION:Z = false
.field private static final EMERGENCY_CALL_TIMEOUT:I = 0x2710
.field public static final LOCK_SCREEN_JRD:I = 0x3
.field public static final LOCK_SCREEN_ORG:I = 0x4
.field public static final LOCK_SCREEN_ORI:I = 0x1
.field public static final LOCK_SCREEN_SLIDE:I = 0x2
.field private static final TAG:Ljava/lang/String; = "LockPatternKeyguardView"
I tried those four numbers above but my phone got bootloop. im on stock rom. how could i make this work?

Hello,
I tried to follow your guide on my Alcatel OT-997D, but I can't seem to find any lockscreens to choose from.
The preset in build.prop is "curlockscreen=2" but there aren't any matching fields. So no modding possible here?
# static fields
.field static final ACTION_EMERGENCY_DIAL:Ljava/lang/String; = "com.android.phone.EmergencyDialer.DIAL"
.field private static final DEBUG:Z = false
.field static final DEBUG_CONFIGURATION:Z = false
.field private static final EMERGENCY_CALL_TIMEOUT:I = 0x2710
.field private static final SIM_CARD_HOT_SWAP_ACTION:Ljava/lang/String; = "jrdcom.action.SIMCARD_HOTSWAP"
.field private static final TAG:Ljava/lang/String; = "LockPatternKeyguardView"
.field private static final TRANSPORT_USERACTIVITY_TIMEOUT:I = 0x2710
.field static sAlarmBootInitDone:Z
.field static sIsAlarmBoot:Z
.field private static sIsFirstAppearanceAfterBoot:Z
Click to expand...
Click to collapse

kvcaron78 said:
I did check LockPatternKeyguardView.smali. here's what's written there
"# static fields
.field static final ACTION_EMERGENCY_DIAL:Ljava/lang/String; = "com.android.phone.EmergencyDialer.DIAL"
.field private static final DEBUG:Z = false
.field static final DEBUG_CONFIGURATION:Z = false
.field private static final EMERGENCY_CALL_TIMEOUT:I = 0x2710
.field public static final LOCK_SCREEN_JRD:I = 0x3
.field public static final LOCK_SCREEN_ORG:I = 0x4
.field public static final LOCK_SCREEN_ORI:I = 0x1
.field public static final LOCK_SCREEN_SLIDE:I = 0x2
.field private static final TAG:Ljava/lang/String; = "LockPatternKeyguardView"
I tried those four numbers above but my phone got bootloop. im on stock rom. how could i make this work?
Click to expand...
Click to collapse
Try to push changed build.prop in custpack and system folder.
kuano said:
Hello,
I tried to follow your guide on my Alcatel OT-997D, but I can't seem to find any lockscreens to choose from.
The preset in build.prop is "curlockscreen=2" but there aren't any matching fields. So no modding possible here?
Click to expand...
Click to collapse
Maybe code is on other place, you can set "curlockscreen=1" or "curlockscreen=3", if u stuck on boot splash return to defalt value.

I've set curlockscreen to several values from 1 to 8 and even deleted the whole entry, but the lockscreen stays still the same.
Gesendet von meinem ALCATEL ONE TOUCH 997D mit Tapatalk

I know this thread is quite old still I hope to get an answer
Soo I am using a Kingzone K1 with one of those ugly oem lockscreen... i cant seem to be able to activate the aosp one, not even sure if it is included? its 4.4.2...
build.prop contains curlockscreen=1, tried setting it to 0 and 2 and rebootet, nothing changed.
Would I have to clear cache, dalvik etc?
After this i tried to edit the android.policy.jar.
Decompiled fine but I cant find LockPatternKeyguardView.smali, and no other smali containing simular code (but well there are really many )
EDIT: I know found out that the lockscreen seems to work kinda different in 4.4.2...
android.policy.jar is just used to link an apk that does the job: keyguard.apk in system/priv-app.
Replacing this with the same file from Nexus 5 4.4.2 factoy image gets you a working aosp lockscreen, but 2nd sim doesnt work! seems like keyguard controls more than just the lockscreen...
Most likely you could decompile stock keyguard (or get source from aosp), do the same thing with your stock apk, merge those two sources and get a working lockscreen.
Luckily, I just tried a keyguard.apk from another 4.4.2 rom for a very simular phone (THL 5000, http://www.needrom.com/download/original-rom-1-1-1/) and all works fine now.
This should work for other phones/roms with simular stats (mtk6592, dual sim, 2gb ram, 1920x1080 screen)!
Just in case someone has the same issue and finds this thread

Related

[Q][Help Needed]Drawable.setColorFilter(a, b) not working.

Hello,
I am working on a Xposed Module and for which I require to change the Colour of a Drawable PNG to User Selected.
I am using this code :
Code:
final int mAccentColour = pref.getInt("pref_key_theme_colour_accent", R.color.predefined_theme_blue);
resparam.res.setReplacement("com.whatsapp", "drawable", "input_circle_normal", new XResources.DrawableLoader() {
@Override
public Drawable newDrawable(XResources res, int id) throws Throwable {
Drawable myIcon = modRes.getDrawable(R.drawable.scrubber_normal);
if (myIcon != null) {
myIcon.mutate().setColorFilter(mAccentColour, PorterDuff.Mode.DST_OVER);
}
return myIcon;
}
});
But it won't work. Icon gets replaced my newIcon but Color Filter is not working.
SArnab©® said:
Hello,
I am working on a Xposed Module and for which I require to change the Colour of a Drawable PNG to User Selected.
I am using this code :
Code:
final int mAccentColour = pref.getInt("pref_key_theme_colour_accent", R.color.predefined_theme_blue);
resparam.res.setReplacement("com.whatsapp", "drawable", "input_circle_normal", new XResources.DrawableLoader() {
@Override
public Drawable newDrawable(XResources res, int id) throws Throwable {
Drawable myIcon = modRes.getDrawable(R.drawable.scrubber_normal);
if (myIcon != null) {
myIcon.mutate().setColorFilter(mAccentColour, PorterDuff.Mode.DST_OVER);
}
return myIcon;
}
});
But it won't work. Icon gets replaced my newIcon but Color Filter is not working.
Click to expand...
Click to collapse
Hello, is not it better to use
Code:
myIcon.[STRIKE]mutate().[/STRIKE]setColorFilter(mAccentColour, PorterDuff.Mode.DST_OVER);
?
Or in case he needs to use mutate() to make sure only that instance of resource drawable gets state change, he should rather:
Code:
Drawable myIcon = modRes.getDrawable(R.drawable.scrubber_normal)[COLOR="Red"].mutate();[/COLOR]
if (myIcon != null) {
myIcon.setColorFilter(mAccentColour, PorterDuff.Mode.DST_OVER);
}
deadlynounou said:
Hello, is not it better to use
Code:
myIcon.[STRIKE]mutate().[/STRIKE]setColorFilter(mAccentColour, PorterDuff.Mode.DST_OVER);
?
Click to expand...
Click to collapse
Thanks for replying. One of my friend told the same and it worked.
But the strange thing is that before I too tried the same but it didn't worked. I don't know what made it work at last but now am all set to go ahead.
C3C076 said:
Or in case he needs to use mutate() to make sure only that instance of resource drawable gets state change, he should rather:
Code:
Drawable myIcon = modRes.getDrawable(R.drawable.scrubber_normal)[COLOR="Red"].mutate();[/COLOR]
if (myIcon != null) {
myIcon.setColorFilter(mAccentColour, PorterDuff.Mode.DST_OVER);
}
Click to expand...
Click to collapse
Thanks for replying. If ever I will need to use mutate(), I will use your implementation.
Post Deleted

Problem in Bluetooth transmitting comparisation

Hi. I want to ask some comparison problem in Android studio. I have implement a bluetooth data receiving code in Android studio to receive data from Arduino. If it receive "abcde", an audio should be play (mysound). But it can't play as expected. May I ask what is the problem in the below code? Thank you.
Arduino:
BT.println("abcde");
Android:
h = new Handler() {
public void handleMessage(android.os.Message msg) {
switch (msg.what) {
case RECIEVE_MESSAGE: // if receive massage
byte[ ] readBuf = (byte[ ]) msg.obj;
String strIncom = new String(readBuf, 0, msg.arg1); // create string from bytes array
sb.append(strIncom); // append string
int endOfLineIndex = sb.indexOf("\r\n"); // determine the end-of-line
//txtArduino.setText(strIncom);
if (endOfLineIndex > 0) { // if end-of-line,
String sbprint = sb.substring(0, endOfLineIndex); // extract string
sb.delete(0, sb.length()); // and clear
txtArduino.setText(sbprint); // update TextView
if(sbprint=="abcde"){
mySound.start();}
break;
}
};
};

[Q] How to modify memory capacity?

Hello guys,
Here is the script to get RAM capacity of a device. It's really different to other device specs that I read.
I have no idea how to hook to change it (memInfo.totalMem) .
PHP:
ActivityManager actManager = (ActivityManager) context.getSystemService(context.ACTIVITY_SERVICE);
ActivityManager.MemoryInfo memInfo = new ActivityManager.MemoryInfo();
actManager.getMemoryInfo(memInfo);
long totalMemory = memInfo.totalMem;
The system file "/proc/meminfo" also holds RAM memory info, I tried to modify this file but didn't affect.
Is there anyway to solve this problem??
Have a nice day.
kidsphy said:
Hello guys,
Here is the script to get RAM capacity of a device. It's really different to other device specs that I read.
I have no idea how to hook to change it (memInfo.totalMem) .
PHP:
ActivityManager actManager = (ActivityManager) context.getSystemService(context.ACTIVITY_SERVICE);
ActivityManager.MemoryInfo memInfo = new ActivityManager.MemoryInfo();
actManager.getMemoryInfo(memInfo);
long totalMemory = memInfo.totalMem;
The system file "/proc/meminfo" also holds RAM memory info, I tried to modify this file but didn't affect.
Is there anyway to solve this problem??
Have a nice day.
Click to expand...
Click to collapse
You can try:
Code:
ActivityManager.MemoryInfo memInfo = (ActivityManager.MemoryInfo) XposedHelpers.newInstance(ActivityManager.MemoryInfo.class);
XposedHelpers.setObjectField(memInfo, "totalMem", 141211211L);
OR:
Code:
Constructor<?> constructLayoutParams = XposedHelpers.findConstructorExact(android.app.ActivityManager.MemoryInfo.class, Parcel.class);
constructLayoutParams.setAccessible(true);
XposedBridge.hookMethod(constructLayoutParams, new XC_MethodHook(XCallback.PRIORITY_HIGHEST) {
@Override
protected void beforeHookedMethod(MethodHookParam param) throws Throwable {
if (param.args[0] != null) {
param.args[0] = new CustomMemoryInfo();
}
}});
CustomMemoryInfo extends MemoryInfo class, you can override super method to change "totalMem" attribute
hahalulu said:
You can try:
Code:
ActivityManager.MemoryInfo memInfo = (ActivityManager.MemoryInfo) XposedHelpers.newInstance(ActivityManager.MemoryInfo.class);
XposedHelpers.setObjectField(memInfo, "totalMem", 141211211L);
OR:
Code:
Constructor<?> constructLayoutParams = XposedHelpers.findConstructorExact(android.app.ActivityManager.MemoryInfo.class, Parcel.class);
constructLayoutParams.setAccessible(true);
XposedBridge.hookMethod(constructLayoutParams, new XC_MethodHook(XCallback.PRIORITY_HIGHEST) {
@Override
protected void beforeHookedMethod(MethodHookParam param) throws Throwable {
if (param.args[0] != null) {
param.args[0] = new CustomMemoryInfo();
}
}});
CustomMemoryInfo extends MemoryInfo class, you can override super method to change "totalMem" attribute
Click to expand...
Click to collapse
Thank for your reply, but it doesn't work. Have you ever tried running this piece or it's just your thinking?
Here's a commented example of doing this (at least for the method that you posted):
Java:
// Hook the method getMemoryInfo from the ActivityManager class
XposedHelpers.findAndHookMethod(ActivityManager.class, "getMemoryInfo", ActivityManager.MemoryInfo.class, new XC_MethodHook() {
// We use afterHooked here because you have to modify the values *after* the method already setup the object,
// as this method take the object passed as argument and parcel the data (it's always good to check the source)
// https://android.googlesource.com/platform/frameworks/base/+/master/core/java/android/app/ActivityManager.java#2358 > which calls
// https://android.googlesource.com/platform/frameworks/base/+/master/core/java/android/app/ActivityManagerNative.java#4918
[user=439709]@override[/user]
protected void afterHookedMethod(MethodHookParam param) throws Throwable {
// Method contructor -> public void getMemoryInfo(MemoryInfo outInfo)
// As you can see, the getMemoryInfo take a MemoryInfo object as argument
// you just have to get the object from the arguments array, and then cast
// to MemoryInfo to set the desired field
((ActivityManager.MemoryInfo) param.args[0]).totalMem = 12345678L;
((ActivityManager.MemoryInfo) param.args[0]).availMem = 87654321L;
}
});
mauricio_C said:
Here's a commented example of doing this (at least for the method that you posted):
Click to expand...
Click to collapse
Thank you so much :good:

how to change/replace class constants

i have a class like this
PHP:
package com.insight.sdk;
public class ISBuildConfig {
public static int ASSETS_JAR_VERSION_CODE = 100043;
public static String ASSETS_JAR_VERSION_NAME = "v100.1.2.0_release";
public static boolean DEBUG = false;
public static int LOADER_VERSION_CODE = 100043;
public static String LOADER_VERSION_NAME = "v2.1.3_release";
public static final int NOUGAT = 24;
}
i want to change DEBUG to true
how to use xposed to change this value?
hotwap said:
...
how to use xposed to change this value?
Click to expand...
Click to collapse
Try kooking it as early as possible (Application's onCreate() is a good place to do that):
PHP:
XposedHelpers.findAndHookMethod(>>> APPLICATION.class <<<, "onCreate", new XC_MethodHook() {
@Override
protected void afterHookedMethod(MethodHookParam param) throws Throwable {
XposedHelpers.setStaticBooleanField(ISBuildConfig.class, "DEBUG", true);
}
}

[REQUEST] BLOCK/DISABLE Pull-down Quick Toggle on Secure Lockscreen

Maybe any devs can adapt this for Magisk module?
https://github.com/char101/xposed-q...main/java/com/github/char101/qslock/Main.java
Code:
package com.github.char101.qslock;
import de.robv.android.xposed.XposedBridge;
import de.robv.android.xposed.callbacks.XC_LoadPackage.LoadPackageParam;
import de.robv.android.xposed.IXposedHookLoadPackage;
import de.robv.android.xposed.XC_MethodHook;
import de.robv.android.xposed.XposedHelpers;
import android.util.Log;
public class Main implements IXposedHookLoadPackage {
private static final String TAG = "qslock";
private static final int DISABLE_EXPAND = 0x00010000;
private static final int DISABLE_NOTIFICATION_ICONS = 0x00020000;
private static final int DISABLE_NOTIFICATION_ALERTS = 0x00040000;
private static final int DISABLE_NOTIFICATION_TICKER = 0x00080000;
private static final int DISABLE_SYSTEM_INFO = 0x00100000;
private static final int DISABLE_HOME = 0x00200000;
private static final int DISABLE_RECENT = 0x01000000;
private static final int DISABLE_BACK = 0x00400000;
private static final int DISABLE_CLOCK = 0x00800000;
private static final int DISABLE_SEARCH = 0x02000000;
private static final int DISABLE_NONE = 0x00000000;
private static final int DISABLE2_QUICK_SETTINGS = 1;
private static final int DISABLE2_SYSTEM_ICONS = 1 << 1;
private static final int DISABLE2_NOTIFICATION_SHADE = 1 << 2;
private static final int DISABLE2_GLOBAL_ACTIONS = 1 << 3;
private static final int DISABLE2_ROTATE_SUGGESTIONS = 1 << 4;
private static final int DISABLE2_NONE = 0x00000000;
public int getProp(Class<?> SystemProperties, String name, int defaultValue) {
String val = (String) XposedHelpers.callStaticMethod(SystemProperties, "get", new Class<?>[]{String.class}, name);
try {
return val.equals("") ? defaultValue : Integer.parseInt(val);
} catch (NumberFormatException ex) {
Log.e(TAG, "invalid value for " + name + ": " + val);
return defaultValue;
}
}
public void handleLoadPackage(final LoadPackageParam lpparam) throws Throwable {
if (!lpparam.packageName.equals("com.android.systemui")) {
return;
}
XposedBridge.log(TAG + ": started");
final Class<?> SystemProperties = XposedHelpers.findClass("android.os.SystemProperties", null);
XposedHelpers.findAndHookMethod("com.android.systemui.keyguard.KeyguardViewMediator", lpparam.classLoader, "adjustStatusBarLocked", new XC_MethodHook() {
@Override
protected void afterHookedMethod(MethodHookParam param) throws Throwable {
Object mStatusBarManager = XposedHelpers.getObjectField(param.thisObject, "mStatusBarManager");
if (mStatusBarManager != null) {
boolean mShowing = (boolean) XposedHelpers.getBooleanField(param.thisObject, "mShowing");
final int mode2 = getProp(SystemProperties,"persist.qslock.mode2", DISABLE2_QUICK_SETTINGS);
if (mShowing) {
final int mode = getProp(SystemProperties,"persist.qslock.mode", 0);
if (mode > 0) {
Log.i(TAG, "disable: " + mode);
XposedHelpers.callMethod(mStatusBarManager, "disable", new Class<?>[]{int.class}, mode);
}
if (mode2 > 0) {
Log.i(TAG, "disable2: " + mode2);
XposedHelpers.callMethod(mStatusBarManager, "disable2", new Class<?>[]{int.class}, mode2);
}
} else {
if (mode2 > 0) {
XposedHelpers.callMethod(mStatusBarManager, "disable2", new Class<?>[]{int.class}, DISABLE2_NONE);
}
}
} else {
Log.e(TAG, "mStatusBarManager is null");
}
}
});
}
}
Crescendo Xenomorph said:
Maybe any devs can adapt this for Magisk module?
https://github.com/char101/xposed-q...main/java/com/github/char101/qslock/Main.java
Click to expand...
Click to collapse
Not possible,Xposed alters code while magisk alters files,you can't convert an Xposed module into a magisk module
Sent from my Moto G 2015 using XDA Labs
DanGLES3 said:
Not possible,Xposed alters code while magisk alters files,you can't convert an Xposed module into a magisk module
Sent from my Moto G 2015 using XDA Labs
Click to expand...
Click to collapse
or maybe a cue of what code in what smali that it replaces?
Sent from my MI 5s Plus using Tapatalk

Categories

Resources