yashsingh1/xdaforums huggingface dataset:
[Galaxy Note II Original Android Development] nerys71:
a request. on the stock note II keyboard which I SO LOVE when you "long press" to get a subkey you also get a bunch of "OTHER" subkey options.

anyway to remove all of them? I want ONLY the normal single subkey option NONE of the rest ?
[Galaxy Note II Original Android Development] rovo89:
That per-app color thing depends on what exactly you want to change. I suggest to analyse first how you could change the code or resources to reach the effect you want and only then "translate" that into an Xposed module. Xposed gives you a set of tools you can use that go beyond the normal API, but those tools won't magically use themselves.

If the apps you are thinking about use the constants in the "Build" class (e.g. Build.MODEL), than it's fairly easy to change them. Or you could look at what the app does with the information about the device and e.g. make a imaginary function "isGalaxyS3" always return true. In development, there are lots of different ways to achieve things, so every app requires an individual analysis.
[Galaxy Note II Original Android Development] Ranomez:
Thank you for the answer, also what i meant by per-app-collor is the thing paranoid android has where you can set statusbar and navbar collors to change the way you want them depending on the app being opened, so i can make the global statusbar be black and when i open gmail to turn into red, would that be possible?
[Galaxy Note II Original Android Development] rovo89:
Well. I know it is possible to change the statusbar color. Not sure about the navbar. Anyway, I think the main problem will be detecting what the foreground app is and making that information available in the SystemUI process (which is responsible for displaying the two). I don't see why this shouldn't be possible, but it's quite some work and I wouldn't recommend it as your first module.
[Galaxy Note II Original Android Development] Ranomez:
Ok, thank you, i anyway don't know if il even manage to make an app, cause as i sayd i just started learning android development, not yet at the part of learning to make xposed modules but i wanted to know if what I want is possible or I'm just loosing my time trying to do something impossible.
[Galaxy Note II Original Android Development] Namoi:
Edit: deleted

---------- Post added at 10:52 PM ---------- Previous post was at 10:48 PM ----------

Hi,

I am a little confused about that matter. Is it already implemented in the Framework and in the per app settings module ?

I have reinstalled them both but I don't see an option to force auto rotate. Sorry to ask here if it is the wrong place.

Thanks
[Galaxy Note II Original Android Development] Tungstwenty:
No, I haven't released that change yet. Will do at most till the end of the week.
[Galaxy Note II Original Android Development] Namoi:
Oh Ok thanks a lot :) sorry for the confusion, but i never know which thread to follow between this one and the one from Xperiacle (http://xdaforums.com/showthread.php?t=2072081).

Regards
[Galaxy Note II Original Android Development] jpvanpolanen:
Where do you open mod settings?

I installed the framework and have one mod (xMulti Window Mod 1.3) installed. Rebooted but then i'm stuck...

Please help, Thanks In Advance!
[Galaxy Note II Original Android Development] rovo89:
Are you sure that this module has settings? I don't use it, so I don't know for sure, but the description says nothing about settings you would need to configure.

If the module has a settings screen ("Activity" in technical terms) AND they come with the module apk (i.e. not as a separate standalone app), you can usually just click on the module name in the "modules" tab of the installer to open it. Or if it adds an icon to your launcher, use that one of course.
[Galaxy Note II Original Android Development] MohammadAG:
Based on my last tweak to enable the camera on the lockscreen, I've edited App Settings to include this as a checkbox so that all apps can be enabled. This can be both very useful and insecure, so be careful what you do with it (A music player is fine for example, but the dialer/messages apps can cost you money and your privacy)

Here's the pull request on Github: https://github.com/rovo89/XposedAppSettings/pull/2
[Galaxy Note II Original Android Development] Scalee:
Is this for android 4.2? I thought only 4.2 could place apps on the lockscreen.
[Galaxy Note II Original Android Development] MohammadAG:
4.2 can place widgets on the lockscreen. This simply allows you to open the app without unlocking the phone. Pressing the home button or moving to an app that isn't allowed on the lockscreen will bring back the passcode screen.

Edit: here's a video showing Google Now whitelisted https://www.youtube.com/watch?v=o3Ov8TdSaxQ
[Galaxy Note II Original Android Development] Tungstwenty:
I once did something very similar, precisely for using the camera without unlocking.

It's not without its problems...

Sometimes the camera will detect closed eyes and will open the gallery viewer to show the image. Since that's another app and that one isn't displayed over the lockscreen, the camera seemed to hang.

The same if the user pressed the small thumbnail (plus the possible privacy issue of having the last photo visible in the thumbnail).

More recently, I have found an alternate solution that is much nicer, at least for me.

Google's camera+gallery app from 4.2 (the apk can be found on the forum, just search for it) is prepared upfront to run in "secure mode". If you start the app through the right intent, it will only allow you to take new pictures, and will also allow you to see the gallery of the photos taken only during that session. Once you dismiss the app and relaunch it ... locked history once again and only new photos can be taken and viewed.

There's a known issue with videos hanging (at least on my S2) but after changing the resolution the problem is gone and the quality is still good enough for my usage.

If you want to try it, just install the apk and then run

am start -a android.media.action.STILL_IMAGE_CAMERA_SECURE

or use some other way to trigger this.

Perhaps an Xposed mod to add an entry to the Power menu? :)

