[Help] Xposed module for whatsapp implement last seen tweaks. - Xposed Framework Development

hi, I've developed an xposed module for whatsapp.
http://forum.xda-developers.com/xposed/modules/mod-whatsapp-extensions-add-extra-t3452784
I wanted to add feature to hide our own last seen still see others or report a fake last seen for eg: 1 Jan 1970.
I made following assumptions:
To do that first I hooked date and System.currentTimeInMillis methods to make whatsapp think its 1 Jan 1970. That worked but still last seen was shown perfectly.
Assumption: The last seen time value is directly taken from the server
Then I looked in the source to find where last_seen preference is referenced. Turns out it is only referenced in SettingsPrivacy activity's class.
Assumption: To hide our last seen ans see others we need to change last seen preference to 'visible to all' and turn that back to off once we get the last seen.
but the problem is it uses onPreferenceChangeListener. We cannot hook a method from the interface directly.
I cannot find the subclass which implements onPreferenceChangeListener as the classes shown in code are synthetic.
Please if anyone can help me with this, it will be great. I need to find which is preferencechangelistener for that preference. Rest I will manage.
Thanks.

http://forum.xda-developers.com/showpost.php?p=68477857&postcount=2
Changelog for 1.2:
Timeout settings changed - Locks after you exit WhatsApp.
Not working. Chat is stull unlocked after I exit whatsapp. It only works if I kill whatsapp. Not sure if you mean exit as kill app, I thought it would be background (but maybe you'll have the issue when you open pictures/videos in app)

I started this thread in hope that I'll get some assistance but nevermind I figured it out. The class bbv implements on preference change listener. It has a method onPreferenceChanged which accepts the parameter of type WAPrivacyPreference. So you have to construct the instance of WAPrivacyPreference and pass it on to the function.
So basically what we are doing is temporarily turn on the last seen till we get other person's last seen and turn it back off once we are done. I dont think there is a better way to it other than this.
check it out: http://forum.xda-developers.com/xposed/modules/mod-whatsapp-extensions-add-extra-t3452784

Related

AppFinder on Windows Phone 7

Check out my free app in the Marketplace: AppFinder
AppFinder is the fastest way to find apps by name bar none.
Start typing the name of an app or publisher, and the search results are shown instantly.
tap one of the results to go to the marketplace page for the app.
Check it out and let me know what you think
Been using it last couple days, its a big help! Thanks!!!
I'll check it out thanks!
Thank you - it's very fast like the marketplace search should be. Good for quick looking apps if you know the name.
Are there any improvements coming? Like the Top Downloads or anything else?
appfinder feedback
thanks for the feedback - I'm on it
Great app, thanks!
BTW I can't find HTC Hub...
I think you need an HTC device for that sorry buddy
zukŠ° said:
I think you need an HTC device for that sorry buddy
Click to expand...
Click to collapse
Yeah but some guys were able to find it...
AppFinder
Ok, v1.1 has been submitted to the app marketplace and is ready for testing - should show up in the marketplace as an update within a few days
ebadger said:
Ok, v1.1 has been submitted to the app marketplace and is ready for testing - should show up in the marketplace as an update within a few days
Click to expand...
Click to collapse
does this fix the crash where it closed and wouldn't reopen for me (even after soft reset)?
I had to uninstall, reinstall to get it working again.
I don't think so.
Although I think I know the cause. I will have to roll the fix into another update.
I think there is a small window where the downloaded data file can be corrupted if the writing to flash is interrupted. It will be simple to fix. For now, if you hit it, uninstall reinstall is the only option.
nice find. but did you know while in maketplace you can use the search button to find apps as well?
jimecm said:
nice find. but did you know while in maketplace you can use the search button to find apps as well?
Click to expand...
Click to collapse
Of course I do
AppFinder is all about making apps discoverable in the fastest way possible.
I think if you're not in the top 20 apps in the marketplace under any one of the categories, then as a developer you're invisible. AppFinder seeks to make it easier to find apps via search, and with the update, via browsing as well.
Update is in the hopper, still waiting for testing to complete...
jimecm said:
nice find. but did you know while in maketplace you can use the search button to find apps as well?
Click to expand...
Click to collapse
the annoying thing is that it searches music and video as well. i can't just search for apps alone
locales
Ok, so I just figured out I've only been indexing the en-US locale
I've updated the data to include
{ "en-US", "en-GB", "en-IE", "en-CA", "en-IN", "en-AU", "en-HK", "en-SG", "de-DE", "fr-FR", "fr-BE", "de-AT", "de-CH", "it-IT", "en-NZ", "es-ES", "es-MX" };
this change is effective immediately as it is a data update. Still waiting for the update to make it through the approval process. It seems that the holiday has slowed things down a bit
The update finally arrived
Nice new features and still very fast. But unfortunately, in my case, it wont load after the second app start (even at first start if I switch the section). I always have to deinstall/reinstall again once the app was started.
Maybe you can take a look? Feels like a caching problem or something like that. I'm using a Samsung Omnia 7 in germany - if that helps
Feature wishlist:
1. add a settings screen to edit:
a.) the number of list entries on one page (10, 20, 50) to keep the app fast enough
b.) the section on loading (and maybe you also can set this to no section just for fast look-up app search - I used the app for this before the update)
2. Maybe you can use the OS-typical "left-to-right-scrolling-loading-dots" instead of the big ones?
3. New logo if there is enough time
PrivateJoker said:
The update finally arrived
Nice new features and still very fast. But unfortunately, in my case, it wont load after the second app start (even at first start if I switch the section). I always have to deinstall/reinstall again once the app was started.
Maybe you can take a look? Feels like a caching problem or something like that. I'm using a Samsung Omnia 7 in germany - if that helps
Feature wishlist:
1. add a settings screen to edit:
a.) the number of list entries on one page (10, 20, 50) to keep the app fast enough
b.) the section on loading (and maybe you also can set this to no section just for fast look-up app search - I used the app for this before the update)
2. Maybe you can use the OS-typical "left-to-right-scrolling-loading-dots" instead of the big ones?
3. New logo if there is enough time
Click to expand...
Click to collapse
Private Joker,
Thanks for the feedback.
First - there was a bug that only impacted the German locale! I was trying to save bandwidth by truncating unnecessary leading zeros in the price and this caused an exception when the locale was set to German. I've updated the data to include the leading zeros and this fixes the problem for Germans. You will have to uninstall and reinstall though to get it to work. I am very sorry for the inconvenience, and I really appreciate you taking the time to give me your feedback even though the app was not working for you at all. I hope you will try again given that the data has been fixed.
Regarding your feedback -
I think you are right on the mark for #2 and #3
I don't understand 2b.
regarding 1a.
perf should not be impacted by the number of items that are shown -
Appfinder actually transfers the marketplace data to the device and indexes it locally. I do this because the network is really, really slow. Aside from having artists and albums mixed up with apps in the marketplace search results, I also was tired of waiting for results to load. Scrolling through the apps means waiting.
The delay at the beginning is caused by reading the marketplace data from flash and indexing it in RAM. Occasionally the loading dots will appear after launching (like the first time that you use it) because AppFinder has transfered a new data file and needs to parse it again. Instead of delaying every 10 or so apps in the list, there is one delay at the beginning (which is relatively small). Right now parsing the file takes about 4 seconds.
Perf could be greatly improve if I had access to memory mapped file APIs. Further compressing the data would help as well - The really slowest part is really reading from the flash. I can improve perf when a network update occurs by reading from the flash in the background before blocking - this would drop the update delay from ~4 seconds to ~1 second.
I could also not query as you're typing -- Waiting until the enter button has been pressed would reduce CPU load and any chunkiness - pressing search would just render the apps instantly.
Anyway, really appreciate your positive attitude and willingness to give feedback in light of what must be a frustrating experience. Please give it another try.
Thanks,
Eric

Hardcoded Password in GPS Library

Hey everyone, I've been a lurker for quite sometime, so I'm finally posting something. This is isn't in any of the dev sections because this is my first post.
When I first got my GNex (toroplus) was very annoyed with the capabilities of the gsd4t gps chip. Static navigation makes it really hard to use the chip for telemetry projects and the 1Hz position update doesn't give me enough sample data for the things I'm working on. I decided to do some investigation to see if it was limited to the hardware itself or the driver.
I scoured the forum, and tried a bunch of apps, found datasheets and the what not and nothing really improved my situation. I decided to take matters into my own hands and poke around lib_gsd4t.so (stock).
With verbose logging turned on, I noticed an interesting looking entry.
Code:
Hello EE downloder !!!.
{sgee.samsung.csr.com, instantfix.csr.com}, port : 80
Y3Nyc2xsOmROTkw5NnN1, /diff/packedDifference.f2p3enc.ee, format 2
EE_DOWNLOAD: EE_Download_Init done.
EE_Download_Init - returned 0 !!!.
EE_DOWNLOAD: EE_Download_Start successful.
EE_DOWNLOAD:EE_Download_Scheduler started; server_address=(sgee.samsung.csr.com,instantfix.csr.com), port=80, file=/diff/packedDifference.f2p3enc.ee
...
The string Y3Nyc2xsOmROTkw5NnN1 really stuck out to me. The character set fit in the base64 space which for some reason or another, developers seem to think base64 encoded text is somehow a good way to make things more secure. I have seen this numerous times. To me, it just makes it more noticeable that someone is trying to hide something.
So I went ahead and decoded the string and got
Code:
csrsll:dNNL96su
Just to be sure it wasn't some string unique to my phone, I checked where it most likely came from, which is the lib_gsd4t.so and it is indeed there (@offset 0x1b7429).
What's so special about that string?
I'm almost 100% sure that it is the username : password combo for downloading the SGEE data. I'm guessing it is using a post request (anyone wanting to use wireshark to packet sniff this can confirm) because there are extra parameters being used to retrieve the data.
Have I tried to access the file with those credentials?
No.
Why am I posting this?
I thought it was funny that the username and password are hardcoded in the driver and written to the logs. What's the point of having it password protected if you're just going to tell everyone the account credentials?
My actual job involves application security and I used this as an example for the other programmers on my team as to why we shouldn't ever mistake encoding for encryption and if you try to hide something, chances are you are actually drawing attention to it.
Oh also, is anyone interested in knowing more about the library. I have figured out quite a bit
How odd!
If you've figured out the gps drivers maybe you know how to make an updated file to disable static navigation? I op'd this thread http://forum.xda-developers.com/showthread.php?p=38684789 based on the ics version, but would love an android 422 based mod.
I posted my modded drivers. It may also require new configs.
afrotronics said:
I posted my modded drivers. It may also require new configs.
Click to expand...
Click to collapse
Did you ever figure out the proper request? (curl or wget?)

[Q] Zooper and Tasker

Can someone assist with the %FOTO variable.
I'm trying to create a widget which will display the very last picture i took and also act as a shortcut to my gallery when tapped.
I have set up the variable in tasker, using this information provided here: http://www.jagwar.de/zooper-tasker-variables/
I have put in the #zoopervariable# into Zooper using a blank bitmap, but is displays nothing?
I read somewhere that its because Zooper or Tasker is looking for images in the wrong location, is this true?
If so, how can this be changed?
Thank you
I'm pretty handy with both Zooper and Tasker, and was about to give the simple answer to this, but I figured I'd test it first, and ... there's an issue in Tasker with %FOTO getting the correct path to the last photo taken by the device's camera and/or accessing the path to this photo.
I think this is a combination of what device you have, what version of Android you're running, along with Tasker and Zooper.
Because in Tasker's documentation it says %FOTO should get the path to the last photo taken by the internal camera, but, it doesn't, depending on where the device's camera puts it.
So, it may not be able to be done, unless you use Tasker to take the photo, and in there you can specify any path/filename you'd like, and then push that over to Zooper using the Action>Plugin>Zooper>Set Variable.
If I manage to get Tasker to pull the correct path/filename to the last photo I took just using the device's camera (and not a Tasker action) I'll post it here. For reference I'm on Galaxy Note 4, Lollipop.
EDIT: As I suspected after doing a little research it's a combination of all that crap I mentioned above. At the very least if your camera/device is set to store photos on the External SD Card it's likely Tasker can't read it properly. But if your camera stores it internally Tasker MAY be able to read it, again depending on the vertsion of Android and the device.
Reference THIS LINK for more info on the problem.
There may be someone out there who has a workaround. Just have to Google Search a bit more. I guess a lot has changed since Jagwar posted that info in August, 2013. It's a good resource but there's some things that have changed in past couple years, looks like this is one of them.

Q:xposed hook all methods of an app and the impact of the performance

