[HTC Amaze 4G] dcacklam:
WiFI Calling UPDATE

Further examination of the WiFi calling situation:

I'm presently focusing on the IMS app WRT CM10.

The UMA/Kineto app runs on CM9/7, but not 10, due to a call to a native method known as 'AudioRecorder' - presumably, this method has changed in whatever .so file it is held in, and thus it crashes on CM10. I have some theories, but that's beside the point.

Here's the big update, though:

After copying the IMS/Movial WiFi calling app and related libs over, I was able to use the app 'QCustomShortcut' to run various parts of the Sense-Side IMS WiFi calling APK.

It reads the SIM card and loads all the SIP credentials (Yes, IMS wifi calling uses SIP internally) and other provisioning information. This also provides some insight as to how it might interface with the dialer app....

This means that there is a good possibility the 'back end' of the Stock WiFI Calling subsystem is NOT tied into the HTC Framework AT ALL

Here's the thing:

The ONE APK that *is* tied into the HTC framework, is wificalling.apk...

Guess what it does?

It sets the setting that tells the rest of the IMS subsystem to work (or not work - the 'Prefer wifi, prefer cellular, off' choice), and it provides the visible interface (the notification icon,etc). And it crashes because the parent-class of the Settings method is an HTC-framework version of a stock Android class. NONE of the IMS stuff is actually in wificall.apk, though - just the settings & the 'tutorial' part....

Once dex2jar'ed, wificall.apk decompiles well enough to see the method/class interfaces that are calling Sense functions.

They are all named in a manner following 'htcStockAndroidClass'.

Now, I am not an expert at Java (or Google's version of it) by any means, but as I understand it, any classes in the VM's classpath are available to be called...

So if we were to create classes with the same names and method structure as the HTC ones being called by wificall.apk (since this can be seen in the decompiled code), and place them in a JAR in /system/framework/... We just might get wificall.apk working...

A better decompilation (one that's recompilable), would give many more options... Such as identifying the setting that's being set & where it's stored, so we could create our own version of wificall.apk & set the setting that triggers the rest of the stack.

---------- Post added at 06:45 AM ---------- Previous post was at 06:34 AM ----------

P.S. Before someone asks 'If WiFi Calling uses SIP, how come we can't just feed the credentials to cSIPSimple or something like that'?

Movial did have the common-sense to use a password field in their wifi calling app, so the password is ***ed out...

So we have all the stuff you need to feed into a Polycom phone (or SIP softphone) and make calls over the TMO wifi calling system, except... The password...

The bad news is, this means we are back to fixing the wifi calling app....

The good news is, it means any solution we come up with will 'stick'...

Because if an exploit were to be published on the internet, allowing SIP calling with creds from a TMO phone... TMO would have a giant AW****! and change the whole system, because that would be a major security breach...

(I work for a small VOIP phone company. So I do know a thing or two about this)...

---------- Post added at 07:31 AM ---------- Previous post was at 06:45 AM ----------

The Sense classes needed by wificall.apk are:

HtcPreferenceActivity

HtcAlertDialog

HtcPreference

HtcPreferenceScreen

Theoretically, if one were able to cause calls to these classes to be rerouted to calls to their Android equivalents, then we could have a working WiFi calling app on AOSP. Or so says my limited programming knowledge... I'm more of a Systems guy than a Dev....

I don't know what XDA's rules are on posting decompiled proprietary code, so I'm not going to upload the actual JD output...

That said, using dex2jar and JD, you can see the guts of wificall.apk - and there appear to be no errors (there are errors when decompliling the Kineto wificalling apk - but unlike this one, the Kineto WiFi calling system has all it's eggs in one APK, whereas Movial split the actual GUTS of WiFI calling (in pure android) from the front end/settings (in Sense))...