[App, root] Clear missed call notification with "NotiGo" - Android Apps and Games

Since Android 2.3, Google prohibited third party application (i.e. non-system app) to make use of MODIFY_PHONE_STATE permission. One of the consequences is that all 3rd party phone dialer application can no longer clear missed call icon at notification bar. (Even at Android 2.2 or older, we need undocumented API to do so)
With original Android phone dialer, the missed call indicator disappeared when call log page is shown. Third part applications on Android 2.3 cannot do so. It would be annoying that the missed call indicator keep showing. We may tap the "clear" button to clear all icons on notification bar. However, the missed call count remain. When the missed call indication appear again for one more missed call, the missed call count accumulate.
So, I write a small app, NotiGo, to solve this annoyance. It is to be installed as a system app on rooted device. Currently it works with Angel Dialer (Download at http://j.mp/iE5MJJ, discussed at http://j.mp/pC04fV) only. But other developers may invoke this app as well (see below)
*** Disclaimer 1: I am not responsible for any loss due to the following steps. Do not try if you disagree ***
*** Disclaimer 2: I tested it on Nexus One 2.3.4 only. Please let me know if it work or not work on your devices.
1. Download the file in this post.
2. put it in the SD card of your Android device.
3. Enter recovery mode of your Android device.
4. flash the zip file.
5. reboot.
After reboot, one more app "NotiGo" is in your system, but nothing is need to be done with it. If the installation is success, you will find one additional permission listed with Angel Dialer (Settings -> Applications -> Manage Applications -> "Angel Dialer") called "Clear Missed Call Notification" under "Phone Calls" category.
When Angel Dialer is launched with search page or call log page, the missed call indication is cleared, just like the original Android phone dialer.
Developer Info:
To make use of NotiGo with your app, add the following permission
<uses-permission android:name="thinkpanda.permission.CLEAR_MISSED_CALL"/>
and broadcast an intent with action "thinkpanda.notigo.CLEAR_MISSED_CALL"

Not sure what exactly it's supposed to do, it seems like if you have a newer gingerbread rom then you can just swipe the notification off? Or am I misinterpreting what this is made for?

qccoles said:
Not sure what exactly it's supposed to do, it seems like if you have a newer gingerbread rom then you can just swipe the notification off? Or am I misinterpreting what this is made for?
Click to expand...
Click to collapse
Android 2.3 does not allowed "normal" third party applications to clear the missed call notification. This app, installed as system app, provides an alternative way for other apps to clear missed call notification if needed.

This is fantastic! Thanks a lot

Thanks a lot.
I've used this to clear the notifications in Go Dialer EX - decompiled and inserted the intent call into the clearing procedure (that was intended to work only on 2.2 and below), and now it works.

Cool. Someone has to inform the developers of Go Dialer about this. This has been a major annoyance for me.

Already did - I wrote them a mail with suggestion and pointer to this thread. It might be better if more people write them, though.
By the way, I used it on Nexus One running latest MIUI based on Gingerbread 2.3.5.

Actually I can't get this working on my HTC Desire with AOSP ROM Oxygen. I have the APK installed in the system/app folder and Angel dialer has the permissions to clear missed calls.
The missed call notification does not disappear. What logs can I provide?
EDIT: IT DOESN'T WORK 100% OF THE TIME FOR ME, BUT OUT DOES WORK. ANY IDEAS?
Sent from my HTC Desire using XDA App

@Jack_R1, would you be so kind and send me or upload somewhere your modded Go Dialer EX app. I'm also using this app and was even trying to mod it myself but I don't know how to
and broadcast an intent with action "thinkpanda.notigo.CLEAR_MISSED_CALL"
Click to expand...
Click to collapse
I decompiled and added permission to AndroidManifest.xml but that's all I can do and have no idea with this broadcast...
TIA, andiss

mcampbellsmith said:
Actually I can't get this working on my HTC Desire with AOSP ROM Oxygen. I have the APK installed in the system/app folder and Angel dialer has the permissions to clear missed calls.
The missed call notification does not disappear. What logs can I provide?
EDIT: IT DOESN'T WORK 100% OF THE TIME FOR ME, BUT OUT DOES WORK. ANY IDEAS?
Sent from my HTC Desire using XDA App
Click to expand...
Click to collapse
If you see the additional permission, then the installation should be successful.
Angel Dialer make use of NotiGo to clear missed call notification only when showing the call log page or search page. Did you set the default page to other page like contact and favorite page?

thinkpanda said:
If you see the additional permission, then the installation should be successful.
Angel Dialer make use of NotiGo to clear missed call notification only when showing the call log page or search page. Did you set the default page to other page like contact and favorite page?
Click to expand...
Click to collapse
Angel Dialer goes direclty to the search page. See attachment.
What can I provide to get logs?

mcampbellsmith said:
Angel Dialer goes direclty to the search page. See attachment.
What can I provide to get logs?
Click to expand...
Click to collapse
Do you see the log with Tag "NotiGo" with message "Cleared missed call notification" when the search page is shown?

No I don't. I filtered in alogcat and don't see any reference to Notigo when opening Angel Dialer after a missed call.
Sent from my HTC Desire using XDA App

andiss said:
@Jack_R1, would you be so kind and send me or upload somewhere your modded Go Dialer EX app. I'm also using this app and was even trying to mod it myself but I don't know how to I decompiled and added permission to AndroidManifest.xml but that's all I can do and have no idea with this broadcast...
TIA, andiss
Click to expand...
Click to collapse
I'm not sure about my rights to post an altered app, even though it's free.
On the other hand, it's no different from Skype, etc. So I'm attaching it. It's version 2.0.1.
For anyone willing to decompile and change subsequent versions - this is the code that should be copy-pasted into the app:
AndroidManifest.xml :
Code:
<uses-permission android:name="thinkpanda.permission.CLEAR_MISSED_CALL"/>
smali\com\jbapps\contactpro\util\CallAndSmsUtil.smali :
Old code:
Code:
.method public static CleanMissedCallNotify(Landroid/content/Context;)V
.locals 3
.parameter
.prologue
.line 710
.line 713
:try_start_0
const-class v1, Landroid/telephony/TelephonyManager;
New code:
Code:
.method public static CleanMissedCallNotify(Landroid/content/Context;)V
.locals 3
.parameter
.prologue
.line 710
.line 713
:try_start_0
new-instance v1, Landroid/content/Intent;
const-string v2, "thinkpanda.notigo.CLEAR_MISSED_CALL"
invoke-direct {v1, v2}, Landroid/content/Intent;-><init>(Ljava/lang/String;)V
invoke-virtual {p0, v1}, Landroid/content/Context;->sendBroadcast(Landroid/content/Intent;)V
const-class v1, Landroid/telephony/TelephonyManager;

Thanks Jack_R1. GO SMS works for me when Angel Dialer doesn't. Strange...
Any chance someone can hack a version of TouchPal Dialer with this? I would really appreciate it......
Sent from my HTC Desire using XDA App

With a LOT of help from Jack_R1, I modified Touchpal Dialer to include this patch.
This is what I did:
Edited the AndroidManifest.xml file to include the permissions as described in the first post
In the files CallLogActivity.smali and DialerActivity.smali, I replaced the calls to cancelMissedCallsNotification with the four lines of code Jack_R1 had in his example above:
DialerActivity.smali
OLD CODE
Code:
.line 264
invoke-interface {v1}, Lcom/android/internal/telephony/ITelephony;->cancelMissedCallsNotification()V
:try_end_0
NEW CODE
Code:
.line 264
new-instance v1, Landroid/content/Intent;
const-string v2, "thinkpanda.notigo.CLEAR_MISSED_CALL"
invoke-direct {v1, v2}, Landroid/content/Intent;-><init>(Ljava/lang/String;)V
invoke-virtual {p0, v1}, Landroid/content/Context;->sendBroadcast(Landroid/content/Intent;)V
:try_end_0
CallLogActivity.smali
OLD CODE
Code:
.line 181
invoke-interface {v1}, Lcom/android/internal/telephony/ITelephony;->cancelMissedCallsNotification()V
:try_end_0
NEW CODE
Code:
.line 181
invoke-interface {v1}, Lcom/android/internal/telephony/ITelephony;->cancelMissedCallsNotification()V
:try_end_0
I've attached the modded APK. Please let me know if this is now allowed (Touchpal Dialer is a free app)

Wish wish wish pls
WOW
Guys this is a breakthorugh,
What about whatsapp?
Can we stop the whatsapp notification and message preview showing in the status bar in android and AUTO CLEAR it with this app?
I had this function in iphone where it can stop all notifications but for android the whole message of whatsapp is shown and remains uncleared. Can this be modified to auto clear the whatsapp notifications as soon as they arrive.

This only clears the phone notifications, that are coming from the system, thus requiring system permissions (root) to clear.
In Whatsapp, you can just turn off notifications in menu settings, most probably.

Nopes, you cant.
You see we can only switch off notifications in sms. For whatsapp the notifications come along with the message in the pull down status bar. There is absolutely no way to clear it.
If you google there are many people wanting this disabled.

How do you guys install this zip file? My recovery said amend scripting was no longer supported.

Related

[HELP] [THEME] Need help with services.jar

Hi,
for cyanogen5Beta4 I have a services.jar with white text at notification bar.
Now I have the new MoDaCo release and there is the text black.
I want white text.
this text is in the services.jar
Could anybody help me and explain, how to configure this services.jar to get white text instead of black text.
Thank you!
You need to run the colorchanger on it. Every rom is different pretty much. You need to do that every time you change the colors of the text.
This is how enomther (so all credit goes to him) explained to me on how to change it.
You can get smali/baksmali here.
I use PSPad to edit the files in windows. I right click and select open with PSPad.
Once you crack open services.jar/classes.dex with baksmali ....there are (2) files of concern, the first is com/android/server/status/StatusBarIcon.smali ... locate this file and open it up and search for ...
Code:
invoke-virtual {v4, v6}, Landroid/widget/TextView;->setTextColor(I)V
Above that line (2 lines up) ... you'll see ...
Code:
const/high16 v6, -0x100
That's black .. change to ...
Code:
const v6, -0x1
That's white ... this is a simply color change and easier since invoke-virtual is going to give us color out right ... we just have to change the color.
Then locate file ... com/android/server/status/com/android/server/status/StatusBarService.smali
There are (3) lines you need to search for here ... now they don't have inherent color change properties anymore ... which is why colorChange.jar is jacked up for you.
The threes lines to search for (and yes they are each in different places of the file) ... are ...
Code:
iput-object v7, p0, Lcom/android/server/status/StatusBarService;->mDateView:Lcom/android/server/status/DateView;
iput-object v7, p0, Lcom/android/server/status/StatusBarService;->mSpnLabel:Landroid/widget/TextView
iput-object v7, p0, Lcom/android/server/status/StatusBarService;->mPlmnLabel:Landroid/widget/TextView;
Again, since these are iput-object calls ... there's no inherent color changing properties ....
You must add the (2) color change lines above each of these lines ... the first lines set a variable for the color value (which in the example) ... the second line forces the text to that color with a call to setTextColor(). So when you're done ... those three lines will be 9 lines (3 lines in 3 seperate places in the file) ... as such ...
Code:
const v8, -0x1
invoke-virtual {v7, v8}, Landroid/widget/TextView;->setTextColor(I)V
iput-object v7, p0, Lcom/android/server/status/StatusBarService;->mDateView:Lcom/android/server/status/DateView;
Code:
const v8, -0x1
invoke-virtual {v7, v8}, Landroid/widget/TextView;->setTextColor(I)V
iput-object v7, p0, Lcom/android/server/status/StatusBarService;->mSpnLabel:Landroid/widget/TextView;
Code:
const v8, -0x1
invoke-virtual {v7, v8}, Landroid/widget/TextView;->setTextColor(I)V
iput-object v7, p0, Lcom/android/server/status/StatusBarService;->mPlmnLabel:Landroid/widget/TextView;
See how we're now setting a color variable and calling invoke-virtual prior to iput-object? ... that's the magic.
Save all that up and then run smali ... reinsert your classes.dex ... and you should be all set.
~enom~
Click to expand...
Click to collapse
Oh holy....
Wow, okay. Thank you both for reply.
Now I've been looking for an english teacher who can help me....
OK, it looks awesome. I wanna look to do what I can!
Thank you again!
Hah, I can't get it.
I've downloaded this three programms, but nothing works really.
Baksmali.jar doesn't start.
I've got an windows machine....
OK, some things I did now.
Thanks for your help.
But the clock on the upper right corner is black anymore.
If somebody could give me a tipp please.
I now have checked it twice, but can't find my failure.
The other things are quite white. They work, only the clock...
david1171 said:
This is how enomther (so all credit goes to him) explained to me on how to change it.
You can get smali/baksmali here.
I use PSPad to edit the files in windows. I right click and select open with PSPad.
Click to expand...
Click to collapse
Isn't that what the colorchanger does automatically? Not arguing or anything, but holy **** that looks complicated! I just use the colorchanger on my morphs...
Colorchanger?
You make me smile... Any Link to this?
Formel-LMS said:
Colorchanger?
You make me smile... Any Link to this?
Click to expand...
Click to collapse
File available here
Rename the file to just colorchangev3.jar (or something shorter if you prefer. I use cc3.jar personally)
You will need the java jdk set up on your computer. I made a pretty in-depth thread on this subject over on AOD
If you have any questions on it, hit me up. Preferably over there since I check it more often than here.
Thank you for your reply. I'm coming over to you. Now, I've take my first look.
im trying to do this on a galaxy s... is there something I am doing wrong... I did the first change... changing anything with the other three lines throws a forceclose loop upon reboot
any thoughts?

[MOD][How To][EB13][3/1/11] AOSP Lockscreen! with/out haptic / uninstallers / mods!!

I know a bunch of people have been waiting on this so here you go, I bring you the AOSP lockscreen for EB13!
MUST BE ON A DEODEXED EB13 ROM!!! I wouldnt flash any of these over SyndicateROM as they wont be compatible until we can get compatible versions posted.
EB13 AOSP Lockscreen - Download (android.policy.jar)
With Haptic Feedback Removed - Download (android.policy.jar AND framework.jar)
Replace Haptic Feedback - Download (only replaces framework.jar, will still have AOSP lockscreen!)
TW lockscreen - Download (replaces to stock only android.policy.jar)
Remove Haptic Feedback for Bonsai 3.0.1 - Download (does NOT flash AOSP lockscreen, only framework.jar compatible with Bonsai which removes haptic feedback from AOSP lockscreen if you already have it installed. try a theme with AOSP lock.
Replace haptic feedback for Bonsai 3.0.1 - Download
Remove haptic feedback for SRF 1.0.1 - Download (same deal as Bonsai, framework.jar only)
Replace haptic feedback for SRF 1.0.1 - Download
credit to raiderep for getting us the aosp lockscreen for DK28 AND for removing haptic feedback, i basically just winmerged his changes against stock to figure out the mod.
as he did, i should post the files to revert, i'll get those up soon.
How To Create AOSP Lockscreen from stock android.policy.jar:
1.) Pull classes.dex out of android.policy.jar with 7zip
2.) java -jar baksmali.jar -o classout/ classes.dex
3.) Open com\android\internal\policy\impl\LockPatternKeyguardView.smali
4.) Change:
Code:
.line 1344
sget-object v0, Lcom/android/internal/policy/impl/LockPatternKeyguardView$LockScreenMode;->PuzzleLock:Lcom/android/internal/policy/impl/LockPatternKeyguardView$LockScreenMode;
.line 1347
:goto_8
return-object v0
:cond_9
sget-object v0, Lcom/android/internal/policy/impl/LockPatternKeyguardView$LockScreenMode;->GlassLock:Lcom/android/internal/policy/impl/LockPatternKeyguardView$LockScreenMode;
to this:
Code:
.line 1344
sget-object v0, Lcom/android/internal/policy/impl/LockPatternKeyguardView$LockScreenMode;->TapLock:Lcom/android/internal/policy/impl/LockPatternKeyguardView$LockScreenMode;
.line 1347
:goto_8
return-object v0
:cond_9
sget-object v0, Lcom/android/internal/policy/impl/LockPatternKeyguardView$LockScreenMode;->TapLock:Lcom/android/internal/policy/impl/LockPatternKeyguardView$LockScreenMode;
basically, you are just changing "PuzzleLock" and "GlassLock" both to "TapLock"
5.) In the same directory, open LockScreen.smali
6.) Find (not quite half way down):
Code:
.line 172
.local v1, fileOverride:Z
if-eqz v0, :cond_23
if-nez v2, :cond_23
if-eqz v1, :cond_25
:cond_23
const/4 v4, 0x1
:goto_24
return v4
:cond_25
move v4, v6
goto :goto_24
.end method
in the above, change:
Code:
:goto_24
return v4
to:
Code:
:goto_24
return v6
7.) Recompile: java -Xmx512M -jar smali.jar classout/ -o new-classes.dex
8.) Rename new-classes.dex to classes.dex and replace inside android.policy.jar with 7zip
----
To mod framework.jar to remove haptic feedback from AOSP lockscreen:
1.) Pull classes.dex out of framework.jar with 7zip
2.) java -jar baksmali.jar -o classout/ classes.dex
3.) Open com\android\internal\widget\SlidingTab.smali
4.) Change:
Code:
.method private declared-synchronized vibrate(J)V
.registers 5
.parameter "duration"
.prologue
.line 808
monitor-enter p0
:try_start_1
iget-object v0, p0, Lcom/android/internal/widget/SlidingTab;->mVibrator:Landroid/os/Vibrator;
if-nez v0, :cond_14
.line 809
invoke-virtual {p0}, Lcom/android/internal/widget/SlidingTab;->getContext()Landroid/content/Context;
move-result-object v0
const-string/jumbo v1, "vibrator"
invoke-virtual {v0, v1}, Landroid/content/Context;->getSystemService(Ljava/lang/String;)Ljava/lang/Object;
move-result-object v0
check-cast v0, Landroid/os/Vibrator;
iput-object v0, p0, Lcom/android/internal/widget/SlidingTab;->mVibrator:Landroid/os/Vibrator;
.line 812
:cond_14
iget-object v0, p0, Lcom/android/internal/widget/SlidingTab;->mVibrator:Landroid/os/Vibrator;
invoke-virtual {v0, p1, p2}, Landroid/os/Vibrator;->vibrate(J)V
:try_end_19
.catchall {:try_start_1 .. :try_end_19} :catchall_1b
.line 813
monitor-exit p0
return-void
.line 808
:catchall_1b
move-exception v0
monitor-exit p0
throw v0
.end method
to this:
Code:
.method private declared-synchronized vibrate(J)V
.registers 5
.parameter "duration"
return-void
.prologue
.line 808
monitor-enter p0
:try_start_2
iget-object v0, p0, Lcom/android/internal/widget/SlidingTab;->mVibrator:Landroid/os/Vibrator;
if-nez v0, :cond_15
.line 809
invoke-virtual {p0}, Lcom/android/internal/widget/SlidingTab;->getContext()Landroid/content/Context;
move-result-object v0
const-string/jumbo v1, "vibrator"
invoke-virtual {v0, v1}, Landroid/content/Context;->getSystemService(Ljava/lang/String;)Ljava/lang/Object;
move-result-object v0
check-cast v0, Landroid/os/Vibrator;
iput-object v0, p0, Lcom/android/internal/widget/SlidingTab;->mVibrator:Landroid/os/Vibrator;
.line 812
:cond_15
iget-object v0, p0, Lcom/android/internal/widget/SlidingTab;->mVibrator:Landroid/os/Vibrator;
invoke-virtual {v0, p1, p2}, Landroid/os/Vibrator;->vibrate(J)V
:try_end_1a
.catchall {:try_start_2 .. :try_end_1a} :catchall_1c
.line 813
monitor-exit p0
return-void
.line 808
:catchall_1c
move-exception v0
monitor-exit p0
throw v0
.end method
5.) Recompile: java -Xmx512M -jar smali.jar classout/ -o new-classes.dex
6.) Rename new-classes.dex to classes.dex and replace inside framework.jar with 7zip
----------------------------------------------
From raiderep, dont forget to thank him for this:
raiderep said:
Ok here is another mod for aosp lockscreen, might as well keep all this in one thread. Maybe add it to the OP if you'd like. Credit goes to chibucks over at SDX, I just used a mod he posted for the moment and with a small change it worked on my epic. This will give you a custom image on your lockscreen(aosp only afaik)
First decompile framework-res.apk and nav to res/layout/keyguard_screen_tab_unlock.xml. edit the second line as follows:
change the android:background="#70000000" on this line
Code:
<RelativeLayout android:gravity="center_horizontal" android:id="@id/root" android:background="#70000000" android:layout_width="fill_parent" android:layout_height="fill_parent"
to android:background="@drawable/default_wallpaper" like this
Code:
<RelativeLayout android:gravity="center_horizontal" android:id="@id/root" android:background="@drawable/default_wallpaper" android:layout_width="fill_parent" android:layout_height="fill_parent"
now this edit seems to make it call on the image called default_wallpaper in the drawable folder but when I first tried it the image on the lockscreen was actually the default_wallpaper image found in drawable-hdpi so...
the next step is to add in your custom image while still decompiled, I don't think you can add it in after recompiling,everytime I tried it bootlooped the phone but I was changing it to a png so if you keep it a jpg it might not YMMV(haven't tried to replace the jpg after a recompile)
this image can be a png for transparency if you'd like just make sure you delete the jpg thats already in there, or replace the jpg if you don't want transparency, png is better either way in my opinion...
So basically you just stick your custom image in the drawable-hdpi folder and make sure its the only one called default_wallpaper whether its a png or jpg.
recompile framework-res.apk and enjoy
Click to expand...
Click to collapse
my assumption is that if you add it in AFTER compiling, you would have to stick with a jpg, since that is what the default is. but if you want a png, change it out before compiling, thanks again raiderep!
anyway to get without heptic feedback ?
cballin22 said:
anyway to get without heptic feedback ?
Click to expand...
Click to collapse
ooh, i can try
Glad you got it because I forgot how I did it...
As for haptic removal, I did it for di18 and dk28 so you can figure it out the same way I'm sure. Check my blue theme or the dk28 thread for the mod. Its a change in framework.jar I believe. I'm looking at getting a nexus s possibly so its good to see someone getting busy with this stuff. Sprint is ticking me off and I've lost my motivation, sorry guys
sent by an Epic4g through the cosmos
raiderep said:
Glad you got it because I forgot how I did it...
As for haptic removal, I did it for di18 and dk28 so you can figure it out the same way I'm sure. Check my blue theme or the dk28 thread for the mod. Its a change in framework.jar I believe. I'm looking at getting a nexus s possibly so its good to see someone getting busy with this stuff. Sprint is ticking me off and I've lost my motivation, sorry guys
sent by an Epic4g through the cosmos
Click to expand...
Click to collapse
Cool, i may consider switching to this lockscreen once the new bonsai is out.
@raiderrep
You going to port your theme on the official froyo?
yea so far im using it with the eb13 ext 4 rom using cm6 and it works fine along with the genocide oc kernal i just dont like the heptic feedback with it ... i wonder since now eb13 is out that the lockscreen that i have seen on the evo is able to be ported with the 4 option asop config
Yay, been waiting 4 this
Sent from my SPH-D700 using XDA App
Did anyone manage to fix the landscape issues? I pointed out a few months ago that we have images missing in order for landscape to work properly. We need some who like XML in order to fix it. Any takers?
Great job getting this ported over.... Also thanks for the other mods as well.
raiderep said:
Glad you got it because I forgot how I did it...
As for haptic removal, I did it for di18 and dk28 so you can figure it out the same way I'm sure. Check my blue theme or the dk28 thread for the mod. Its a change in framework.jar I believe. I'm looking at getting a nexus s possibly so its good to see someone getting busy with this stuff. Sprint is ticking me off and I've lost my motivation, sorry guys
sent by an Epic4g through the cosmos
Click to expand...
Click to collapse
oof, that is sad to hear, you're a good resource and have helped me a lot! so yeah i can check your past mods to see how the haptic was removed, hopefully i dont get stuck, lol. cause i really dont "understand" what i'm doing as much as am replicating what others have done.
ptfdmedic said:
Did anyone manage to fix the landscape issues? I pointed out a few months ago that we have images missing in order for landscape to work properly. We need some who like XML in order to fix it. Any takers?
Great job getting this ported over.... Also thanks for the other mods as well.
Click to expand...
Click to collapse
no it doesnt look like those are fixed. i dont think its missing images, we have those in framework-res.apk/res/drawable-land-hdpi i believe. i think its more of a jar file (android.policy?) maybe not calling them correctly. i'll poke around in the files but again, i wont really know what i'm looking for.
amosher13 said:
oof, that is sad to hear, you're a good resource and have helped me a lot! so yeah i can check your past mods to see how the haptic was removed, hopefully i dont get stuck, lol. cause i really dont "understand" what i'm doing as much as am replicating what others have done.
no it doesnt look like those are fixed. i dont think its missing images, we have those in framework-res.apk/res/drawable-land-hdpi i believe. i think its more of a jar file (android.policy?) maybe not calling them correctly. i'll poke around in the files but again, i wont really know what i'm looking for.
Click to expand...
Click to collapse
We are actually missing files. I posted them in the original thread a few months ago. I noticed them while digging through the Nexus S dump. There are a dozen or so images that are missing. I'll see if I can find the post and link you to it.
EDIT: Here is the link
@amosher13 - I think the only thing I can say I did on my own was get the aosp lockscreen fixed on dk28(it was half done) so I'm like you and simply figure out how to make it work from the previous success of others. Not much in these forums is original work, its a community effort.
If you have trouble with the haptic removal I'll lend a hand.
The landscape issue might be because they only programmed it for phones without a slider but not sure. I am thinking it calls on the same images for either mode so it might take some heavy lifting to get it working right. Maybe making new resource ids and images as well as new xmls/smalis or methods...
sent by an Epic4g through the cosmos
raiderep said:
@amosher13 - I think the only thing I can say I did on my own was get the aosp lockscreen fixed on dk28(it was half done) so I'm like you and simply figure out how to make it work from the previous success of others. Not much in these forums is original work, its a community effort.
If you have trouble with the haptic removal I'll lend a hand.
The landscape issue might be because they only programmed it for phones without a slider but not sure. I am thinking it calls on the same images for either mode so it might take some heavy lifting to get it working right. Maybe making new resource ids and images as well as new xmls/smalis or methods...
sent by an Epic4g through the cosmos
Click to expand...
Click to collapse
Word.
In either case, i think i've got the haptic feedback removed ready to go, posted in the OP, stuck in a meeting and unable to test atm. if someone wants to give it a shot, be my guest and report back, make a backup first!
amosher13 said:
I know a bunch of people have been waiting on this so here you go, I bring you the AOSP lockscreen for EB13!
Click to expand...
Click to collapse
Is there any real difference between this one and the one already available for DK28? I flashed the DK28 version and it works fine for me on EB13 ROM.
anythingbutmine said:
Is there any real difference between this one and the one already available for DK28? I flashed the DK28 version and it works fine for me on EB13 ROM.
Click to expand...
Click to collapse
there is honestly probably not "MUCH" different, but there could be all kinds of minor things changed between versions. For instance, the DK17 one was thought to work on DK28 (builds only 11 days apart) but some of the string references were off. i'd flash this to be safe.
also: OP updated with confirmed working AOSP lockscreen with haptic feedback removed. framework.jar is also included in that zip.
anythingbutmine said:
Is there any real difference between this one and the one already available for DK28? I flashed the DK28 version and it works fine for me on EB13 ROM.
Click to expand...
Click to collapse
It may be that the androidpolicy.jar from dk28 is identical to eb13's but better safe than sorry.
sent by an Epic4g through the cosmos
raiderep said:
@amosher13 - I think the only thing I can say I did on my own was get the aosp lockscreen fixed on dk28(it was half done) so I'm like you and simply figure out how to make it work from the previous success of others. Not much in these forums is original work, its a community effort.
If you have trouble with the haptic removal I'll lend a hand.
The landscape issue might be because they only programmed it for phones without a slider but not sure. I am thinking it calls on the same images for either mode so it might take some heavy lifting to get it working right. Maybe making new resource ids and images as well as new xmls/smalis or methods...
sent by an Epic4g through the cosmos
Click to expand...
Click to collapse
You are correct as I looked into this. The images are there for both landscape and portrait. The problem is that it wants to display the portrait images. We need to figure out what controls the lock screen in landscape and get it to change the images that are being called. As I see it by switching bool to true its just basically rotating the screen when the keyboard slides up
Sent from my SPH-D700 using Tapatalk
Flashed this and no lockscreen? What am i doing wrong.
Just transferred the zip file to my sd card and installed zip in clockwork.
1greek4u said:
Flashed this and no lockscreen? What am i doing wrong.
Just transferred the zip file to my sd card and installed zip in clockwork.
Click to expand...
Click to collapse
nooooo lockscreen?!?!?! no idea, might try reflashing, never seen or even heard of that before. maybe even just reboot and see what happens, its working over here.
----
also, for anyone interested i have a hunch to look through framework.jar, there have to be (at least, lol) 2 places where its calling for the portrait jog dial pngs. so one of them has to be landscape and maybe it would be just changing the resource ids to the landscape pngs. i'll report back obviously but if anyone else wants to take a look be my guest.
I love it. Thank you so much!! I've forever had this quirk of my phone unlocking to lock screen after turning the screen off..... and this fixed that. Thanks!
Sent from my SPH-D700 using XDA App
You the man. I'm going to add this and all previous versions to the wiki, very useful modification.
Sent from my SPH-D700 using XDA App

Images too compressed?

I've noticed that when I'm trying to send a picture through text, the phone compresses the picture to the point where it gets pixelated. It looks awful!
Has anyone had this problem? I'm using the stock camera app.
Sent from my SM-G900P using Tapatalk
Yeah ive notice this too. On my s3 there was a mod that sended the pictures uncompressed. Hopefully we get that on this phone.
Sent from my SM-G900P using XDA Free mobile app
8sms! You can chose how big the picture is also allows MMS over wifi!
Sent from a Galaxy 5 light years away
Send via email no compression
Joe0113 said:
8sms! You can chose how big the picture is also allows MMS over wifi!
Sent from a Galaxy 5 light years away
Click to expand...
Click to collapse
Great find! Where do I change to allow MMS over WiFi? Is that the messaging limit?
Found the setting, but it still is compressing the image
Sent from my SM-G900P using Tapatalk
zune70 said:
Yeah ive notice this too. On my s3 there was a mod that sended the pictures uncompressed. Hopefully we get that on this phone.
Sent from my SM-G900P using XDA Free mobile app
Click to expand...
Click to collapse
What was that mod called for the s3? I'd like to follow the thread in case the developer decides to make one for this phone.
Sent from my SM-G900P using Tapatalk
slickdealers said:
What was that mod called for the s3? I'd like to follow the thread in case the developer decides to make one for this phone.
Sent from my SM-G900P using Tapatalk
Click to expand...
Click to collapse
http://forum.xda-developers.com/showthread.php?t=2044251
[MOD] True uncompressed MMS. CONFIRMED working!
I dont think it would work with our phone
Sent from my SM-G900P using XDA Free mobile app
slickdealers said:
Great find! Where do I change to allow MMS over WiFi? Is that the messaging limit?
Found the setting, but it still is compressing the image
Sent from my SM-G900P using Tapatalk
Click to expand...
Click to collapse
Settings--> Message limits--> Set max pixels for height/width to 2976 and set maximum message size to 10000 kilobytes.
So after having the same complaint myself and even from people I send messages to I decided to make the switch and try this out.
Works great with only 2 complaints.
1) Lock screen no longer shows a message preview?
2) No theme/alt. color for messages.
I can deal with number 2 but I really am use to having the first option and used it a lot to just quickly turn on screen to read a message without wanting to respond etc.
Is it just me or is it indeed broken on S5 with third-party messengers?
I'm actually happy with the stock one if it had a darn option to set mms sizes.
My old HTC use to have 500KB or 1MB, this thing has neither and it's keeping all my images under 350K it seems like.
All providers support 1024KB, it's stupid they compress them so much. AT&T was 600KB but I just sent myself a 1.2MB message and got it fine even oddly.
I just want 1MB without scaling bahh.
bryanu said:
So after having the same complaint myself and even from people I send messages to I decided to make the switch and try this out.
1) Lock screen no longer shows a message preview?
Click to expand...
Click to collapse
Download NiLS from Play Store. Damn amazing app!
I think I found a fix for this (maybe). If you decompile SecMms_Blue.apk and look @ the mms_config.xml these lines are there (stock)
Code:
<int name="maxMessageSize">307200</int>
<int name="mmsHeaderSize">5120</int>
<int name="maxImageHeight">480</int>
<int name="maxImageWidth">640</int>
Maybe increasing the values would result in less compression?
---------- Post added at 10:31 PM ---------- Previous post was at 10:01 PM ----------
fergie716 said:
I think I found a fix for this (maybe). If you decompile SecMms_Blue.apk and look @ the mms_config.xml these lines are there (stock)
Code:
<int name="maxMessageSize">307200</int>
<int name="mmsHeaderSize">5120</int>
<int name="maxImageHeight">480</int>
<int name="maxImageWidth">640</int>
Maybe increasing the values would result in less compression?
Click to expand...
Click to collapse
I made an apk and tried this, didn't work. Did unlock a few settings I found in that xml though
EDIT AGAIN
- I found this line in the customer.xml in csc/SPR/system/csc
Code:
<MessageSize>1m</MessageSize>
<ImageResizeResolution>uxga</ImageResizeResolution>
Ill see if editing this, along with the mms_config edits add up to anything
fergie716 said:
I think I found a fix for this (maybe). If you decompile SecMms_Blue.apk and look @ the mms_config.xml these lines are there (stock)
Code:
<int name="maxMessageSize">307200</int>
<int name="mmsHeaderSize">5120</int>
<int name="maxImageHeight">480</int>
<int name="maxImageWidth">640</int>
Maybe increasing the values would result in less compression?
---------- Post added at 10:31 PM ---------- Previous post was at 10:01 PM ----------
I made an apk and tried this, didn't work. Did unlock a few settings I found in that xml though
EDIT AGAIN
- I found this line in the customer.xml in csc/SPR/system/csc
Code:
<MessageSize>1m</MessageSize>
<ImageResizeResolution>uxga</ImageResizeResolution>
Ill see if editing this, along with the mms_config edits add up to anything
Click to expand...
Click to collapse
Odd, those first things you found are what I would expect to be the issue.
When you changed them and tested I take it you rebooted and tested it with a different MMS image?
I noticed if I send an MMS and go to send the same one again it seems to re-use the compressed version it made the first time, maybe try testing again with a different image to make sure?
Hopefully someone figures it out. I actually don't mind the stock app beyond this annoyance.
Thanks for looking/trying though.
bryanu said:
Odd, those first things you found are what I would expect to be the issue.
When you changed them and tested I take it you rebooted and tested it with a different MMS image?
I noticed if I send an MMS and go to send the same one again it seems to re-use the compressed version it made the first time, maybe try testing again with a different image to make sure?
Hopefully someone figures it out. I actually don't mind the stock app beyond this annoyance.
Thanks for looking/trying though.
Click to expand...
Click to collapse
I've tried multiple things including some smali edits but I'm on stock odex. If you're on a deodexed system upload your SecMms_Blue.apk from /system/priv-app/ and I'll make the same edits for you to see if they stick
I also decompiled the messaging app and made some changes like upping the max size to 2mb (2097152 bytes) and the height and width the same as 2.4 mp. I sent myself a picture that was ~700 kb and the resolution was 2.4 mp and the app still scaled it way down to something like 1600 X 900 I also made the CSC edits in customer.xml.
in the past the edits that fixed this was in the ImageModel.smali
search for this line
# direct methods
.method static constructor <clinit>()V
in here is where the goods are
vinman12 said:
in the past the edits that fixed this was in the ImageModel.smali
search for this line
# direct methods
.method static constructor <clinit>()V
in here is where the goods are
Click to expand...
Click to collapse
Ok I found this line in ImageModel.smali. I know nothing about editing smali and I'm not sure what I'm looking for This is copied directly from Notepad++
# direct methods
.method static constructor <clinit>()V
.locals 2
const/high16 v0, 0x434b0000
invoke-static {v0}, Lcom/android/mms/util/UIUtils;->dp2Pixels(F)I
move-result v0
sput v0, Lcom/android/mms/model/ImageModel;->THUMBNAIL_BOUNDS_LIMIT:I
invoke-static {}, Lcom/android/mms/ui/MessageUtils;->getScreenHeight()I
move-result v0
invoke-static {}, Lcom/android/mms/ui/MessageUtils;->getScreenWidth()I
move-result v1
if-le v0, v1, :cond_0
invoke-static {}, Lcom/android/mms/ui/MessageUtils;->getScreenWidth()I
move-result v0
mul-int/lit8 v0, v0, 0x2
:goto_0
sput v0, Lcom/android/mms/model/ImageModel;->SLIDESHOW_BOUNDS_LIMIT:I
invoke-static {}, Lcom/android/mms/MmsApp;->getApplication()Lcom/android/mms/MmsApp;
move-result-object v0
invoke-virtual {v0}, Landroid/content/ContextWrapper;->getResources()Landroid/content/res/Resources;
move-result-object v0
const v1, 0x7f0a004b
invoke-virtual {v0, v1}, Landroid/content/res/Resources;->getDimension(I)F
move-result v0
float-to-int v0, v0
sput v0, Lcom/android/mms/model/ImageModel;->THUMBNAIL_MAX_SHORT:I
invoke-static {}, Lcom/android/mms/MmsApp;->getApplication()Lcom/android/mms/MmsApp;
move-result-object v0
invoke-virtual {v0}, Landroid/content/ContextWrapper;->getResources()Landroid/content/res/Resources;
move-result-object v0
const v1, 0x7f0a004c
invoke-virtual {v0, v1}, Landroid/content/res/Resources;->getDimension(I)F
move-result v0
float-to-int v0, v0
sput v0, Lcom/android/mms/model/ImageModel;->THUMBNAIL_MAX_LONG:I
return-void
:cond_0
invoke-static {}, Lcom/android/mms/ui/MessageUtils;->getScreenHeight()I
move-result v0
mul-int/lit8 v0, v0, 0x2
goto :goto_0
.end method
Any progress update? 8sms is still compressing the images like the stock messaging app.
Ditto - can someone most a modded SecMMS_Blue.APK for NE5 ?
Would like to get the max MMS size bumped up to 5 or 10 MB
From browsing Sprint forums - sending MMS to Sprint phones has no limit max but most other carriers have a 1-2mb limit for MMS
I tried decompiling and editing, couldn't get it to work
tried decompressing and editing, then re-compressing the apk - apk kept force-closing
I'm probably missing something basic but can't figure out what it is.
Does_It_Matter said:
Ditto - can someone most a modded SecMMS_Blue.APK for NE5 ?
Would like to get the max MMS size bumped up to 5 or 10 MB
From browsing Sprint forums - sending MMS to Sprint phones has no limit max but most other carriers have a 1-2mb limit for MMS
I tried decompiling and editing, couldn't get it to work
tried decompressing and editing, then re-compressing the apk - apk kept force-closing
I'm probably missing something basic but can't figure out what it is.
Click to expand...
Click to collapse
Did you zipalign the apk ? Sac23 posted a modded SecMms_Blue in the MOAR thread.

