yashsingh1/xdaforums huggingface dataset:
[Galaxy Note II Original Android Development] rovo89:
This will help you: http://developer.android.com/guide/topics/resources/providing-resources.html#BestMatch

From the various resources with the same name, Android picks the one the fits best to the current surrounding conditions.

With the API offered by Xposed, you don't change the value inside the XML files, but the value of this best match. It doesn't matter which folder it came from. So "bool" is the type of the resource, not a folder or xml name.

If you want to override a value just for a specific configuration (e.g. only for values-en), you can't. The process of getting the best match is deep in native code and comes back with just the value, but not with the way it was determined. What you can do is create all required variants of the resource in your own module and then forward the request for the resource you want to override to your own module. You can't mix the resources though, so you have to include really all variants of the resource in your own module.
[Galaxy Note II Original Android Development] chrisryn:
Re: Making "Stock" Custom ROMs Defunct (XposedFramework) - Tweaks for any ROM Version

Ok you put into words better than I do. Which helps I was thinking it worked how you explained, now just need to get more familiar with Java and can start making modules. Should have one soon.
[Galaxy Note II Original Android Development] rovo89:
Great! If you need any more help, just ask the questions you have. I'm willing to help and give pointers to other site (unless I feel that someone doesn't even try to find out themselves).
[Galaxy Note II Original Android Development] chrisryn:
My biggest issue is working through the differences in VS and eclipse. I want to create a module that has variable options and getting the gui and everything setup. Just different then what is my norm when programming. Learning about sharedprefs at the moment for retaining the options.
[Galaxy Note II Original Android Development] daveid:
I am running JediX9 and see the same FC when docked in my smart dock. However I use ADW Launcher, and my widgets get destroyed everytime... I have not changed my system dpi.
[Galaxy Note II Original Android Development] Pliind:
Re: Making "Stock" Custom ROMs Defunct (XposedFramework) - Tweaks for any ROM Version

I use Nova luncher, only fc nothing else.
[Galaxy Note II Original Android Development] rovo89:
Pliind, daveid: Could you provide a logcat the error occurs? I can't make any sense of the symptoms you describe, but maybe the stack trace from the FC gives a hint that could also solve the other behavior.
[Galaxy Note II Original Android Development] daveid:
Perhaps I can get a log one of these days... will want to to a fresh nandroid so I can simply restore without having the hassle of setting my many widgets back up, again. This all occurred on my recent vacation, which was the first time I used the dock since using this framework mod, I just thought it was something wrong with my setup till I saw the previous posting. Time is limited for me right now... but will see what I can do.
[Galaxy Note II Original Android Development] chrisryn:
OK so my next question i'm finally making progress. Just need one clarification I know I need to (in smali) find method .method public constructor <init> and then change const/4 v1, 0x4 to const/4 v1, 0x5(just example) is that something that can be done with xposed.
[Galaxy Note II Original Android Development] Pliind:
Re: Making "Stock" Custom ROMs Defunct (XposedFramework) - Tweaks for any ROM Version

What app do you want the logcat for? If its the xposed app you should find it in the file i linked you a couple days back.

Never mind Heres a fresh logcat

pliind.dyndns.info/debug2.log
[Galaxy Note II Original Android Development] rovo89:
You can't do it exactly like this. As mentioned in the tutorial, the smallest sensible unit for hooking is on method basis (including constructors). So you would need to get a reference to the constructor first. Here is one way to do it: http://xdaforums.com/showpost.php?p=36362771&postcount=301. You can also use XposedBridge.hookAllConstructors or the XposedHelpers.findConstructor* methods. The you can execute your own code either before or after the method. You cannot change the code inside the method (you can, however, avoid the call to the method completely, which I wouldn't recommend for a constructor). So you need to check why the value needs to be changed from 4 to 5. Is it stored in a variable? Then maybe you can change this variable to 5 after the constructor is finished. Is it the parameter to another method? Then you could hook that method instead and change the value of the paramter to 5 before the method is called. Something like this. It really depends on the target.

