[Help Needed - Xposed] First Xposed module, made some progress but stuck - Android Software/Hacking General [Developers Only]

Hi,
So bare with me I'm not an Android developer but I'm doing my best. I'm not sure I'm posting in the right place either, I saw there is an Xposed dedicated Forum but it doesn't seem to have any Questions posted to it, only Release of Modules. So forgive me if this is the wrong place. To the point :
I've created an Xposed module. Right now it is very simple, I was able to listen on two methods in a class of an application I want to use as my events. (Hooks)
When I start that Application, lets call it AppX, I log to Xposed Log and I can see my Hooks being called correctly. So the hard part I think is behind me, I decompiled AppX, found the methods, made my Module, hooks are working.
Now I want to perform some actions on those Hooks.
I want to pop a notification with 2 buttons, every 1 hour, WITHOUT being dependent on AppX context. I don't care anymore what happened to AppX.
The button would be, Snooze and Dismiss, I know I need to implement them, and I'll read up on documentation to create the notification. My problem is, where I am stuck, I don't have an Application Context or any other Context in my class.
If I extend Application or Activity, I get problems from Xposed when I try to load my Activity. I just need some guidelines in the right direction, and I'll go back to trying. Iv'e been trying now until my head hurts without bugging you guys, and I'd appreciate the help.
To Summerize :
Found Class and Method to hook on - Done
Implemented Hook - Done
I know which Actions I want to perform - Notification
Help needed to continue.

Related

[Q] How do I customise a preference to display a time picker widget through XML