[MOD][GUIDE] Stock MMS Options

What Does this MOD do?
This new MOD will give you the following options:
Code:
[B][COLOR="DarkRed"][CENTER]Screen on/off when receiving text
MMS Subject
Delay text
Message Drafts
Delivery Reports
Multimedia Options
-Roaming retrieve
-Group Options
-MMS Alerts
Pop-Up Display
Preview Options
Change SMS and MSM Limits
Change Image Size [/CENTER]
[/COLOR][/B]
You may already have some of these options, I am just noting what seemed new to me...
Using your method of choice........
Pull SecMms_Blue.apk from your priv-app folder
Navigate to smali/com/android/mms/MmsConfig.smali
Find .method static constructor <clinit>()V
Basically v2 = 0 = disable......... and v3 = 1 = enable
So any options in this method you want to disable change to v2 and any options in this method you want to enable change to v3.
To change the MaxMessageSize, do the following....
Find sput v0, Lcom/android/mms/MmsConfig;->sMaxMessageSize:I and change the line above to const v0, 0x12b8f8
To change the MaxImageHeight and MaxImageWidth, do the following.....
Find sput v0, Lcom/android/mms/MmsConfig;->sMaxImageHeightRestrictedMode:I and change the line above to const/16 v0, 0x780
Find sput v0, Lcom/android/mms/MmsConfig;->sMaxImageWidthRestrictedMode:I and change the line above to const/16 v0, 0xA00
This will give you a max image size of 1920 x 2560. Change the hex values to make it larger or smaller if you like.
I changed most of the other limits to 0x1F4, whick equals 500 in base10, change to what you desire if 500 is not right for you.
Thats basically it. I will attach a simple flash for a deodexed file system.
Enjoy, hit thanks if you want to.
XDA:DevDB Information
Stock MMS Options, App for all devices (see above for details)
Contributors
Didact74
Version Information
Status: Stable
Created 2014-08-12
Last Updated 2014-08-12