This is the debug.log. It's useful if some code inside Xposed or a module doesn't work (for example because it tries to hook a method which doesn't exist), but it doesn't contain errors that occur in code outside of Xposed. I'm pretty sure that there are some good tutorials how to obtain a logcat here on the forums, either via adb, shell or an app. When you create it, please make sure it includes the FC, so create the logcat right after the crash has happened.
[Galaxy Note II Original Android Development] Pliind:
Re: Making "Stock" Custom ROMs Defunct (XposedFramework) - Tweaks for any ROM Version

Oh and what do i do about the battery full notification not going away? Im guessing this has something to do with the dock aswell.
[Galaxy Note II Original Android Development] dannejanne:
I had to uninstall Xposed framework because for some reason it made Final Fantasy Dimensions to not work at all. It just closed without any message at all. Uninstalling Xposed fixed my issue.
[Galaxy Note II Original Android Development] rovo89:
Thanks for reporting this. The fact that there is no message makes it pretty hard to find out what the reason is as I don't have the game. So you (or somebody else experiencing this) would have to create a logcat of the crash, sometimes errors are mentioned only there.

--------------

As for docking crash: Pliind has sent me a logcat with this error:

FATAL EXCEPTION: main
java.lang.RuntimeException: Unable to instantiate receiver com.android.systemui.DreamsDockLauncher$DockEventReceiver: java.lang.ClassNotFoundException: com.android.systemui.DreamsDockLauncher$DockEventReceiver
at android.app.ActivityThread.handleReceiver(ActivityThread.java:2251)
at android.app.ActivityThread.access$1500(ActivityThread.java:140)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1303)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:4898)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1008)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:775)
at de.robv.android.xposed.XposedBridge.main(XposedBridge.java:103)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.ClassNotFoundException: com.android.systemui.DreamsDockLauncher$DockEventReceiver
at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:61)
at java.lang.ClassLoader.loadClass(ClassLoader.java:501)
at java.lang.ClassLoader.loadClass(ClassLoader.java:461)
at android.app.ActivityThread.handleReceiver(ActivityThread.java:2246)
... 11 more

I checked his SystemUI.apk and indeed the class doesn't exist. However, the following appears in the AndroidManifest.xml of the same APK:

<receiver android:name=".DreamsDockLauncher$DockEventReceiver" android:exported="true">
<intent-filter>
<action android:name="android.intent.action.DOCK_EVENT" />
</intent-filter>
</receiver>

So the ROM is inconsistent. Basically, this removal commit was only included partly.

Pliind then tested without Xposed and the same FC occured. So it's not Xposed's fault, this error just has to happen when a class is referenced but doesn't exist.

------------------

@daveid: Maybe you can check if your ROM has the same problem. The destroyed widgets are probably caused by the SystemUI crash. When mine crashes, it often resets the wallpaper on GoLauncher Ex.
[Galaxy Note II Original Android Development] daveid:
Is there a way to check without crashing it and potentially blowing my widgets out? If so, I will today, if not... this weekend.

Either way, what are the chances of a fix?
[Galaxy Note II Original Android Development] rovo89:
You don't necessarily need to reproduce the problem. You could use apktool or something similar to decompile your /system/app/SystemUI.apk. Then look for DOCK_EVENT in AndroidManifest.xml. If the class for the receiver doesn't exist in the smali folder, you have the same problem.

The solution is to remove the whole <receiver> tag, then build the APK again and push it to the phone. I don't know if it needs to be signed, I prefered writing Xposed to avoid this trouble. ;) Pliind wanted to contact the author of his ROM as this should be fixed once for all users of the ROM.
[Galaxy Note II Original Android Development] daveid:
It is the same, I am pretty sure we are running the same base ROM. I will let the author of my version know about this, but what should I tell him? I will point to this thread.

I decompiled it and found the DOCK_EVENT in the manifest, and checked the smali folders for a corresponding smali file, but there were none.
[Galaxy Note II Original Android Development] rovo89:
I explained the issue in my post above, so you can point him to that one. And well, as the class doesn't exist, there is no sense in keeping the <receiver>, so just remove it.
[Galaxy Note II Original Android Development] daveid:
He doesn't seem willing... I will attempt to fix it myself, wish me luck.

Sorry for the off topic, thanks for all your help.
[Galaxy Note II Original Android Development] Pliind:
Re: Making "Stock" Custom ROMs Defunct (XposedFramework) - Tweaks for any ROM Version

My rom creater gave me a new systemui and all is good now with the dock.

Big props to Rovo89!
[Galaxy Note II Original Android Development] Elle233:
Re: Making "Stock" Custom ROMs Defunct (XposedFramework) - Tweaks for any ROM Version

Any idea it will work for N7102 (Dual SIM). Considering buying this phone if I eventually make my trip to China. It works wonders with N7100.
[Galaxy Note II Original Android Development] rovo89:
Chances are very good that it will work. Actually, it will work for most phones with an ARM processor, an Android 4.0+ ROM and root access (at installation time). Exceptions might be ROMs which are very different from the original Android code in some very internal, central code parts. But this is related to the ROM, not the phone itself. Also many modules will only work for some ROMs as they usually target the higher level code, which is more likely to be changed between ROMs and versions.
[Galaxy Note II Original Android Development] Elle233:
Re: Making "Stock" Custom ROMs Defunct (XposedFramework) - Tweaks for any ROM Version

Thanks bro
[Galaxy Note II Original Android Development] lingowistico:
Same here with EnableCallRecording.apk. What's up with that?
[Galaxy Note II Original Android Development] pulser_g2:
Are you running a version of Android older than 4.1? I set it to only work on 4.1, as the patch only works on 4.1, where Samsung left the features in, but disabled :)
[Galaxy Note II Original Android Development] Tungstwenty:
In my opinion it wouldn't hurt if everyone sharing mods would target them to 4.0 and above.

It's a given that it's not guaranteed to work, even for the same version. Changes in device, ROM, etc. are *already* possible causes for the mods not to work, so the apk might as well be targeted to sdk15 and above irrespective of what the author managed to test it on. The description could state "tested on I9100 stock 4.0.4" or whatever; then it's up to the user to check if it works for him or not.

Reducing the min/target sdk to 15 shouldn't hurt ...

EDIT: For this specific mod, I'm not sure if it will work on 4.0, but I do know that call recording was possible by doing a small change (likely the same) plus replacing a lib file on some of the devices.
[Galaxy Note II Original Android Development] lingowistico:
Oh, well that explains it :)

I'm on ICS.
[Galaxy Note II Original Android Development] pulser_g2:
Reason I did it was I know the change will ONLY work on JB, where Samsung included their code for recording, just disabled the button via CSC or setting.

I figured since I know it won't work on ICS (where AFAIK they didn't do that), there is no point in giving people false hope, as they will then want help with it not working - at least with this, we know they can't install it... Then we don't have to try to diagnose it :)

Perhaps long term we need a way to flag known compatibility of mods?
[Galaxy Note II Original Android Development] Tungstwenty:
Yup, but it won't be easy :)

Perhaps a reporting system where users would be able to "tag" the published binaries as working or not for certain combinations.
[Galaxy Note II Original Android Development] pulser_g2:
Re: Making "Stock" Custom ROMs Defunct (XposedFramework) - Tweaks for any ROM Version

If we based this on the board name, and release version, I reckon it should be possible to give a +/- 1
[Galaxy Note II Original Android Development] pulser_g2:
That sounds a good idea via CCK :) I've noticed quite high traffic to the repository (which is good, as it means people are using Xposed!), if it got slow I could probably help you out if needed. :)

Yup sounds fair, I think your idea is realistic. I reckon that the tick/cross approach would be good, and if we can spot a learned trend through it, we can indicate a "might be, but not tested". If the dev can flag that it needs something, that makes even more sense :)

RE the end goal, perhaps we simply want to use boolean compatibility, and let the developer set it at first. Later on, user compatibility can be added, once you have reporting back enabled :)
[Galaxy Note II Original Android Development] MohammadAG:
Awesome work on Xposed!

One thing I can't figure out, how do I hook AudioManager (from android.media)?

I tried using IXposedHookLoadPackage with package "android" and using