What I'm using now is a touch gesture of swiping 3 fingers from the top to the bottom of the screen and the camera pops up even without unlocking (see the kernel gestures link in my sig if you want more details).

Anyway, about adding the option to the AppSettings module:

On one hand, this might be a bit dangerous depending on the app, and it can also cause side effects (such as the stock camera one that I described, due to triggering the gallery).

But on the other hand, it's expected that the users of the mod know that what they're doing might break the normal functioning of their device :)

I'll merge the pull request this weekend and release an update with this plus the "forced rotation" previously discussed.
[Galaxy Note II Original Android Development] Namoi:
Thanks a lot :)
[Galaxy Note II Original Android Development] Linuxx84:
Hi guys, I have a problem... I can't understand why everytime I wipe cache and dalvik on next reboot dpi changed back to its original state. :eek:
[Galaxy Note II Original Android Development] rovo89:
Are the dpi settings still displayed correctly in the App Settings UI, but they don't apply properly? Then very likely whatever you do to wipe the cache includes something that "corrects" the file permissions of /data/data/de.robv.android.xposed.mods.appsettings/shared_prefs/ModSettings.xml. This file needs to be world-readable.
[Galaxy Note II Original Android Development] Linuxx84:
Yeah! If I check in AppSettings, the dpi still displayed correctly changes. Can I do something?
[Galaxy Note II Original Android Development] :
Don't know if its related but I had this problem when I fixed permissions in recovery. I had to kill each app again from app manager and it was fine
[Galaxy Note II Original Android Development] Linuxx84:
My problem is the same. Maybe the problem is the fix permissions.
[Galaxy Note II Original Android Development] :
It is something to do with the permissions. The developer explained it in a reply to my question a few pages back
[Galaxy Note II Original Android Development] Tungstwenty:
Most "fix permissions" scripts set read/write permissions to all private files of each app only to the owner app and no access to any other users (which is the normal situation).

The App Settings module, however, requires that the configuration file be readable by the entire system, and when it isn't the settings cannot be applied.

You can fix this manually by opening a file explorer, going to /data/data/de.robv.android.xposed.mods.appsettings/shared_prefs and changing the permissions of ModSettings.xml to RW (user) + RW (group) + R (others).

Or, from a shell:

su
chmod 664 /data/data/de.robv.android.xposed.mods.appsettings/shared_prefs/ModSettings.xml

This needs to be done whenever the permissions are (wrongly) fixed by scripts.

Anyway, I also just added code to the mod so that whenever you open the configuration screen, it will re-add the missing permissions automatically.

It should be available later today.
[Galaxy Note II Original Android Development] Tungstwenty:
App Settings mod update - 0.4

An updated version of App Settings is now available, at http://www.villainrom.co.uk/forum/microdownloads/app-settings.5/viewfile

Changes between 0.3 and 0.4:

- Show progress while loading app list

- Allow apps to display on top of a secure lockscreen (use carefully, as it might allow access to the clipboard, etc. depending on the app)

- Force app auto rotation even when the system-wide setting is disabled

- Automatically fix permission for the settings file when opening the configuration window

- Filter apps by used permission

Cheers,

TT
[Galaxy Note II Original Android Development] Namoi:
Great, thanks :D

Will try it right now.

Edit: it works perfectly on sgs2 using stock JB. :thumbup:
[Galaxy Note II Original Android Development] rovo89:
What do you think about also restoring permissions while booting? I didn't test it yet, but this simple function could be added to XSharedPreferences:

public boolean makeWorldReadable() {
return mFile.setReadable(true, false);
}

Any module like App Settings could just call it, it shouldn't do any harm. Not sure if it fixes the fixes done by init.d scripts (depends on when exactly they are executed), but it would fix anything done in recovery immediately (no reboot or restart of apps required) at minimal costs.
[Galaxy Note II Original Android Development] Tungstwenty:
Do you mean on the module code (running in the system or other app's context), or explicitly register a broadcast receiver for BOOT_COMPLETE and have the app itself update the permissions?

The first probably won't work, as the file is owned by the user and even "system" cannot change it, only itself or root.

The second will imply slower startup time as more and more apps register actions to perform after boot, no? Or since the apk will already be loaded for the mod to be working, is the broadcast receiver negligible?
[Galaxy Note II Original Android Development] rovo89:
I meant calling it like this:

public void initZygote(IXposedHookZygoteInit.StartupParam startupParam) throws Throwable {
XSharedPreferences prefs = new XSharedPreferences(Common.MY_PACKAGE_NAME, Common.PREFS);
prefs.makeWorldReadable(); // this line is new
}

Like you said, root can change the permissions and inside initZygote, we are still running as root. I'm also pretty sure that the code I posted will fail silently if the file doesn't exist, but it might make sense to add an "if (mFile.exists())" anyway.
[Galaxy Note II Original Android Development] famewolf:
Tungstwenty...the app "BatteryGuru" in google play checks to make sure the device is using a snapdragon cpu...does the app settings module give enough control using the device, product etc to spoof this test?
[Galaxy Note II Original Android Development] csmoore88:
FIGURED IT OUT !!! SORRY.

I have searched all over for a solution to my simple problem getting this started. I have the framework installed but I cannot get a single module to show in my module list. I have downloaded app settings and others from the repository. But they are all coming as zip files not apk. What am I doing wrong? Please help.
[Galaxy Note II Original Android Development] dcharleyultra:
Change the zip extension to apk.

Swyped from my SPH-L710
[Galaxy Note II Original Android Development] csmoore88:
I had tried that but was not actually renaming the file. Once I did it was simple. Thanks.
[Galaxy Note II Original Android Development] Tungstwenty:
You're obviously right, I feel dumb for having mistaken system with root :o

Of course it makes sense. That way, modules with this call will always work immediately after boot, not requiring its config window to be executed before the other processes can read the settings.
[Galaxy Note II Original Android Development] rovo89:
No problem. ;) Anyway, I think this new method fits best into the framework, so I'll add it for the next version. Once that is out, App Settings can be changed to use it.
[Galaxy Note II Original Android Development] Tungstwenty:
Depending on what the app does (there might be a reason for it to target only Snapdragon devices, perhaps?), it might be possible to do what you say by writing an Xposed module.

This is not something for App Settings, though, as it's too specific. The app needs to be analyzed and, if viable, specific code written to make it think the CPU is a Snapdragon.
[Galaxy Note II Original Android Development] famewolf:
Thanks for the reply. The app has been "ported" in the android apps forum to run on all cpu's but it has to be updated manually each time a new version comes out. I guess I'll be satisfied with that. ;)
[Galaxy Note II Original Android Development] rovo89:
This sounds like a perfect use-case for Xposed. ;) If the required code changes are already known, even better, that would make it a good project for someone who wants to start developing Xposed modules.
[Galaxy Note II Original Android Development] Dovidhalevi:
New appsettings feature: Visible on lockscreen. So if you are reading your email and the screen goes off, you can simple go back and continue reading without unlocking. Nice feature but raises more questions than it answers. It does not provide an app/widget installable on the JB lockscreen. Think which apps I would want to have this feature?
[Galaxy Note II Original Android Development] Tungstwenty:
I don't know, you tell me which ones you use :D

Personally I don't use this feature. The only app I use on top of the lockscreen is the Camera app from 4.2 which is prepared to work in "secure mode".

But, believe it or not, it hadn't yet occurred to me that this might also be used for *keeping* an app visible, doh! :o

It could make sense for some games you might play bits by bits during lunch, or for apps presenting live scores of soccer games, etc.

Provided they don't "leak" access to the rest of the device, of course, but that's just me.
[Galaxy Note II Original Android Development] Dovidhalevi:
I just set for K9 "Pure" to test it out. One plus: K9 now shows a toolbar I never saw before. I did not change any size parameters to get this. Of course, if the app is not up when the screen locks, it will not be visible when reactivating the screen.