I developed a module to monitor the performance of an app (for example: wechat , whatsapp, any app is ok), my motivation is to get the delay of all the methods of the app. So first I get all the classes list and save as a txt file in sdcard, then in my module I read the class name one by one and get declaredmethods and hook every method of the class.
Actually this module successed, but the app (wechat app) crashed (NO RESPONSE) , the app is very complicated and the large amount of classes,methods hook impact the app's normal running.
Q: I want to know tracking and hooking all methods of an app is possible? HOW TO FIX THIS PROBLEM THAT THE APP DO NOT RESPONSE?
wendy_1805 said:
I developed a module to monitor the performance of an app (for example: wechat , whatsapp, any app is ok), my motivation is to get the delay of all the methods of the app. So first I get all the classes list and save as a txt file in sdcard, then in my module I read the class name one by one and get declaredmethods and hook every method of the class.
Actually this module successed, but the app (wechat app) crashed (NO RESPONSE) , the app is very complicated and the large amount of classes,methods hook impact the app's normal running.
Q: I want to know tracking and hooking all methods of an app is possible? HOW TO FIX THIS PROBLEM THAT THE APP DO NOT RESPONSE?
Click to expand...
Click to collapse
I don't think the hooking is the issue there, but what you do in your methods. I guess this must be quite computationally expensive (maybe not just one method, but if one of your method adds a small delay, and if all your multiple methods do the same, the sum of small delays will add up to a very huge global delay).
A few common ways to alleviate the time required for computations is to either pre-compute and store in persistent, static variables and limit the number of input/output requests (so that you compute/get from Android libs once most of the stuff you need, and then you share this data between different methods), and to use more efficient algorithms (in term of computational complexity, see Wikipedia) if available.
If this doesn't fix your issues, you should post some code snippets so that people here can better see what kind of job your methods are doing.
lrq3000 said:
I don't think the hooking is the issue there, but what you do in your methods. I guess this must be quite computationally expensive (maybe not just one method, but if one of your method adds a small delay, and if all your multiple methods do the same, the sum of small delays will add up to a very huge global delay).
A few common ways to alleviate the time required for computations is to either pre-compute and store in persistent, static variables and limit the number of input/output requests (so that you compute/get from Android libs once most of the stuff you need, and then you share this data between different methods), and to use more efficient algorithms (in term of computational complexity, see Wikipedia) if available.
If this doesn't fix your issues, you should post some code snippets so that people here can better see what kind of job your methods are doing.
Click to expand...
Click to collapse
Thank you for your answer. Actually I just print a log after the hooking. "System.out.println("packagename: "+param.thisObject.getClass().getPackage()+" classname: "+param.thisObject.getClass().getName()+" method name: "+param.method.getName());" I choose the simple log to test if hooking all methods of an app is possible. But after I hooking every methods of the wechat app, I click the icon of wechat and the phone showing blank screen then pop up dialog box "No responsing!"
wendy_1805 said:
Thank you for your answer. Actually I just print a log after the hooking. "System.out.println("packagename: "+param.thisObject.getClass().getPackage()+" classname: "+param.thisObject.getClass().getName()+" method name: "+param.method.getName());" I choose the simple log to test if hooking all methods of an app is possible. But after I hooking every methods of the wechat app, I click the icon of wechat and the phone showing blank screen then pop up dialog box "No responsing!"
Click to expand...
Click to collapse
System.out.println is an I/O so if it often gets called, this will hugely slow down your app. You should rather use Log.d("YourAppName", "Your debug message here"), which will only print when connected to a debugger (so if you disconnect your phone from your IDE, you should get an app with full speed since the debug statements will be ignored).

How to hook all * extends java.io.Reader|Writer

I am trying to write a module that hooks (first off all, later only specific) in/output streams and readers/writers to analyze the content.
First try was to hook java.io.Reader.read with all 3 read method signatures - this didn't show very much, so I guess it only hooks real java.io.Reader, and every method who overrides the specific method without calling super will not get hooked.
So I tried to just get all classes and look, if they are java.io.Reader.class.isAssignableFrom(every_single_class) //all classes that extend Reader, or a check if Reader r = new c();
- it turned out it is harder than i thought to get all loaded classes from a classloader.
Tried so far:
1. In desktop-oracle-java you could, via reflection, make the classes-field of a classloader (from the LoadPackageParam lpparam) visible, and it would contain an array of all classes. Android Java does not have this - this field simply doesn't exist.
2. Digging deeper into the android source, it seems like the VMClassLoader inside the normal classloader handles this, but it internally it calls a native loadclass method, so I can't access this data here.
3. My next try was to use the reflections.org lib (pulled via maven) - and every suggested method like getSubTypesOf(Object.class) and many others.
4. Now i tried to hook loadClass of classLoader, but this seemed to lead to an stackoverflow or something like that, i think.
5. I also tried to hook findClass of classLoader, but it seemingly never gets called?
So, what is the correct way to get all subclasses of java.io.Reader (inside a specific classloader) in XPosed framework? To me, it doesn't seem to be a too weird feature to have.
Also: Is there a way that I don't have to restart my phone after every new app version? Or to at least disable the "optimizing 100 apps" on every third boot. (Carbon rom, Android 5.1)
bump. im also interested in this
Very interestd topic!
I found a github project that should be able to do this, and I think I also found the according class.
github.com/baer-devl/DAMN/blob/master/src/at/fhooe/mcm14/damn/xposed/XHookAll.java (i'm currently not allowed to post real links because <10 posts)
There is also a 90-pages master thesis with about ~10 pages about hooking. If someone is interested, I can ask if the author allows to publish/upload it.

Categories

Resources