findAndHookMethod("android.media.AudioManager", lpparam.classLoader, "setStreamVolume", new XC_MethodHook()

but that didn't work.

java.lang.NoSuchMethodError: android.media.AudioManager#setStreamVolume()#exact

Any tips?
[Galaxy Note II Original Android Development] Tungstwenty:
android.media.AudioManager is a class that runs in the context of each app, but that communicates with the system service (under the "android" package). Depending on what you want, you might hook the system service instead of AudioManager on each app.

AudioManager.setStreamVolume calls a remote method with the same name on android.media.AudioService. Hook that one instead.

The part you're missing is the parameters used by the method. There isn't any with that name and no parameters.

Try:

findAndHookMethod("android.media.AudioService", lpparam.classLoader, "setStreamVolume", int.class, int.class, int.class, new XC_MethodHook() ...
[Galaxy Note II Original Android Development] xavier6303:
I really like this framework but I'm having mixed results. I like having the mail clients (gmail and com.android.email) in tablet mode with the folder listing on the left and the messages for the folder on the right (in portrait mode). The tweakbox xml file has gmail setup this way with:

<int name="dpioverride/com.google.android.gm/swdp" value="600" />

Gmail shows exactly how I want it to so I figure I could apply an identical entry for the android email client and just change the package name which would look like:

<int name="dpioverride/com.android.email/swdp" value="600" />

The problem is that has no affect on the android email client. So I decided to try it in the Xposed App Settings. I edited com.android.email to be 240 dpi, 600x1024, and tablet mode checked. I then saved the entry and rebooted. Then I opened up Xposed App Settings and verified that teh settings stuck (which they did). The I open the email client and its not in the two column tablet mode.

I am on Jedix9 which is a TW based rom. The funny thing is I had it working 1 time and Im using the same settings but it wont work now.

Also, can anyone explain what the swdp as opposed to density? Is the swdp the screen size/resolution?

Thanks

-Kevin
[Galaxy Note II Original Android Development] rovo89:
Well, kind of. swdp is the length of the smaller size of the screen (and it usually depends on the density due to the unit "dp" [= dip]).

I just tried, when I set the screen size to 600x1024 (which sets swdp to 600), I get two panes. No other settings are necessary for me. Can you click on "List Res" and verify that "layout-sw600dp" appears there? Just because the app has the same name, it doesn't mean that the app is the same, especially for those system apps (I'm using CM10.1).

Oh, and I strongly recommend to use App Settings for this instead of Tweakbox as the latter won't get any more updates, at least not for this feature.
[Galaxy Note II Original Android Development] xavier6303:
Well, I unchecked the tweakbox as I'd rather just use the app settings anyhow... just didnt know all the settings to use in the app settings to match the tweakbox but I'll figure it out.

Anyhow, I set the email to be 600x1024 and the res shows it as 359. I have saved and rebooted and still no change.
[Galaxy Note II Original Android Development] rovo89:
In short: The app doesn't have any special layouts for larger screens, thus you won't have any chance to make it display in two-pane mode.

There are only two folders for layout, "layout" (default) and "layout-land" (for landscape). In my ROM and in Gmail, there is e.g. "layout-sw600dp", which is applied when the screen has a minimum smallest width of 600dp. App Settings tricks the system into thinking the screen has 600x1024dp and as a result, those resources are loaded. As the layouts in this folder are for larger screens, they often use something like the two-pane mode. Btw, the "tablet mode" triggers layouts with "xlarge" in their name to be loaded. As this doesn't appear anywhere here, it doesn't make any difference.

There are some image resources which are loaded at a minimum screen width of 359dp resp. 360dp for large resolutions (xhdpi = 320dpi), some of them limited to Japanese or Korean. Pretty strange combinations in my opinion, but ok. Just ignore them.
[Galaxy Note II Original Android Development] xavier6303:
Ahh, it's very possible that I had it working while on an AOSP rom rather than the touchwiz. I have been flipping back and forth because, as much as I love AOSP, I really like samsungs camera but thats it. So, I guess I was assuming that the com.android.email TW client was the same as the com.android.email from an AOSP rom but I guess they are different. Shouldnt be too difficult to rename the samsung version and install the AOSP version though (I hope).

Thanks for you awesome framework and help with it!
[Galaxy Note II Original Android Development] rovo89:
You probably need delete one version. The package name is the unique identifier of an app - you can't have two apps with the same package name and changing the name would require modifying the APK. Good luck with that - using the AOSP should be possible, the other way around could be more problematic (in case they used functions from TW in their version).
[Galaxy Note II Original Android Development] MohammadAG:
That worked fine, thanks!

One more question, is it possible to have a BroadcastReceiver in the Xposed module? I'm trying to detect call state but it's failing for some reason, My onReceive method is never called.

This is the class that listens to the intent https://github.com/MohammadAG/Xpose.../noincreasingringtone/PhoneStateListener.java

And here's where I instantiate the class https://github.com/MohammadAG/Xpose...reasingringtone/NoIncreasingRingtone.java#L27
[Galaxy Note II Original Android Development] Tungstwenty:
Merely instantiating the listener class isn't enough, you have to register it so it actually is called whenever the situation is triggered.

Regular apps don't need to do anything in code since the declaration of broadcast receivers in the manifest will resister them as listeners. But on a mod you need to do it programmatically.

Have a look at an example here: https://github.com/rovo89/XposedApp...appsettings/hooks/PackagePermissions.java#L42

In this case, a hook is placed on PackageManagerService.systemReady(), so that after it's called (somewhere after startup), a small piece of code runs which instantiates a listener (a PackagePermissions object, in this case) and is registered to listen for certain broadcasts with mContext.registerReceiver(...).

Changing the intent filter to ...ACTION_PHONE_STATE_CHANGED and perhaps adjusting the permission (you need to test if it's required) should work for you.
[Galaxy Note II Original Android Development] thaprinze:
Has anyone come across a module to enable skipping tracks on the Play Music app by holding the volume buttons? Tweakbox only seems to enable skipping of tracks on the "other" music apps. Thanks!
[Galaxy Note II Original Android Development] Tungstwenty:
App Settings mod update - 0.2

Hi,

Version 0.2 introduces the following changes vs the previous 0.0.9:

- New tweaks: Font scale; No title; Keep screen on; Insistent Notifications

- Permissions revoking now compatible with JB (4.1 / 4.2)

- More granular filtering of applications

- Shortcut to Play Store when configuring an app

- Reorganized layout of application settings screen

- Fixed issue updating list of revoked permissions

- Requires Xposed 2.1 or above

Link to the download page: http://villainrom.co.uk/forum/index.php?microdownloads/5/viewfile
[Galaxy Note II Original Android Development] rovo89:
Short explanation for that: The title bar included the action bar. Some apps crash if they want to access their action bar and it was removed without their knowledge. Also, some functions might not be available without the action bar. Therefore, you may want to enable fullscreen mode, but keep the title bar visible (try this in Google Maps for example). In the previous version, the "fullscreen" toggle included also disabling the title bar. Now these two are separated.
[Galaxy Note II Original Android Development] neol23:
Re: Making "Stock" Custom ROMs Defunct (XposedFramework) - Tweaks for any ROM Version

I miss "play" button in app config screen, where u can check how the moded app works, right after changing the settings...
[Galaxy Note II Original Android Development] Tungstwenty:
Use the menu key (or the overlay "..." icon).

As there are additional entries on the title bar, depending on your screen resolution the ones that don't fit end up in the menu and "Launch" is probably one of them.
[Galaxy Note II Original Android Development] neol23:
Re: Making "Stock" Custom ROMs Defunct (XposedFramework) - Tweaks for any ROM Version

Yeas, u r right. Didn't thought of that...

Thanks,
[Galaxy Note II Original Android Development] jujuburi:
Re: Making "Stock" Custom ROMs Defunct (XposedFramework) - Tweaks for any ROM Version

I've updated today to Version 2.1.1. All the modules which I was using in previous version, 2.0.2, works here too, Call Recorder, Tweak Box, Long SMS and Received SMS's time. Are there any updates for those modules too?

Thanks in advance.

'Swyped' from my GT-N7100
[Galaxy Note II Original Android Development] pulser_g2:
Re: Making "Stock" Custom ROMs Defunct (XposedFramework) - Tweaks for any ROM Version

The modules don't need updated unless the author changes something. Four something like longsms, I'd not really ever anticipate an update - I return one value differently. It should work on basically any current or future ROM.

If there are updates, you can get updated by the repo if you are following them.