This whole JB lockscreen widget functionality means forget security when active. Google Keep is fully functional there. Some others, less so. I do use the quick-dial widget but this allows access to contacts. I do have a little app which can turn off ALL of these widgets if I want to leave the phone unattended. Whether this will turn off this mod, no idea.
[Galaxy Note II Original Android Development] rovo89:
Probably indirectly. As you probably noticed, this mod doesn't change anything on the lockscreen at all. It only comes into effect once "something" starts an app, then the mod allows the UI to show up even if the screen is still locked. That "something" could be a widget, but also a configurable button in the lockscreen if it has such a feature. And by turning off all widgets, you take away one of the possibilities to launch apps.

By the way, interesting find about using it to keep an app showing even after the screen is locked (and go to the lockscreen if you navigate away). Didn't think of this either.
[Galaxy Note II Original Android Development] MohammadAG:
I'm thinking of making a mod to replace the lockscreen with the standard AOSP one.

Samsung kept the standard lockscreen intact (class LockScreen), and instead, made a new lockscreen called CircleLockScreen.

So to change to the AOSP one, one would simply have to use the AOSP class.

This is the AOSP method

View createLockScreen() {
View lockView = new LockScreen(
mContext,
mConfiguration,
mLockPatternUtils,
mUpdateMonitor,
mKeyguardScreenCallback);
initializeTransportControlView(lockView);
return lockView;
}

Samsung's code still uses that method but with CircleLockScreen.

My question is, is it possible to instantiate the class LockScreen using Xposed? (findClass or otherwise?)

Once that is done, is it possible to call the internal method initializeTransportControlView(View v)?

I realize if those two questions are answered then the tweak's done, but oh well :P
[Galaxy Note II Original Android Development] Tungstwenty:
You can do something like this (I'm looking at S2's XWLSS code):

final Constructor<?> newLockscreen = findClass("com.android.internal.policy.impl.LockScreen", p.classLoader).getConstructor(
Context.class, Configuration.class, "com.android.internal.widget.LockPatternUtils",
"com.android.internal.policy.impl.KeyguardUpdateMonitor", "com.android.internal.policy.impl.KeyguardScreenCallback");
findAndHookMethod("com.android.internal.policy.impl.LockPatternKeyguardView", p.classLoader, "createLockScreen",
new XC_MethodHook() {
[MENTION=439709]override[/MENTION]
protected void beforeHookedMethod(MethodHookParam param) throws Throwable {
Object lockView = newLockscreen.newInstance(getObjectField(param.thisObject, "mContext"),
getObjectField(param.thisObject, "mConfiguration"), getObjectField(param.thisObject, "mLockPatternUtils"),
getObjectField(param.thisObject, "mUpdateMonitor"), getObjectField(param.thisObject, "mKeyguardScreenCallback"));
XposedHelpers.callMethod(param.thisObject, "initializeTransportControlView", lockView);
param.setResult(lockView);
}
});
[Galaxy Note II Original Android Development] MohammadAG:
Here's what I did, getConstructor doesn't take both Class-es and Strings.

Class<?> lockPatternUtilsClass = XposedHelpers.findClass("com.android.internal.widget.LockPatternUtils", lpparam.classLoader);
Class<?> keyguardUpdateMonitorClass = XposedHelpers.findClass("com.android.internal.policy.impl.KeyguardUpdateMonitor", lpparam.classLoader);
Class<?> keyguardScreenCallbackClass = XposedHelpers.findClass("com.android.internal.policy.impl.KeyguardScreenCallback", lpparam.classLoader);

final Constructor<?> newLockscreen = findClass("com.android.internal.policy.impl.LockScreen",
lpparam.classLoader).getConstructor(Context.class, Configuration.class,
lockPatternUtilsClass, keyguardUpdateMonitorClass, keyguardScreenCallbackClass.getClass());

XposedHelpers.findAndHookMethod("com.android.internal.policy.impl.LockPatternKeyguardView",
lpparam.classLoader, "createLockScreen", new XC_MethodHook() {

[MENTION=439709]override[/MENTION]
protected void beforeHookedMethod(MethodHookParam param) throws Throwable {
Object lockView = newLockscreen.newInstance(getObjectField(param.thisObject, "mContext"),
getObjectField(param.thisObject, "mConfiguration"), getObjectField(param.thisObject, "mLockPatternUtils"),
getObjectField(param.thisObject, "mUpdateMonitor"), getObjectField(param.thisObject, "mKeyguardScreenCallback"));
XposedHelpers.callMethod(param.thisObject, "initializeTransportControlView", lockView);
param.setResult(lockView);
}
});