Hey guys!
Firstly I'd like to say that I have only been working on Android for about a week now, so I guess you can consider me a newb! Therefore I apologise in advance if the solution is overly simple, but I can assure you that I have done my research before posting here, and haven't found an appropriate solution as of yet (or maybe I have and don't fully realise it!). Nonetheless, having lots of fun and just want to solve this problem and learn, so here goes...
The Application
The application I am developing is essentially a reminder service, and I am currently working on the preferences screen.
The Problem
I would like the user to be able to specifiy a time when he/she will be reminded daily. I want this selection to be done via the preferences screen. This is how my preferences screen looks so far...
[http]://img87.imageshack.us/img87/3129/preferencesm.png
My Question
Ideally, whenever the user selects the "Alarm Time" preference, I would like the following to appear
[http]://img580.imageshack.us/img580/2366/timepickerwidget.png
My question is, what is the best way to create this? I really want to keep all the visual aspects of the application using only XML, therefore I don't want a Java solution. Is this possible or am I completely off track? Other potential solutions I have heard of are using themes, alert dialogs and extending preference classes etc. Maybe some of these are correct, but I am unsure.
Any help would be greatly appreciated, thanks!

[Q] Samsung Focus S = Not hack friendly

So, I have the feeling this isn't the place to post this, but seeing as how I was unable to find a section for the Focus S (yet there is one for the HTC Titan, which isn't even out yet) I figured I might as well post somewhere.
I've interlop unlocked and loaded a few different .xap's onto my device and have found that most either will not work (they close shortly after loading up) or they allow you to navigate around, but not edit anything. Advanced Config, Registry Editor, Samsung Tools, etc. will not allow for any kind of registry changes. Is there anyone who can point me to the right place for solving this issue?
Give me, oh, another hour. Reverse engineering the Focus S DLLs now. Already have registry, provxml, quite possibly filesystem, and a few other things (including the interface for call blocking, which doens't seem to exist in the older phones - sorry people with first-gen phones).
The new SecProxyClient.dll is super-useful. The new FCRouterProxy.dll looks to be amazing too, with lots of new APIs, but they obfuscated the function signatures, so it's going to take me a while to figure them out.
Of course, I don't have Focus S or Focus Flash, so I'm going to need some testers to make sure I've reassembled these APIs correctly. Any takers? I make no guarantee that these functions will work correctly, and if they don't it could mess up something, but I'll try hard to avoid that.
EDIT: Of course, the apps will need to be modified to use the new APIs and DLLs. It's not like I can publish my results and eisting apps will magically just work. I'll include the source of course, though, so it should be easy to build on my work. If schaps were willing to distribute the source for his own apps, I could fix them myself, but no such luck. That's what you get for closed-source, I guess.
I'm right here to test what you need.
I am more than willing to test. Just post it here or shoot me an email: [email protected]
I'm western time, so ill be up for a while
Yeah, I'm not.
Ill leave the testing for you, hope you guys have **** worked out by the morning.
i'm also willing to test as well, but please don't break my phone
All right folks, have at it. I'd like a few testers from each device, if possible, but mostly I just want good reports. PLEASE read the first post carefully - yes, I know it's long, but it will save both of us time.
http://forum.xda-developers.com/showthread.php?t=1348914
Moved to WP7 Q&A
You are correct there is no focus s forum. There are some posts relating to that phone there, but they are different so i will not move it there. As it is a question it has been moved to WP7 Q&A. Hopefully if and when a focus s forum is created you can request the thread is moved again.
Take it easy
O_G
You know, I'm beginning to wonder of the reason that the call blocking app is struggling so much is just because there's a problem with this DLL that it is (and I am) trying to use. Sigh...
Speaking of which, if anybody can get me the XAP for the Call Blocking app, or for any other Samsung Gen2 app, that could be very helpful.
Here you go

Custom/reliable rom/operating system

So I am going to post this here, because the development section is ferboten to people trying to offer useful suggestions. Geez, I hope this is the right section.
Let me set it up. ANDROID IS BASED ON THE LINUX KERNEL. Everything, and I mean everything after that fact becomes android and bloat. Given this as the basis of all things android, I have a simple set of guidelines that should be used to create a solid, reliable, bullet proof operating system for devices able to use the android operating system.
#1. Create the kernel boot section of the basic platform that supports the very basic hardware features, including touch screen, radios, power/charging/battery management, wifi, bluetooth, nearfield, audio, microphone, s-pen,etc. Basics only. Root access is standard and can be turnd on/off just like developwer functions. No special tricks or addon hoops to jump through.
#2 At this point STOP. Every single process or service to be run on the device from this point forward should be able to be individually selectable - or not. Yes, I understand that individual services or apps may have dependancies to other processes and that thouse need to be functional in order for a particular app to work. That is why, each additional service or app must list the dependencies and in the selection process, the installion will be required to verify you have the proper services installed and functioning, if not to list them and allow you to make the decision to proceed. Viola, we have NO MORE BLOAT WARE.
#3 Make selecting additional services/apps selection process a menu driven, tag selectable process. Make the unselection process smart to verify and identify the other apps dependant on the item you are killing/removing.
#4 Allow a built in snapshot option to capture the entire system as you have customized it for yourself and allow it to be backed up to external memory with the ability to bring it back, AT WILL. With no big hassles.
Those 4 items are a good start. By themselves alone, it would put all of us in the drivers seat of controlling and living with our devices.
I am aware that such a system is not for everyone. It does require some basic technical understanding of the process. But for the vast majority of users, I am certain, that an a la carte system is far superior to the bloated monstrosities being forced down our devices.
I would appreciate any refinements to my suggestions.
The silence is deafening. It has been days. Kind of says something, don't you think?
I am so very happy (not) that these boards a compartmentalized to the point where you can't get through.
Pretty much a waste of my valuable time, especially considering the fact that if my suggestions where applied, people would be clamoring for an installation with those features. I guess there is not much true "developer" in xdadevelopers anymore.
Funny guys, with the pay to remove ads spam here. Really? Why? For what.
I leave here disappointed. Not angry. Just sad.
I'm not a developer so I have nothing valuable to contribute to your suggestions in your original post but I can offer an observation regarding your perception of the level of contribution to your thread and that is the fact that is particular area of the forums probably isn't the ideal spot to have a discussion such as this. You figured that out already so sure you can call me Capt. Obvious if you wish but I'm just pointing out that yes the forums are compartmentalized (as you've stated) in such a way that development for each device is separated out. This development is centered around AOSP based ROMs or "stock" ROMs (using manufacturer released source) so if you're looking to have higher level discussions about what AOSP should look like then deep down at this device specific level probably isn't where you want to be. So there's that . . . then there's the fact that for this particular device you can basically hear a pin drop in the sub-forums as it is since nothing much is going on by way of development.
Where specifically such a discussion would see more input I'm not sure, perhaps the main general discussion section?
Thank you for your sobering reply. I get frustrated. Already had my post bounced out of "wrong" forum while trying to speak directly to "developers" (i wanted air quotes because the term does not accuratly describe its target) So I tried this. The note pro 12.0 is still the best hardware giving the ipad a run for its money. The problem its monkeyshines kiddie software running it, or not running, or barely running it. ANDROID, indian word for crappy wannabe software, developed by clueless kids.
Again, thanks for the gentle nudge. I appreciate someone willing to conduct a conversation
Are you looking for an Ubuntu or SUSE type of setup?
I think what you are looking for is similar to apt-get type of installs, I could be wrong of course. This might be helpful for many "users". I think one of the barriers is that there are slight differences between the models of tablets, and creating the logic to put in for the sub-dependencies might prove problematic. You might get more answers to this possibility by asking one of the developers directly and sharing with them. Not a developer myself.

[DEV] Porting call audio injection behavior from Google Pixel Dialer to AOSP Dialer

I'm working on a personal modding project, where I take the AOSP Dialer and add some features that I'd like to have. Long story short, for a component of this, I need to figure out how Google has been able to inject arbitrary audio into the conversation/call audio stream.
For years, discussion online, and especially on Stack Overflow, has insisted that:
There are too many upstream limitations, this is impossible
This is impossible, you have to play it over the speaker and hope the microphone picks it up
You can't do this, even Google says so
Indeed, even Google's up-to-date MediaPlayer documentation clearly shoots this down and doesn't mince words:
You cannot play sound files in the conversation audio during a call.
Click to expand...
Click to collapse
However, we know this isn't true. At least, not anymore, and not on Pixel devices. Google's Call Screening feature can "talk" to someone calling your phone, but that synthesized audio is never played audibly to the user. In other words, Google has been able play a Text-To-Speech stream of audio to someone calling your device, doing so silently, clearly to the listener, and without requiring the handset speaker or user's microphone to be "on."
Despite the fact that this is "possible" by virtue of "it has already happened," I can't find any discussion, documentation, info, or anything helpful about how Google has been able to do this. So, what do you do?
The next logical step is to start decompiling the app, but that's easier said than done. I'm by no means an expert in reverse engineering Android apps. Admittedly, you could consider me a beginner. Still, I've found a few things that seem useful, so here's what I've been able to find:
First off, when compared to the AOSP Dialer, the Google Dialer requires an additional privapp-permission that may be of interest: android.permission.MODIFY_AUDIO_ROUTING. I can't find much about what this permission does or how it is used, but it's definitely used by the Google Dialer, and on a stock Pixel 3 XL ROM, that permission is defined in /product/etc/permissions/privapp-permissions-google-p.xml as a privapp-permission.
Next, when decompiling the app, one of the first things I noticed is that a special "IMPL" package containing a playInternal function is class injected/loaded dynamically, and it's adjacent to MediaPlayer code that seems to play audio over a certain channel. The class it tries to load is:
Code:
com/android/dialer/audio/impl/CallAudioPlayer
However, that package isn't present in the list of decompiled classes (there's no "audio" folder under "dialer"), and despite playInternal being explicitly called by a string, there aren't any other classes that seem to define the playInternal function.
I don't know where XDA stands on posting decompiled code, but if you're using JADX, the area of interest is in defpackage/bhk.java.
But if I'm correct, this means that:
You can use MediaPlayer to play over the call stream, contrary to Google's documentation; you just need a special IMPL that allows for that behavior
This (probably?) requires the aforementioned MODIFY_AUDIO_ROUTING permission
If one were to obtain/locate and re-implement CallAudioPlayer.java, you could probably reproduce this behavior in the AOSP Dialer, or any other system app with the necessary permissions
If I'm not correct, then chasing down CallAudioPlayer will be a dead end. Still, the fact stands that Google did this somehow, so the answer must be somewhere.
So... that's where I'm at with this. I don't feel like I'll get much further without some help from more knowledgeable people, since I don't know where this CallAudioPlayer class is located. If it's in the base apk, but obfuscated, I can't find it. And if it's in a system framework or overlay APK, it must be using a different name, since no instances of CallAudioPlayer or playInternal exists in any of the relevant .apks on my system.
If this requires more sophisticated Android system/API modifications, that's fine too. This will end up on a custom ROM, so even if part of this behavior extends outside of the APK, any potential solution can be implemented in an AOSP ROM to achieve this functionality.
If you have any advice on how this may have been done, I really appreciate any and all discussion I can get on this. And if you don't know, I encourage you to ask a friend or someone who might be more knowledgeable when it comes to reverse engineering. Even if no one outright knows the answer to this, I hope to get at least some recent discussion on this topic, so that people investigating this in the future will at least have some sort of starting point.
Thanks for reading!
Hi. I'm no expert on Android (far from that haha) or Reverse Engineering. Though, I'm making an assistant installed as system app in a rooted Android and can also be compiled with the hidden and internal methods and classes so they can be used, like ITelephony, for example (https://github.com/anggrayudi/android-hidden-api) - btw, have you tried to mess with those classes and methods? (Sorry for my ignorance, I've no idea how it is to code/recode a ROM, what you need to use and stuff.) And anyways, I found something you didn't mention up there, so I'm unsure if you already know or not. From what Google says here (https://support.google.com/phoneapp/answer/9118387) in the "Screen calls manually" section, "Your Google Assistant screens the call and ask who's calling and why. You'll get a real-time transcript of how the caller responds.". Though, if it's their assistant doing that, not sure why that permission is on Dialer and not only on the assistant. Anyways, maybe that could be a good place to look at?
EDIT: Maybe also you (or anyone, of course) could look at sending DTMF tones over the call (I only made a quick search on Google, but there may be more that could help on this?). I think it's the same thing as it's inserting audio into the call. Though I can't be sure - btw, if it's really sending audio, then any Dialer app can already do that! But may not be that simple, so no idea at all. Maybe that's hardware thing and not software (>95% probable?). Just trying to give to ideas on where more to research.
Here (https://issuetracker.google.com/issues/36906273#comment107) it's said "I found this app, that can send dtmf after the call is made and active: https://play.google.com/store/apps/details?id=mobi.drupe.app (...)" - name: "drupe - Contacts & Caller ID" (just in case the app gets deleted from PlayStore and then people don't have their name to search for, only the package). If it's audio that it's being injected then it's possible, since that app seems to do it already, and the answer could be there too and might be good to look for the keys' frequencies on the code? Again, sorry for my ignorance on anything wrong I said. As I said in the beggining, I'm far from expert/experienced on Android.
I'll also be trying to search on how to send DMFT tones over a phone call. Could help, maybe. And if only a frequency could be sent for any reason, at least it's already cool to send some beep haha (preferably different from the ones of the keys or it might be confused with a key press by the other side, depending on who we're calling).
Late reply, did you solve this? I would like to build call features on Aosp. Best!

Access and Change System Locale

Hey xda-forum!
I am currently trying myself on some Android development and need a little bit of a head start - I usually roam around in Web Developement and Scientific Data Analysis.
I want to quickly be able to switch back and forth my System Locale in Android by using a TileService.
I know from extensive googling and reading that since Android 4.2 these system settings are protected by the "WRITE_SETTINGS" permission.
As I only wanna use this "app" on my own, I am not bothered by this as I can grant that.
The question I am asking myself is how to actually set such a permission and what the correct identifier is for setting the locale.
I unfortunatly am too stupid to find it in the Android Documentation and the often refered "MoreLocale" app doesnt help me much as it doesnt work anymore apparently and the used code is deprecated.
Would be amazing if one or multiple of you could give me a heads-up on that, either pointing me into the right direction or giving me an example!
Thanks!
infiniteWays
P.S.: I think this belongs more to Software Development but I don't have enough posts to go there ^^ Sorry.

Categories

Resources