[GUIDE][MOD][APP] Modify chomp SMS to make it look exactly as SGY SMS app

Introduction (skip it if you are in a hurry )
Is it newer always better than older? not always indeed...
For example, the transition from Windows XP to Windows Vista, or from Windows 7 to 8 is been for many a move backward in terms of user experience and performance.
I would say that also the new *security* features inplemented starting with Android KitKat, that highly limited the usage of the external physical SDcard and introduced a quite confusing virtual/emulated internal SDcard, gave to many users who switched to the newer Android OS a number of problems and limitations they didn't have before.
Beside operative systems, also on the applications world, of course, sometimes an older app is better than a newer.
I, for example, can't get used to the new Messaging app look, that I found on my new phone, once I for years happily and comfortably used the Messaging app that was available on my *old* Samsung Galaxy Y (with Android GingerBread 2.3.6) which was optimized for a small screen and therefore very essential but still complete and able to provide a good user experience.
Some of us, smartphone users, would like that switching to a bigger screen phone from a smaller one, would give us the chance to have bigger text, menus, labels, so that everything can be read easier than on previous smaller phone...
But that doesn't seem what developers (who are eventually very young and so their sight is still very good ) usually think when they have a chance to deal with a bigger screen... they rather think that a bigger screen should give the opportunity to display more things, than the same things as previously but bigger.
So, moving from my old and beloved Samsung Galaxy Y, 3inch screen, to a new Cloudfone (asian brand) 4inch smartphone didn't make me any easier to read the texts on the screen, but instead I found the screen filled of new "things" and even "empty spaces" that honestly I don't really feel the need and I found very questionable their presence... (I think that sometimes developers are just like some journalists that are in need of a "scoop", and that if they don't have one, they will try to make it out of a normal news... the marketing department usually pressure the developers to "invent" new things, a "different look" whatever it is, so that they can sell it to the public as "new"... because... you know... new is better. So it doesn't matter if "new" is really "useful", as it doesn't matter if a "scoop" is really "real").
So I tried to find an alternative SMS app on Google Play store, that looked as close as possible like my old Messaging app.
I didn't find any that looked as I wanted by default, but I found that "chomp SMS" was very customizable, featuring many "theme" options (I especially liked the option to remove the contact pics, which most of the time are just a useless box with the contact initials) that made it possible to have it looked similar, even though not same, to my previous SMS app.
Yet, the waste of screen space for empty areas, and the formats of date and time labels and other details made me willing to use my reverse engineering skills to modify "chomp SMS" so that it looks perfectly same as the SMS app I was using before.
Here below I'll show you what I've done, what I modified and where, so that you too can do your modifications at your will, if you like to.
Let's start!
This is how the default Messaging app on both the phones, the old smaller, and the bigger new, looks like.
"Conversation List" view (first pic) and "Conversation" view (second pic)
.
I then found, on Google Play Store, and installed "chomp SMS", which by default looks like this.
.
I then went into Settings and used all the available options to customize the app look and this is the best that I've been able to achieve.
.
Compare the above with this screenshots of the SGY original Messaging app that we'll use as reference
.
From now on the only thing to do is to modify the app resources and code so...
first of all, you need to know how to decompile, compile and sign an Android app package.
If you don't know how, the simplest way to do it is to use APK Studio, a nice IDE (Integrated Development Environment) application, running on Windows and Linux, made by XDA developers member vaibhavpandeyvpz
Read this http://www.xda-developers.com/decompile-edit-and-recompile-in-one-tool-with-apk-studio/
Unfortunately such software might not work due to an older embedded version of APK Tool.
So, well... you might want to use the below attacched zip file that contains my own batch files together with the latest version of APK Tool (v2.1.0) that I downloaded from here http://ibotpeaches.github.io/Apktool/install/
Just download the zip and expand the archive in your C: disk.
You need to have at least Java Runtime Environment (JRE) ver. 1.8.0 installed (http://www.oracle.com/technetwork/java/javase/downloads/jre8-downloads-2133155.html)
Simply copy the apk file to that C:/Decompression.chamber folder and drag it over the apktool_decomp batch file and release, to get the apk decompiled.
As result you'll have a new folder in C:/Decompression.chamber with the same name of the decompiled apk.
To compile and sign just drag the folder over the apkt_BuildNsign batch file and release... if everything will be fine you'll find a new file named out.apk inside C:/Decompression.chamber and that's the compiled and signed apk.
Now, get the chomp SMS apk file and decompile it. (can be downloaded from here http://www.apk4fun.com/apk/1180/)
Now you are ready to modify the app same as I did (or on your own different way )
1) Let's get rid of that waste of screen space...
at the sides of the message box bubbles in Conversation view.
.
Looking on the layout folder (C:\Decompression.chamber\com.p1.chompsms-1\res\layout) we can find a file name message.xml that contains the description of the elements that are visualized on the Conversation view (how I found it? I don't remember I guess I just spot it by reading all the names of the files in the layout folder)
The message.xml file begins with this row:
Code:
<?xml version="1.0" encoding="utf-8"?>
<com.p1.chompsms.views.Message a:orientation="vertical" a:paddingLeft="2.0dip" a:padding ...
We can understand then that the contents of this layout is dynamically controller by a piece of code (a "class"), of name com.p1.chompsms.views.Message, that we can read by opening the related smali file, of name Message.smali, that we can find in (C:\Decompression.chamber\com.p1.chompsms-1\smali)\com\p1\chompsms\views.
By looking inside Message.smali we can find a few rows of code like this:
Code:
invoke-virtual {v2, v1, v3, v4, v5}, Landroid/widget/RelativeLayout$LayoutParams;->setMargins(IIII)V
Those rows, obviously, will set the message layout margins, that means the outer distance from the message box and the "container" the screen borders.
Few lines of code above, you can find a couple of "const"ants, means "fixed values"
Those constants are set by this code instructions
Code:
const/high16 v3, 0x428c0000 # 70.0f
That means that the value stored on "v3" is equal to 70.0 (floating point number).
Actually 70.0dpi is exactly the big "margin" that we want to remove.
There's also another margin, on the opposite side, which is much smaller (but still a waste) and it's set to only 2.0dpi by instructions const/high16 v1, 0x40000000.
In order to remove those margins we need to set to zero those constants by searching and replacing all the occurrences of 0x428c0000 and 0x4000000 with 0x00000000
If you wonder how can be 0x428c0000 equal to 70.0 give a look to this useful webpage http://www.h-schmidt.net/FloatConverter/IEEE754.html
Here's the result of this first modification.
(first pic is "before", second is "after")
.
.
2) Let's put the timestamp inside the message box bubble
The timestamp position is defined inside the message.xml layout file (already mentioned above) located in C:\Decompression.chamber\com.p1.chompsms-1\res\layout.
Having a look to that file we can see a reference to the timestamp at row number 4, above everything else, and identified by the attribute a:id="@id/message_date_label"
Code:
<TextView a:textAppearance="?historyDateTextAppearance" a:layout_gravity="center_horizontal" a:id="@id/message_date_label" a:paddingLeft=...
In order to have it inside and at the bottom of the message box, we have to move that line down, exactly under the line identified by the label a:id="@id/message_field" so that this:
Code:
<com.p1.chompsms.views.LinearLayoutWithOverlay a:layout_gravity="bottom" a:orientation="vertical" a:id="@id/message_view" ....
<TextView a:textAppearance="?historyMessageTextAppearance" a:autoLink="phone|email|web" a:id="@id/message_field" ...
<ViewStub a:layout_gravity="center_horizontal" a:id="@id/mms_layout_view_stub" ...
</com.p1.chompsms.views.LinearLayoutWithOverlay>
become this:
Code:
<com.p1.chompsms.views.LinearLayoutWithOverlay a:layout_gravity="bottom" a:orientation="vertical" a:id="@id/message_view" ...
<TextView a:textAppearance="?historyMessageTextAppearance" a:autoLink="phone|email|web" a:id="@id/message_field" ...
<TextView a:textAppearance="?historyDateTextAppearance" a:layout_gravity="right" a:id="@id/message_date_label" ...
<ViewStub a:layout_gravity="center_horizontal" a:id="@id/mms_layout_view_stub" ...
</com.p1.chompsms.views.LinearLayoutWithOverlay>
As in the original layout the timestamp is set to be positioned on the center of the screen, we also need to change the a:layout_gravity attribute from "center_horizontal" to "right" so that it will be positioned at the bottom/right of the message text.
Here's the result of the second modification (I changed the timestamp color to black using the app theme settings)
.
3) Let's change the timestamp date and time format
In my opinion the timestamp format that chomp SMS developer had chosen is unnecessarily too long and a not immediately clear as in the Messaging app of the SGY.
Unfortunately find where in the app is defined the date and time format of the timestamp isn't that easy because the chomp SMS developer(s) didn't link the format to any "style" or attr or string or anything that can be found in the "values" folder within the "res" (resources) folder; instead the format is "set" in the programmig code, somewhere, in one of the 4143 smali files
Anyway the code must be "called" by Message.smali (mentioned above) somewhere as that's the part of the app that handle the contents of the Conversation view, including the timestamp.
By searching for the id message_date_label (which refers to the timestamp textview inside message.xml layout) inside Message.smali and for "date" I then found the method setDate(J)V
Code:
.method public setDate(J)V
.locals 3
.prologue
.line 264
iget-object v0, p0, Lcom/p1/chompsms/views/Message;->m:Landroid/widget/TextView;
new-instance v1, Ljava/util/Date;
invoke-direct {v1, p1, p2}, Ljava/util/Date;-><init>(J)V
iget-object v2, p0, Lcom/p1/chompsms/views/Message;->c:Landroid/content/Context;
invoke-static {v1, v2}, Lcom/p1/chompsms/util/cd;->b(Ljava/util/Date;Landroid/content/Context;)Ljava/lang/String;
move-result-object v1
invoke-virtual {v0, v1}, Landroid/widget/TextView;->setText(Ljava/lang/CharSequence;)V
.line 265
return-void
.end method
Here we can see that "m", which earlier is been initialized as a pointer to the timestamp view, is read (iget-object) and stored in v0, then an object "date" and the object "c" are passed to a method "b" defined in com/p1/chompsms/util/cd that will return a "text" (stored in v1) that will be set (with setText) in v0, the timestamp view!
So we need to look at the code of (C:\Decompression.chamber\com.p1.chompsms-1\smali)\com\p1\chompsms\util\cd.smali.
In cd.smali, at the part of the code related to .method public static b(Ljava/util/Date;Landroid/content/Context called by setDate in Message.smali, we can find the instructions that are executed to "build" the timestamp string, with a space (const-string v1, " ") used as junction of the date and the time part of the timestamp text.... bingo!
So now we know that is inside cd.smali that the timestamp is "build"... but unfortunately the code there doesn't use any "string" to format the date and time but, instead, it just call/uses the standard format provided by the operative system
So things are getting more complicated.
In order to change the date and time format we actually need to add some "new" code in cd.smali that will set the format in the way we want.
Here is the code I've added.
In the beginning section # static fields I've added the following that define a couple of additional objetcs containers, "i" and "l" (l like lima)
Code:
.field private static final i:Ljava/text/SimpleDateFormat;
.field private static final l:Ljava/text/SimpleDateFormat;
More down after the marker .line 45 and the instruction
Code:
sput-object v0, Lcom/p1/chompsms/util/cd;->h:Ljava/text/SimpleDateFormat;
I've added the following that stores on "i" and "m" two different formats, one for the time and the other for the date
Code:
.line 99967
new-instance v0, Ljava/text/SimpleDateFormat;
const-string v1, "h:mma"
invoke-direct {v0, v1}, Ljava/text/SimpleDateFormat;-><init>(Ljava/lang/String;)V
sput-object v0, Lcom/p1/chompsms/util/cd;->i:Ljava/text/SimpleDateFormat;
new-instance v0, Ljava/text/SimpleDateFormat;
const-string v1, "d MMM"
invoke-direct {v0, v1}, Ljava/text/SimpleDateFormat;-><init>(Ljava/lang/String;)V
sput-object v0, Lcom/p1/chompsms/util/cd;->l:Ljava/text/SimpleDateFormat;
I then added the following code (which read the format from "i" and apply it to the date stored in p0) inside .method public static b(Ljava/util/Date;Landroid/content/Context
Code:
.line 999388
sget-object v1, Lcom/p1/chompsms/util/cd;->i:Ljava/text/SimpleDateFormat;
invoke-virtual {v1, p0}, Ljava/text/SimpleDateFormat;->format(Ljava/util/Date;)Ljava/lang/String;
move-result-object v1
.line 999395
which goes right above before this:
Code:
invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v0
const-string v1, " "
then const-string v1, " " is been replaced with const-string v1, ", " (I added a comma)
More down, six lines down from const-string v1, ", " , soon after this
Code:
invoke-virtual {v1, p0}, Ljava/text/DateFormat;->format(Ljava/util/Date;)Ljava/lang/String;
move-result-object v1
I've added the following:
Code:
.line 999415
sget-object v1, Lcom/p1/chompsms/util/cd;->l:Ljava/text/SimpleDateFormat;
invoke-virtual {v1, p0}, Ljava/text/SimpleDateFormat;->format(Ljava/util/Date;)Ljava/lang/String;
move-result-object v1
.line 999422
And here is the result of all those modifications...
.
not bad ah?
4) Let's change the bubble style and make it same as in the SGY Messaging app
chomp SMS provides a number of different message box "bubble" styles but in my opinion non of them has the same nice proportions of corners radius and "tail" as seen in the SGY Messaging app.
The bubble styles are actually defined by some related images that are part of the app resources and are saved on (C:\Decompression.chamber\com.p1.chompsms-1\res)\drawable-????-v4, where ???? is anything like ldpi, mdpi, hdpi, etc...
What we need to do is to get the 9.patch (resizable) images from the SGY Messaging apk and save them in the chomp SMS resource folder with the same name of the images that are related to the chomp SMS bubble style that we want to replace
So, first we need to find the images on the SGY Messaging app.
We need to get the apk from an SGY stock firmware... actually the apk name isn't Messaging but Mms .apk. Once we have the apk we need to decompile it and look inside the res folder for any "drawable-????-v4" folder, then using the preview, scroll all the images till one that looks similar to the bubble style is found.
Here is what I've found in (C:\Decompression.chamber\Mms)\res\drawable-ldpi-v4
.
.
.
The images names are respectively: message_bubble_readmessage.9.png, message_bubble_readmessage_selected.9.png, message_bubble_sentmessage.9.png, message_bubble_sentmessage_selected.9.png
This images are very small, and indeed belong the "ldpi" drawable group, that is meant to be used on small screen devices; they can be used on phones with bigger screen too, but they will be scaled up and therefore the image will result blurred along the borders.
These are the images that I found that are related to one of the bubble styles available in chomp SMS and that I chose as the ones that will be replaced.
.
.
.
The images names are respectively,incoming_bubble_matte_retina.9.png, incoming_bubble_matte_retina_selected.9.png, outgoing_bubble_matte_retina.9.png, outgoing_bubble_matte_retina_selected.9.png
These images are available in both mdpi and hdpi versions so their "quality", their resolution is higher than the one available on the SGY Messaging app.
As we are going to copy the SGY Messaging app images in the (C:\Decompression.chamber\com.p1.chompsms-1)\res\drawable-ldpi-v4 folder of decompiled chomp SMS (it has to be the ldpi folder because is the one that match with the size of the images) but the chomp original images are in the mdpi and hdpi folders, we need to delete the original images so chomp SMS app is "forced" to get the images from the ldpi folder.
Then the images from the SGY Messaging app, once copied on the ldpi folder of chomp SMS, they need to be renamed with the same names of the original chomp SMS images, so that chomp SMS app can find them
Here is the final result of the images substitutions (bubble style selector, before and after)
.
Conversation view scaled to be comparable in real size with the screen of SGY
.
5) Let's fix padding and margins in Conversation view
As you might have observed on the above screenshot the relative position of the text inside the message box isn't optimal and anyway doesn't match at all with our reference, the SGY Messaging app.
Also the bubble round corners are clearly blurred due to the low resolution of the 9.patch (resizable) images taken from the SGY Messaging apk.
In order to fix this we need to adjust the 9.patch borders lines that "controls" the padding, the distance between the inside message text and the bubble image borders.
There's also need to make new, bigger size images so that a better quality "bubble" image can be displayed.
Additionally some paddings attributes related to the Conversation view, have to be adjusted.
So here is the old (the first on the left) and the *new* images.
.
.
.
.
.
.
As you might observe the fix of the padding has been done by changing the lenght of the bottom and right/vertical borders black lines (more on that can be read here https://developer.android.com/guide/topics/graphics/2d-graphics.html#nine-patch )
The bigger size images had to be made from scratch (I used GIMP as image editing application) using the original small as a reference. The tricky part was to properly reproduce the transparency (alpha channel) and the shadow.
The bigger images have exactly double the size as the original small one.
According to the Android developers documentations, ldpi images size relative factor is 0.75, mdpi is 1.0 and hdpi is 1.5, so that means that hdpi is 2.0 times than ldpi. By doubling the original small ldpi size the obtained image is suitable to be saved on the hdpi resources folder (C:\Decompression.chamber\com.p1.chompsms-1)\res\drawable-hdpi-v4; if the device is mdpi it will just scale down (by 0.66 factor) the hdpi image, but scaling down is much better than scaling up as it doesn't blur the image.
As the original chomp SMS hdpi versions of the bubble images have been already deleted, saving the new version on that folder won't be a file replacement, but it would have been if we didn't previously deleted the orginal images.
Padding and margins of message box and Conversation layout is also controlled by some values stored in (C:\Decompression.chamber\com.p1.chompsms-1)\res\layout\styles.xml; specifically this:
Code:
<style name="conversation_messageBubbles">
<item name="android:paddingLeft">3.0dip</item>
<item name="android:paddingRight">3.0dip</item>
The value of 3.0 has to be changed to 0.0
Also on (C:\Decompression.chamber\com.p1.chompsms-1)\res\layout\message.xml (that has been modified already above)
Change the attributes values according to this:
On row
Code:
<com.p1.chompsms.views.Message a:orientation="vertical"...
change:
paddingLeft="2.0dip" to 0.0
paddingRight="2.0dip" to 0.0
paddingBottom="8.0dip" to 6.0
On row
Code:
<LinearLayout a:orientation="horizontal" a:id="@id/message_view_wrapper" ...
change:
layout_marginBottom="4.0dip" to 0.0
On row
Code:
<TextView a:textAppearance="?historyDateTextAppearance" a:layout_gravity="right" a:id="@id/message_date_label" ...
replace:
layout_marginBottom="4.0dip" with layout_marginTop="3.0dip"
Once again, here is the achieved result...
.
Above: Conversation view scaled to be comparable in real size with the screen of SGY
Below: Close up of message bubble, before and after
.
Very close to perfect... isn't it?
The tutorial will continue on the following post...
6) Let's customize the "action bar"
The contact number shown in the action bar below the contact name is so ridiculously small that it can't be easily read, especially because a sequence of number is less likely to be visually recognized than a word that have "patterns" that our brain can use to recognize it.
Unfortunately chomp SMS, among the many theme settings, doesn't provide any related to the action bar contents, apart from the color.
So, once again, we need to find out where, in the app resources or code, are saved the values that controls the action bar contents appearance.
Looking at the content of the layout folder we can find a file named conversation.xml that likely will contain the description of the layout of the Conversation view and possibily has a reference to the action bar.
Indeed we can find, at row 5, the following
Code:
<FrameLayout a:id="@id/conversation_header_holder" a:background="?fakeActionBarBackground"
Still in layout folder we can find another file that might be related, with name action_bar_holder.xml
here we see that the second row contains this attribute
Code:
layout_height="?initialActionbarHeight"
The question mark tell use that the value is saved in the styles.xml files which can be found in (C:\Decompression.chamber\com.p1.chompsms-1)\values
Opening styles.xml file and searching for "initialActionbarHeight" we'll find the following:
Code:
<item name="initialActionbarHeight">@dimen/actionbar_height</item>
That means that the value of initialActionbarHeight is saved in dimens.xml file that can be found in the same value folder as styles.xml is.
Opening dimens.xml and searching for actionbar_height we'll find this:
Code:
<dimen name="actionbar_height">48.0dip</dimen>
bingo!
So, let's make the action bar bigger... let's change 48.0 in 52.0
Searching for "actionbar" inside styles.xml we can find a number of styles and values but with some analysis and trial and error attempts you can realize that styles that has "convo_actionbar_customview" in their name are the ones relevant.
Among them the follow two are the one that we are looking for:
Code:
<style name="convo_actionbar_customview_title" parent="@style/ActionBarTitle">
<item name="android:ellipsize">end</item>
<item name="android:layout_width">wrap_content</item>
<item name="android:maxLines">1</item>
Code:
<style name="convo_actionbar_customview_subtitle" parent="@style/ActionBarTitle">
<item name="android:textSize">12.0sp</item>
<item name="android:ellipsize">end</item>
<item name="android:layout_width">wrap_content</item>
<item name="android:layout_height">wrap_content</item>
<item name="android:maxLines">1</item>
Here we can see that the subtitle (which actually is the contact phone number, while the title is the contact name) has a textSize of 12.0sp... to have it bigger we need to, well... you know what!
Let's change it to 16.0sp and set a bit of free space at the bottom, to have it more vertically centered on the action bar, by adding the following line to the style
Code:
<item name="android:paddingBottom">3.0dip</item>
The convo_actionbar_customview_title style doesn't define its own textSize value, so it will just use the one set on the "parent" stlye ActionBarTitle, which is 18.0dip
Code:
<style name="ActionBarTitle" parent="@android:style/TextAppearance.Holo.Widget.ActionBar.Title">
<item name="android:textSize">18.0dip</item>
I tried to change it to 20.0dip but it turned out that the textSize changed only if the contact name was displayed alone without the phone number (without subtitle), but if the number is shown then the contact name text size was as small as the original.
Doing some more searches in the the styles.xml file I then found the following line that belong the definition of the DefaultTheme style.
Code:
<item name="convo_actionbar_customview_title_with_subtitle_textsize">@dimen/convo_actionbar_customview_title_with_subtitle_textsize</item>
That line tells us that the dimension of the phone number is saved in dimens.xml file (already mentioned above) and indeed there we can find this:
Code:
<dimen name="convo_actionbar_customview_title_with_subtitle_textsize">16.0dip</dimen>
By replacing the value of 16.0dip with 20.0dip, the contact name will become bigger and easier to read.
:highfive:
I've observed that there's a glitch on how the ellipsis (the shortening of a text with addition of the theree dots) is applied to the contact name... it's sometimes much shorter than the available space.
I found out that the glitch is fixed if the singleLine attribute is enabled.
So let's add the following line to the convo_actionbar_customview_title style.
Code:
<item name="android:singleLine">true</item>
As last thing I wanted to remove the call button on the action bar because it has appened more than once that while I had the phone on my pants pocket and the screen was unlocked (forgot to lock) then accidentally the call button was touched and a phone call initiated without me being aware of it.
To find where in the app is defined the visualization of the call button, I started with a search for word "call" inside all the files existing in the chomp SMS decompiled app folder (C:\Decompression.chamber\com.p1.chompsms-1)
I then found that the button icon image is saved as ic_call_icon.png both on xhdpi and and xxxhdpi drawable folders.
Searching for ic_call_icon text inside all the files, I found a layout name ic_call_icon_wrapper.xml that contain a reference to that image.
Searching for ic_call_icon_wrapper, I found a smali file, (C:\Decompression.chamber\com.p1.chompsms-1)\smali\com/p1/chompsms/activities/Conversation.smali that contain a reference to ic_call_icon_wrapper layout.
At line 8510 of Conversation.smali, inside .method public onCreateOptionsMenu(Landroid/view/Menu we can find
Code:
sget v2, Lcom/p1/chompsms/s$f;->ic_call_icon_wrapper:I
by analyzing the code a little above and below that row it's possible to spot the "section" that actually initialize the button and attach to it an "intent" the "action" to initiate a call.
To avoid the button to be displayed we can set a jump in the code that will make the execution to bypass that section.
So here it is how to add the jump:
After
Code:
.line 822
invoke-static {}, Lcom/p1/chompsms/util/Util;->g()Z
move-result v0
if-eqz v0, :cond_2
add
Code:
.line 9998500
goto :goto_9998531
Before
Code:
.line 830
const/16 v1, 0xd
add
Code:
:goto_9998531
And now... as usual... the final result!
.
Before... after
That's more than enough for what concern the Conversation view... mission accomplished!
7) Let's "fix" the "Conversation list", the "main" view, layout
Let's have again a look at the chomp SMS conversations and compare it to the SGY Messaging app.
.
First of all I don't understand why the date should be on the same line of the contact name thus shorting it, instead of being on the same line of the message preview as it is in the old SGY Messaging app.
Secondly... I don't like that date format! :silly:
So... let's fix it.
As usual the first thing to do is to find the layout file, or smali file that control the appearance of the conversation list view.
The first guess is the layout file main.xml in res\layout folder.
It indeed contains some references to a few parts of the view, but not in detail the parts that we are looking to modify, which are eventually described on another layout file.
Scrolling the files in layout folder another one seems very promising by its name: conversation_row.xml
Found! bingo!
in conversation_row.xml there' are clear references to the contact name, message row, and date
Here is the related lines
For contact name and date
Code:
<com.p1.chompsms.activities.search.SearchResultTextView a:id="@id/person_label" ...
<com.p1.chompsms.views.TextViewWithEllipsesFix a:id="@id/date_label"...
For message text
Code:
<com.p1.chompsms.activities.search.SearchResultTextView a:id="@id/subject_label"
The textview id attributes (id/person_label, id/subject_label, id/date_label) makes it very sure that those lines are the one that controls the positions of contact name, message text, and date.
So, in order to change the relative positions we just have to properly move those lines within the layout
Let's cut the date_label TextView line and paste it right below the subject_label TextView line, so that it looks like this
Code:
<LinearLayout a:orientation="horizontal" a:layout_width="fill_parent" a:layout_height="wrap_content">
<com.p1.chompsms.activities.search.SearchResultTextView a:id="@id/subject_label"...
<com.p1.chompsms.views.TextViewWithEllipsesFix a:id="@id/date_label" ...
<ImageView a:layout_gravity="bottom" a:id="@id/pinned_marker"...
That's enough to move the date from the above line with the contact name to the below line with the message text.
But we can see that in the same line of the date, now (actually at the right of the date) there's the placeholder for the image that is used to a conversation row as "pinned".
The three objects, message text, date and marker are listed in three rows one below the other, but they will actually be displayed on one horizontal row, one next the other, as the LinearLayout they belong is set as orientation="horizontal".
Is better to move the pinned marker on the same row of the contact name, so... cut and paste right below the person_label TextView line, so that it looks like this
Code:
<LinearLayout a:orientation="horizontal" a:layout_marginTop="-3.0dip" ...
<com.p1.chompsms.views.BaseLineImageView a:id="@id/unread_marker"...
<com.p1.chompsms.views.BaseLineImageView a:id="@id/no_notification"...
<com.p1.chompsms.activities.search.SearchResultTextView a:id="@id/person_label"...
<ImageView a:layout_gravity="bottom" a:id="@id/pinned_marker"...
Ok, that's done
Now the "hard" part... the modification of date formatting.
To find where in the 1672 smali files contained in (C:\Decompression.chamber\com.p1.chompsms-1)\smali\com\p1\chompsms is the piece of code that set the date format we can try to trace back the chain starting from the conversation_row.xml layout.
Here we see that the date TextView contents is "controlled" by com.p1.chompsms.views.TextViewWithEllipsesFix that can be found and read as a smali file of name TextViewWithEllipsesFix.smali saved in (C:\Decompression.chamber\com.p1.chompsms-1)\smali\com\p1\chompsms\views
Giving a look at the code of that smali file doesn't show anything related to the date format, so it means that there must be another place, another smali file, that does the date formatting and then pass the result to TextViewWithEllipsesFix; we need to find any smali file that has inside a call to TextViewWithEllipsesFix.
Unfortunately, there's not even one smali file that contains a reference to Lcom/p1/chompsms/views/TextViewWithEllipsesFix in order to pass some data to it or call any of its method.
Eventually the code we are looking for is in (C:\Decompression.chamber\com.p1.chompsms-1)\smali\com\p1\chompsms\views\ConversationRow.smali that is defined in conversation_row.xml layout as the root view, the main container.
By reading the contents of ConversationRow.smali, we can see that at the beginning is defined a variable "p" made to contain a date object
Code:
.field private p:Ljava/util/Date;
A few line below, inside the .method public constructor, the "date" , received by as argument p0, is saved in "p".
Code:
iput-object v0, p0, Lcom/p1/chompsms/views/ConversationRow;->p:Ljava/util/Date;
Searching for the string "->p:Ljava/util/Date" we can see that "p" is used only in the .method public final b(J)Ljava/util/Date;
The method "b(J)Ljava/util/Date" isn't called anywhere within ConversationRow.smali, so the parameters it receives and the results it returns must be related to some code in some other smali file.
Searching the whole chomp SMS smali folder for files containing the string "b(J)Ljava/util/Date" gave me as result two files:
com/p1/chompsms/activities/conversationlist/ConversationList$a.smali
com/p1/chompsms/activities/search/a.smali
In a.smali, in .method public final bindView, at row 171 there's the call to method "b(J)"
Code:
invoke-virtual {v3, v4, v5}, Lcom/p1/chompsms/views/ConversationRow;->b(J)Ljava/util/Date;
The result of the call, supposedly it's a date or time, is then saved to v4, then v5 and v9 are set to numeric value "1", then v0 is set equal to p2 (a parameter received by the bindView method) then v4, v0, v5, v9 are all used to make a call to method a(Ljava/util/Date;Landroid/content/Context;ZZ)Ljava/lang/String defined in com\p1\chompsms\util\cd.smali
Code:
invoke-static {v4, v0, v5, v9}, Lcom/p1/chompsms/util/cd;->a(Ljava/util/Date;Landroid/content/Context;ZZ)Ljava/lang/String;
util\cd.smali ?
But that's the same cd.smali that we had to modify earlier to change the format of time and date in the conversation message timestamp!
Let's have a look to method "a(Ljava/util/Date;Landroid/content..." in cd.smali
The method is quite long, but it's clear that is doing some kind of operations on the date that it has received when is been called by a.smali, which has received the date from method "b" in conversation_row.smali.
The "a" method calls the calendar
Code:
invoke-virtual {v2, v3}, Ljava/util/Calendar;->get(I)I
in order to know how many days are past from the given date and the present time.
It then choose if in place of a "text" containing a formatted date it has to return a string like "today" or "yesterday"
Code:
.line 78
:cond_1
sget v0, Lcom/p1/chompsms/s$l;->today:I
Code:
.line 82
sget v0, Lcom/p1/chompsms/s$l;->yesterday:I
But if it's not the case for "today" or "yesterday", but still the given date isn't past than more than three days, than the method code will format the date using the SimpleDateFormat stored in "a" variable!
Code:
sget-object v0, Lcom/p1/chompsms/util/cd;->a:Ljava/text/SimpleDateFormat;
invoke-virtual {v0, p0}, Ljava/text/SimpleDateFormat;->format(Ljava/util/Date;)Ljava/lang/String;
move-result-object v0
If we look at the very beginning of the cd.smali file we can see that the date format stored in "a" is in the form of "EEEE"
Code:
const-string v1, "EEEE"
invoke-direct {v0, v1}, Ljava/text/SimpleDateFormat;-><init>(Ljava/lang/String;)V
sput-object v0, Lcom/p1/chompsms/util/cd;->a:Ljava/text/SimpleDateFormat;
"EEEE" is the standard pattern letter that refers to the "day of the week" (for more info read here https://docs.oracle.com/javase/7/docs/api/java/text/SimpleDateFormat.html) and as the "E" letters are four then the name will be in full, not abbreviated... like Sunday and Monday, instead of Sun, and Mon.
So if the date that has been received is same as the present date or is one day or two days old the result would be either "today", "yesterday" or the day of the week, but if it's older...
Code:
.line 89
:cond_4
invoke-static {p1}, Lcom/p1/chompsms/util/cd;->b(Landroid/content/Context;)Ljava/text/DateFormat;
The DateFormat returned by .method private static declared-synchronized b(Landroid/content/Context; )Ljava/text/DateFormat will be used.
Having a look to the contents of that method we can see that it retrieves the DateFormat by querying the System Settings
Code:
const-string v2, "date_format"
invoke-static {v0, v2}, Landroid/provider/Settings$System;->getString(Landroid/content/ContentResolver;Ljava/lang/String;)Ljava/lang/String;
That means that the Date Format will change (synchronized) accordingly with the current System settings.
Well... that's enough! Tiring ah? :silly:
So, we found it! :highfive:
But we still have to fix it... well... that's quite simple once we know where to put our hands
Let's just add a SimpleDateFormat as we already did before for the message TimeStamp and insert the code to force the use of that format instead of the one returned by method "b"
At the beginning of the cd.smali file, # static fields section, add
Code:
.field private static final m:Ljava/text/SimpleDateFormat;
At the end of .method static constructor <clinit>()V, below the code added before, add the following
Code:
new-instance v0, Ljava/text/SimpleDateFormat;
const-string v1, "d MMM yy"
invoke-direct {v0, v1}, Ljava/text/SimpleDateFormat;-><init>(Ljava/lang/String;)V
sput-object v0, Lcom/p1/chompsms/util/cd;->m:Ljava/text/SimpleDateFormat;
(note that "d MMM yy", is a pattern for a date format like 9 Sep 16)
Then, as last step, replace this
Code:
.line 89
:cond_4
invoke-static {p1}, Lcom/p1/chompsms/util/cd;->b(Landroid/content/Context;)Ljava/text/DateFormat;
move-result-object v0
invoke-virtual {v0, p0}, Ljava/text/DateFormat;->format(Ljava/util/Date;)Ljava/lang/String;
move-result-object v0
with this:
Code:
.line 89
:cond_4
sget-object v0, Lcom/p1/chompsms/util/cd;->m:Ljava/text/SimpleDateFormat;
invoke-virtual {v0, p0}, Ljava/text/SimpleDateFormat;->format(Ljava/util/Date;)Ljava/lang/String;
move-result-object v0
Job done! Congratulations! :highfive:
So, let's see how it looks the result of this hard work
.
8) The last touch
If you observe the above pictures you'll find that the Conversation list layout isn't as compact as in SGY Messaging app; moreover the divider line, for some reason, doesn't go all the way from one side to the other of the screen, but has a sort of "margin" distance on its left side.
In order to fine tuning the layout we need to change a few values here and there and add a few too
In values\styles.xml, style "conversationlist_row_content",
change android: paddingLeft value from 8.0 to 0.0
change android: paddingTop value from 10.0 to 7.0
change android: paddingRight value from 16.0 to 6.0
change android: paddingBottom value from 10.0 to 8.0
Code:
<style name="conversationlist_row_content">
<item name="android:paddingLeft">0.0dip</item>
<item name="android:paddingTop">7.0dip</item>
<item name="android:paddingRight">6.0dip</item>
<item name="android:paddingBottom">8.0dip</item>
In values\styles.xml, style "conversationlist_row_personlabel",
change android: paddingRight value from 6.0 to 0.0
add android:lineSpacingExtra with value -2.0dip
Code:
<style name="conversationlist_row_personlabel">
<item name="android:paddingRight">0.0dip</item>
<item name="android:lineSpacingExtra">-2.0dip</item>
In values\styles.xml, style "conversationlist_row_datelabel",
add android: paddingLeft with value from 6.0
Code:
<style name="conversationlist_row_datelabel">
<item name="android:paddingLeft">6.0dip</item>
In values\styles.xml, style "conversationlist_row_subjectlabel",
add android:singleLine with value "true" (to fix the glitch on the ellipsizing)
Code:
<style name="conversationlist_row_subjectlabel">
<item name="android:singleLine">true</item>
About the divider...
I hoped I could find any layout file or style attribute somewhere that was related to that left margin that prevents the divider to fill the screen from one side to the other... I couldn't... there's not such thing.
Once again, same as for the case of the message box margin, the divider left margin is "hardcoded".
By searching "divider" within all the smali files existing in (C:\Decompression.chamber\com.p1.chompsms-1)\smali\com\p1\chompsms, there are 27 smali files found but one of them has name ConversationList.smali that seems promising.
The file is located in (C:\Decompression.chamber\com.p1.chompsms-1)\smali\com\p1\chompsms\activities\conversationlist
Indeed... it's the right file!
It invokes setDivider...
Code:
invoke-virtual {v1, v0}, Lcom/p1/chompsms/activities/conversationlist/ConversationListListView;->setDivider(Landroid/graphics/drawable/Drawable;)V
... and setDividerHeight
Code:
invoke-virtual {v0, v1}, Lcom/p1/chompsms/activities/conversationlist/ConversationListListView;->setDividerHeight(I)V
Unlike what we found on com/p1/chompsms/views/Message.smali, in ConversationList.smali can't be found any call to setMargins method; there's instead a call to the InsetDrawable class.
Code:
invoke-direct/range {v0 .. v5}, Landroid/graphics/drawable/InsetDrawable;-><init>(Landroid/graphics/drawable/Drawable;IIII)V
Changing this
Code:
.line 678
:cond_0
const/high16 v1, 0x41800000 # 16.0f
To this
Code:
.line 678
:cond_0
const/high16 v1, 0x00000000 # 0.0f
Will get rid of the divider "margin"
Changing this
Code:
.line 683
iget-object v0, p0, Lcom/p1/chompsms/activities/conversationlist/ConversationList;->h:Lcom/p1/chompsms/activities/conversationlist/ConversationListListView;
const/high16 v1, 0x3f800000 # 1.0f
To this
Code:
.line 683
iget-object v0, p0, Lcom/p1/chompsms/activities/conversationlist/ConversationList;->h:Lcom/p1/chompsms/activities/conversationlist/ConversationListListView;
const/high16 v1, 0x3fc00000 # 1.0f
Will increase the divider thickness from 1.0dip to 1.5dip
So, now... it's showtime! :fingers-crossed:
.
Cherry on the cake
If the phone is connected to the Internet, every three times that the user "enter" one of the SMS conversations, chomp SMS will display an advertisment that will pin on top of the Conversation list... like this
and it will stay there untill the ad gets touched.
The ads are displayed according to their dedicated layouts; there are two different layouts: one generic and one specific for Facebook ads.
The two layouts are defined by two xml files: conversation_list_native_ad_row.xml and conversation_list_native_ad_row_facebook.xml
By adding the attribute a:visibility="gone" to the layouts, the ads won't be visibile anymore (please don't ask "how"... find it out yourself)
As cherry on the cake I decided to make a new app icon for the modified chomp SMS app; an icon that is a mix of the SGY Messaging icon and the original chomp SMS one.
+
=
The icon is of hdpi size and it's available for download as attachment to this post.
That's all folks!
If you have enjoyed to follow the tutorial your click on the thanks button here below will be highly appreciated
Thanks for reading
Reserved
good job. yes, apps keep getting worse. i guess the focus is now on getting your credit card number or harvesting your contacts for marketing, not with the user.
ok - somewhat unrelated, but i trust you'll know... - where does chomp SMS keep its blacklist? i need an SMS app that has an import function, but barring that, i could manipulate the file manually if it's text or XML.
hi, I never used the blacklist function so I didn't even never bother to know where it's saved.
Anyway usually apps have two preferred places where to save their data, one is the databases folder inside the app dedicated folder in the /data partition, the others is the shared_prefs also inside the app dedicated folder in /data/data.
After a quick check I found out that the blacklist is saved in the chompSMS Preferences.xml file.
Unfortunately the list is encoded so the numbers in the list aren't visibile and the app doesn't recognize the numbers if they aren't properly encoded.
You are so spot on with your comments in the first post. I have been using my old LG F3 for so long and the SMS worked so great with layout etc etc... I got a BLU Vivo last year because I needed a bigger screen for GPS driving...
I have just been using the larger phone for driving with my job, via a hotspot on the LG... but time had come to make the newer BLU phone my main phone...
And it has been drudgery finding a replacement app for the new phone, just getting the look and feel to the old phone which was perfect (stock SMS) circa 2013.
Chomp was close... I stumbled upon this post and I am stoked to try your work.
I've never done apk mods.. lots of other coding.. and I am excited to dive in with your examples as my first learning experience with apk.
Doing the date mod in the bubble, and removing wasted space in the bubble, is most important to me.
I am going to try to add an Icon for the "templates" somewhere on the screen, because I use them a lot.
If successful I'll get back and post the info.
Thanks a bunch for your work. I'm stoked !
Rob

Categories

Resources