But here's what I got in logcat:

I/Xposed ( 3860): java.lang.NoSuchMethodException: <init> [class android.content.Context, class android.content.res.Configuration, class com.android.internal.widget.LockPatternUtils, class com.android.internal.policy.impl.KeyguardUpdateMonitor, interface com.android.internal.policy.impl.KeyguardScreenCallback]
[Galaxy Note II Original Android Development] Tungstwenty:
Sorry about that, it was written without compiling :)

You have the extra .getClass() in the getConstructor call - keyguardScreenCallbackClass is already a class (an interface, actually); if you .getClass() on that you'll be looking for a constructor that expects a Class object as the last method.

But the log message doesn't complain about that, which is strange...

You might want to try fetching the Context and the Configuration objects with the findClass call as well instead of relying on the Context.class bound to the mod's code, as the classloader for it and the actual framework code might not be the same - classes with the same name, but not the same classes.
[Galaxy Note II Original Android Development] MohammadAG:
No worries :)

Actually, the log entry was without the getClasss(), I added that to see if it'd help, and it didn't.

I've changed the code to use findClass for all the parameters, and it still didn't work, so I started looking at other methods offered by Xposed and this worked:

final Constructor<?> newLockscreen = XposedHelpers.findConstructorBestMatch(lockScreenClass, contextClass, configurationClass,
lockPatternUtilsClass, keyguardUpdateMonitorClass, keyguardScreenCallbackClass);

Now there's a small problem, apparently the glowpad is not centered in 240 dpi. I've seen some mods with it fixed, but I'm not sure how to apply that with Xposed.

I noticed somewhere in the thread that you mentioned that replacing values in framework-res.apk means doing it in initZygote, but digging around more I found hookLayout, but that needs handleInitPackageResources, so which is better in this case?
[Galaxy Note II Original Android Development] rovo89:
Just another method of creating a new instance:

XposedHelpers.findAndHookMethod("com.android.internal.policy.impl.LockPatternKeyguardView",
lpparam.classLoader, "createLockScreen", new XC_MethodHook() {

[MENTION=439709]override[/MENTION]
protected void beforeHookedMethod(MethodHookParam param) throws Throwable {
Object lockView = XposedHelpers.newInstance(
findClass("com.android.internal.policy.impl.LockScreen", lpparam.classLoader),
getObjectField(param.thisObject, "mContext"),
getObjectField(param.thisObject, "mConfiguration"),
getObjectField(param.thisObject, "mLockPatternUtils"),
getObjectField(param.thisObject, "mUpdateMonitor"),
getObjectField(param.thisObject, "mKeyguardScreenCallback"));
XposedHelpers.callMethod(param.thisObject, "initializeTransportControlView", lockView);
param.setResult(lockView);
}
});

This looks at classes of the arguments to find the constructor that matches best, then calls it with the same arguments. It's a bit closer to the original code, but there are many different ways to achieve this.

Regarding hookLayout: It doesn't need handleInitPackageResources, you can also call XResources.hookSystemWideLayout() if the layout is part of the framework. I recommend it over replacing the layout completely.
[Galaxy Note II Original Android Development] Publiuss:
Hi

I installed Xposed Framework and some modules (tweakbox, camera non lockscreen) on a Sony Xperia mini pro.

Well, after some reboots, looks like it does nothing.

Is this a Samsung Galaxy only thing (I read "all roms" but looks like modules are for last galaxys...)?
[Galaxy Note II Original Android Development] rovo89:
In Tweakbox, some of the tweaks are Samsung only. But there are many other modules which work on different devices from other vendors.
[Galaxy Note II Original Android Development] Publiuss:
Hi

Well, modules on villainrom's are not so many, tweakbox was the most interesting!

Is there a test modules to check if the framework is working?

No problem anyway, will wait for project growing.
[Galaxy Note II Original Android Development] Tungstwenty:
Try this one and see if it does anything useful for you.
[Galaxy Note II Original Android Development] csmoore88:
Where can I get tweakbox?? I look and look but lost it somewhere. Thnx in advance.