Attend XDA's Second Annual Developer Conference, XDA:DevCon 2014!
5,805,503 Members 37,096 Now Online
XDA Developers Android and Mobile Development Forum

Changing the MMS UA

Tip us?
 
mils69
Old
(Last edited by mils69; 7th August 2009 at 06:56 AM.)
#1  
Senior Member - OP
Thanks Meter 33
Posts: 141
Join Date: Aug 2009
Location: Singapore
Default Changing the MMS UA

In a nutshell I need to modify my MMS UA-string in order for MMS to work properly on my unlocked Hero and also to authenticate with my carrier for my packet data plan.

I've read several articles both on xda and on other sites which talk about how this can be done (in one case for a Magic on the same carrier here in Japan and in the other for a Hero on US-based carrier).

To date this is what I've tried:

Attempt 1
  • Install the SDK
  • Install ADB USB driver
  • Download a customised Mms.apk from someone here in Japan - http://kuba.fm/2009/06/11/flashing-a...tbank-network/
  • Run the following: adb install -r Mms.apk
    1626 KB/s (567891 bytes in 0.341s)
    pkg: /data/local/tmp/Mms.apk
    Failure [INSTALL_PARSE_FAILED_INCONSISTENT_CERTIFICATES]
  • Tried again from the recovery console, did manage to push the file, but now Messages is Force closing whenever I startup.


Attempt 2
  • Started by reading the following - http://forum.xda-developers.com/showthread.php?t=542540
  • Took a backup from the recovery console
  • Rooted the device using Dayzee's lovely Noob Instructions
  • Installed Root Explorer
  • Copied the Mms.apk from the xda URL above into my tools dir
  • As per URL I type: adb remount - and get remount failed: Operation not permitted
  • If I use Root Explorer to Remount as R/W and then type: adb push Mms.apk /system/app I get "failed to copy 'Mms.apk' to '/system/app/Mms.apk': Permission denied
  • Alternately if I try to install Mms.apk from my sdcard using Root Explorer I get the following: Application not installed - Messages could not be installed on this phone
  • Again tried from the recovery console with the same effect as above - the Messages application Force closes upon startup.


So to put it bluntly I'm at a dead end..

I'm convinced there's a simple explanation but I've yet to discern what that might be.

Appreciate any help on offer.

Cheers,

mils
 
elliatab
Old
#2  
Junior Member
Thanks Meter 0
Posts: 3
Join Date: Oct 2009
Location: Kyoto
Default mms.apk for hero on Softbank

Hi mils,

I had the same problem and finally solved it last week.

I am using a HTC Hero with Modaco 3.0 on a Softbank prepaid card.

STEP 1 :
You need to make sure your APN settings are correct:

Name: Softbank
APN: mailwebservice.softbank.ne.jp
Proxy: <Not set>
Port: <Not set>
Username: softbank
Password: *******
Server: <Not set>
MMSC: http://mms
MMS proxy: sbmmsproxy.softbank.ne.jp
MMS Port: 8080
MMS protocol: WAP 2.0
MCC: 440
APN type: mms

STEP 2:
Then extract the mms.apk from Modaco's latest build.
At this point you will need baksmali to disassemble the class.dex file in mms.apk package.

When baksmali is done, find the file HttpUtils.smali (located in \com\android\mms\transport).

You will need to modify the following code:

Code:
.method private static createHttpClient(Landroid/content/Context;)Landroid/net/http/AndroidHttpClient;
    .registers 5
    .parameter "context"

    .prologue
    .line 285
    invoke-static {p0}, Lcom/android/mms/transport/HttpUtils;->getOemUAString(Landroid/content/Context;)Ljava/lang/String;

    move-result-object v2

    .line 286
    .local v2, uaString:Ljava/lang/String;
    if-nez v2, cond_8:

    .line 287
    const-string v2, "The default UA"

    .line 289
    cond_8:
    invoke-static {v2}, Landroid/net/http/AndroidHttpClient;->newInstance(Ljava/lang/String;)Landroid/net/http/AndroidHttpClient;
To:

Code:
.method private static createHttpClient(Landroid/content/Context;)Landroid/net/http/AndroidHttpClient;
    .registers 5
    .parameter "context"

    .prologue
    .line 285
    invoke-static {p0}, Lcom/android/mms/transport/HttpUtils;->getOemUAString(Landroid/content/Context;)Ljava/lang/String;

    move-result-object v2

    .line 286
    .local v2, uaString:Ljava/lang/String;
    if-nez v2, cond_8:

    .line 287
    cond_8:
    const-string v2, "Vodafone/1.0/V802SE/SEJ002 Browser/VF-Netfront/3.3 Profile/MIDP-2.0 Configuration/CLDC-1.1"

    .line 289
    invoke-static {v2}, Landroid/net/http/AndroidHttpClient;->newInstance(Ljava/lang/String;)Landroid/net/http/AndroidHttpClient;
I think you can find a user-agent that match your contract cell-phone and it will work fine. Notice that I moved the cond_8 label.
The reason is because the phone finds a default UA in getOemUAString and jumps over the static string. I'm not very confortable with dalvik bytecode so I prefered to keep the call and just move the label, so it will always use your custom ua whatever getOemUAString returns.

Just use smali to recompile and apkbuilder to repack everything. Pushing the mms.apk is enough to replace the previous version.

I will try to post my own mms.apk later so you don't have to bother doing STEP2.

Hope it helps!
 
umka83
Old
#3  
umka83's Avatar
Senior Member
Thanks Meter 25
Posts: 203
Join Date: May 2009
Location: Japan
Hello Mils69

Did you get this to work? I have same problem with Acer Liquid, i have setup APN, Rooted the phone, installed modified mms.apk but still no MMS and Messaging application is crashing all the time.

HandCentSMS also did not solve the problem.

Anyone was able to have MMS on ANdroid 1.6 so far?
 
umka83
Old
#4  
umka83's Avatar
Senior Member
Thanks Meter 25
Posts: 203
Join Date: May 2009
Location: Japan
Hello Mils69

Did you get this to work? I have same problem with Acer Liquid, i have setup APN, Rooted the phone, installed modified mms.apk but still no MMS and Messaging application is crashing all the time.

HandCentSMS also did not solve the problem.

Anyone was able to have MMS on ANdroid 1.6 so far?
 
knightnz
Old
(Last edited by knightnz; 22nd January 2010 at 01:13 AM.) Reason: Info.
#5  
Senior Member
Thanks Meter 244
Posts: 1,578
Join Date: Dec 2009
Location: Wellington

 
DONATE TO ME
I've got SIMs for 3 carriers, with 2 of them MMS receiving works fine with, the 3rd (unfortunately, my main one) receives MMS notifications, but is unable to actually download anything. Looking at the logs the only obvious "fail" I can see is a javascript error, possibly to do with the HTML lookup to HTC?

Any chance some of the modification in this thread might convince it to work? I'm fairly confident that my carrier has probably got a fairly dubious implementation of MMS support, seeing has how they don't even support 8-bit SMS which makes some things awkward.

Issue is on an HTC Hero running MCR 3.1, although the problem exists regardless of APN combinations and firmwares, it's obviously some incompatibility with the carrier and the method the OS is using for MMS.
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes