[Android Software/Hacking General [Developers Only]] ilendemli:
Hello Guys!

Actually you know, the Stock Mms.apk recognizes only Smiley like :-) :-( etc.

and not the "short" version :) :( etc..

So i tried to modify the Mms.apk to parse the other chars too but i don't know where to change them.

So can someone help me, or modify the Mms.apk file?

SmileyParser$Smileys.smali

.class Lcom/android/mms/util/SmileyParser$Smileys;
.super Ljava/lang/Object;
.source "SmileyParser.java"

# annotations
.annotation system Ldalvik/annotation/EnclosingClass;
value = Lcom/android/mms/util/SmileyParser;
.end annotation

.annotation system Ldalvik/annotation/InnerClass;
accessFlags = 0x8
name = "Smileys"
.end annotation

# static fields
.field public static ANGEL:I

.field public static COOL:I

.field public static CRYING:I

.field public static EMBARRASSED:I

.field public static FOOT_IN_MOUTH:I

.field public static HAPPY:I

.field public static KISSING:I

.field public static LAUGHING:I

.field public static LIPS_ARE_SEALED:I

.field public static MONEY_MOUTH:I

.field public static SAD:I

.field public static SURPRISED:I

.field public static TONGUE_STICKING_OUT:I

.field public static UNDECIDED:I

.field public static WINKING:I

.field public static WTF:I

.field public static YELLING:I

.field private static final sIconIds:[I

# direct methods
.method static constructor <clinit>()V
.registers 1

.prologue
.line 56
const/16 v0, 0x11

new-array v0, v0, [I

fill-array-data v0, :array_46

sput-object v0, Lcom/android/mms/util/SmileyParser$Smileys;->sIconIds:[I

.line 76
const/4 v0, 0x0

sput v0, Lcom/android/mms/util/SmileyParser$Smileys;->HAPPY:I

.line 77
const/4 v0, 0x1

sput v0, Lcom/android/mms/util/SmileyParser$Smileys;->SAD:I

.line 78
const/4 v0, 0x2

sput v0, Lcom/android/mms/util/SmileyParser$Smileys;->WINKING:I

.line 79
const/4 v0, 0x3

sput v0, Lcom/android/mms/util/SmileyParser$Smileys;->TONGUE_STICKING_OUT:I

.line 80
const/4 v0, 0x4

sput v0, Lcom/android/mms/util/SmileyParser$Smileys;->SURPRISED:I

.line 81
const/4 v0, 0x5

sput v0, Lcom/android/mms/util/SmileyParser$Smileys;->KISSING:I

.line 82
const/4 v0, 0x6

sput v0, Lcom/android/mms/util/SmileyParser$Smileys;->YELLING:I

.line 83
const/4 v0, 0x7

sput v0, Lcom/android/mms/util/SmileyParser$Smileys;->COOL:I

.line 84
const/16 v0, 0x8

sput v0, Lcom/android/mms/util/SmileyParser$Smileys;->MONEY_MOUTH:I

.line 85
const/16 v0, 0x9

sput v0, Lcom/android/mms/util/SmileyParser$Smileys;->FOOT_IN_MOUTH:I

.line 86
const/16 v0, 0xa

sput v0, Lcom/android/mms/util/SmileyParser$Smileys;->EMBARRASSED:I

.line 87
const/16 v0, 0xb

sput v0, Lcom/android/mms/util/SmileyParser$Smileys;->ANGEL:I

.line 88
const/16 v0, 0xc

sput v0, Lcom/android/mms/util/SmileyParser$Smileys;->UNDECIDED:I

.line 89
const/16 v0, 0xd

sput v0, Lcom/android/mms/util/SmileyParser$Smileys;->CRYING:I

.line 90
const/16 v0, 0xe

sput v0, Lcom/android/mms/util/SmileyParser$Smileys;->LIPS_ARE_SEALED:I

.line 91
const/16 v0, 0xf

sput v0, Lcom/android/mms/util/SmileyParser$Smileys;->LAUGHING:I

.line 92
const/16 v0, 0x10

sput v0, Lcom/android/mms/util/SmileyParser$Smileys;->WTF:I

return-void

.line 56
:array_46
.array-data 0x4
0x13t 0x0t 0x2t 0x7ft
0x18t 0x0t 0x2t 0x7ft
0x1ct 0x0t 0x2t 0x7ft
0x1at 0x0t 0x2t 0x7ft
0x19t 0x0t 0x2t 0x7ft
0x14t 0x0t 0x2t 0x7ft
0x1et 0x0t 0x2t 0x7ft
0xft 0x0t 0x2t 0x7ft
0x17t 0x0t 0x2t 0x7ft
0x12t 0x0t 0x2t 0x7ft
0x11t 0x0t 0x2t 0x7ft
0xet 0x0t 0x2t 0x7ft
0x1bt 0x0t 0x2t 0x7ft
0x10t 0x0t 0x2t 0x7ft
0x16t 0x0t 0x2t 0x7ft
0x15t 0x0t 0x2t 0x7ft
0x1dt 0x0t 0x2t 0x7ft
.end array-data
.end method

.method constructor <init>()V
.registers 1

.prologue
.line 55
invoke-direct {p0}, Ljava/lang/Object;-><init>()V

return-void
.end method

.method public static getSmileyResource(I)I
.registers 2
.parameter "which"

.prologue
.line 95
sget-object v0, Lcom/android/mms/util/SmileyParser$Smileys;->sIconIds:[I

aget v0, v0, p0

return v0
.end method

SmileyParser.smali

.class public Lcom/android/mms/util/SmileyParser;
.super Ljava/lang/Object;
.source "SmileyParser.java"

# annotations
.annotation system Ldalvik/annotation/MemberClasses;
value = {
Lcom/android/mms/util/SmileyParser$Smileys;
}
.end annotation

# static fields
.field public static final DEFAULT_SMILEY_NAMES:I = 0x7f060001

.field public static final DEFAULT_SMILEY_RES_IDS:[I = null

.field public static final DEFAULT_SMILEY_TEXTS:I = 0x7f060000

.field private static sInstance:Lcom/android/mms/util/SmileyParser;

# instance fields
.field private final mContext:Landroid/content/Context;

.field private final mPattern:Ljava/util/regex/Pattern;

.field private final mSmileyTexts:[Ljava/lang/String;

.field private final mSmileyToRes:Ljava/util/HashMap;
.annotation system Ldalvik/annotation/Signature;
value = {
"Ljava/util/HashMap",
"<",
"Ljava/lang/String;",
"Ljava/lang/Integer;",
">;"
}
.end annotation
.end field

# direct methods
.method static constructor <clinit>()V
.registers 3

.prologue
.line 101
const/16 v0, 0x11

new-array v0, v0, [I

const/4 v1, 0x0

sget v2, Lcom/android/mms/util/SmileyParser$Smileys;->HAPPY:I

invoke-static {v2}, Lcom/android/mms/util/SmileyParser$Smileys;->getSmileyResource(I)I

move-result v2

aput v2, v0, v1

const/4 v1, 0x1

sget v2, Lcom/android/mms/util/SmileyParser$Smileys;->SAD:I

invoke-static {v2}, Lcom/android/mms/util/SmileyParser$Smileys;->getSmileyResource(I)I

move-result v2

aput v2, v0, v1

const/4 v1, 0x2

sget v2, Lcom/android/mms/util/SmileyParser$Smileys;->WINKING:I

invoke-static {v2}, Lcom/android/mms/util/SmileyParser$Smileys;->getSmileyResource(I)I

move-result v2

aput v2, v0, v1

const/4 v1, 0x3

sget v2, Lcom/android/mms/util/SmileyParser$Smileys;->TONGUE_STICKING_OUT:I

invoke-static {v2}, Lcom/android/mms/util/SmileyParser$Smileys;->getSmileyResource(I)I

move-result v2

aput v2, v0, v1

const/4 v1, 0x4

sget v2, Lcom/android/mms/util/SmileyParser$Smileys;->SURPRISED:I

invoke-static {v2}, Lcom/android/mms/util/SmileyParser$Smileys;->getSmileyResource(I)I

move-result v2

aput v2, v0, v1

const/4 v1, 0x5

sget v2, Lcom/android/mms/util/SmileyParser$Smileys;->KISSING:I

invoke-static {v2}, Lcom/android/mms/util/SmileyParser$Smileys;->getSmileyResource(I)I

move-result v2

aput v2, v0, v1

const/4 v1, 0x6

sget v2, Lcom/android/mms/util/SmileyParser$Smileys;->YELLING:I

invoke-static {v2}, Lcom/android/mms/util/SmileyParser$Smileys;->getSmileyResource(I)I

move-result v2

aput v2, v0, v1

const/4 v1, 0x7

sget v2, Lcom/android/mms/util/SmileyParser$Smileys;->COOL:I

invoke-static {v2}, Lcom/android/mms/util/SmileyParser$Smileys;->getSmileyResource(I)I

move-result v2

aput v2, v0, v1

const/16 v1, 0x8

sget v2, Lcom/android/mms/util/SmileyParser$Smileys;->MONEY_MOUTH:I

invoke-static {v2}, Lcom/android/mms/util/SmileyParser$Smileys;->getSmileyResource(I)I

move-result v2

aput v2, v0, v1

const/16 v1, 0x9

sget v2, Lcom/android/mms/util/SmileyParser$Smileys;->FOOT_IN_MOUTH:I

invoke-static {v2}, Lcom/android/mms/util/SmileyParser$Smileys;->getSmileyResource(I)I

move-result v2

aput v2, v0, v1

const/16 v1, 0xa

sget v2, Lcom/android/mms/util/SmileyParser$Smileys;->EMBARRASSED:I

invoke-static {v2}, Lcom/android/mms/util/SmileyParser$Smileys;->getSmileyResource(I)I

move-result v2

aput v2, v0, v1

const/16 v1, 0xb

sget v2, Lcom/android/mms/util/SmileyParser$Smileys;->ANGEL:I

invoke-static {v2}, Lcom/android/mms/util/SmileyParser$Smileys;->getSmileyResource(I)I

move-result v2

aput v2, v0, v1

const/16 v1, 0xc

sget v2, Lcom/android/mms/util/SmileyParser$Smileys;->UNDECIDED:I

invoke-static {v2}, Lcom/android/mms/util/SmileyParser$Smileys;->getSmileyResource(I)I

move-result v2

aput v2, v0, v1

const/16 v1, 0xd

sget v2, Lcom/android/mms/util/SmileyParser$Smileys;->CRYING:I

invoke-static {v2}, Lcom/android/mms/util/SmileyParser$Smileys;->getSmileyResource(I)I

move-result v2

aput v2, v0, v1

const/16 v1, 0xe

sget v2, Lcom/android/mms/util/SmileyParser$Smileys;->LIPS_ARE_SEALED:I

invoke-static {v2}, Lcom/android/mms/util/SmileyParser$Smileys;->getSmileyResource(I)I

move-result v2

aput v2, v0, v1

const/16 v1, 0xf

sget v2, Lcom/android/mms/util/SmileyParser$Smileys;->LAUGHING:I

invoke-static {v2}, Lcom/android/mms/util/SmileyParser$Smileys;->getSmileyResource(I)I

move-result v2

aput v2, v0, v1

const/16 v1, 0x10

sget v2, Lcom/android/mms/util/SmileyParser$Smileys;->WTF:I

invoke-static {v2}, Lcom/android/mms/util/SmileyParser$Smileys;->getSmileyResource(I)I

move-result v2

aput v2, v0, v1

sput-object v0, Lcom/android/mms/util/SmileyParser;->DEFAULT_SMILEY_RES_IDS:[I

return-void
.end method

.method private constructor <init>(Landroid/content/Context;)V
.registers 4
.parameter "context"

.prologue
.line 48
invoke-direct {p0}, Ljava/lang/Object;-><init>()V

.line 49
invoke-virtual {p1}, Landroid/content/Context;->getApplicationContext()Landroid/content/Context;

move-result-object v0

iput-object v0, p0, Lcom/android/mms/util/SmileyParser;->mContext:Landroid/content/Context;

.line 50
iget-object v0, p0, Lcom/android/mms/util/SmileyParser;->mContext:Landroid/content/Context;

invoke-virtual {v0}, Landroid/content/Context;->getResources()Landroid/content/res/Resources;

move-result-object v0

const/high16 v1, 0x7f06

invoke-virtual {v0, v1}, Landroid/content/res/Resources;->getStringArray(I)[Ljava/lang/String;

move-result-object v0

iput-object v0, p0, Lcom/android/mms/util/SmileyParser;->mSmileyTexts:[Ljava/lang/String;

.line 51
invoke-direct {p0}, Lcom/android/mms/util/SmileyParser;->buildSmileyToRes()Ljava/util/HashMap;

move-result-object v0

iput-object v0, p0, Lcom/android/mms/util/SmileyParser;->mSmileyToRes:Ljava/util/HashMap;

.line 52
invoke-direct {p0}, Lcom/android/mms/util/SmileyParser;->buildPattern()Ljava/util/regex/Pattern;

move-result-object v0

iput-object v0, p0, Lcom/android/mms/util/SmileyParser;->mPattern:Ljava/util/regex/Pattern;

.line 53
return-void
.end method

.method private buildPattern()Ljava/util/regex/Pattern;
.registers 9

.prologue
.line 150
new-instance v3, Ljava/lang/StringBuilder;

iget-object v5, p0, Lcom/android/mms/util/SmileyParser;->mSmileyTexts:[Ljava/lang/String;

array-length v5, v5

mul-int/lit8 v5, v5, 0x3

invoke-direct {v3, v5}, Ljava/lang/StringBuilder;-><init>(I)V

.line 154
.local v3, patternString:Ljava/lang/StringBuilder;
const/16 v5, 0x28

invoke-virtual {v3, v5}, Ljava/lang/StringBuilder;->append(C)Ljava/lang/StringBuilder;

.line 155
iget-object v0, p0, Lcom/android/mms/util/SmileyParser;->mSmileyTexts:[Ljava/lang/String;

.local v0, arr$:[Ljava/lang/String;
array-length v2, v0

.local v2, len$:I
const/4 v1, 0x0

.local v1, i$:I
:goto_13
if-ge v1, v2, :cond_26

aget-object v4, v0, v1

.line 156
.local v4, s:Ljava/lang/String;
invoke-static {v4}, Ljava/util/regex/Pattern;->quote(Ljava/lang/String;)Ljava/lang/String;

move-result-object v5

invoke-virtual {v3, v5}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

.line 157
const/16 v5, 0x7c

invoke-virtual {v3, v5}, Ljava/lang/StringBuilder;->append(C)Ljava/lang/StringBuilder;

.line 155
add-int/lit8 v1, v1, 0x1

goto :goto_13

.line 160
.end local v4 #s:Ljava/lang/String;
:cond_26
invoke-virtual {v3}, Ljava/lang/StringBuilder;->length()I

move-result v5

const/4 v6, 0x1

sub-int/2addr v5, v6

invoke-virtual {v3}, Ljava/lang/StringBuilder;->length()I

move-result v6

const-string v7, ")"

invoke-virtual {v3, v5, v6, v7}, Ljava/lang/StringBuilder;->replace(IILjava/lang/String;)Ljava/lang/StringBuilder;

.line 162
invoke-virtual {v3}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

move-result-object v5

invoke-static {v5}, Ljava/util/regex/Pattern;->compile(Ljava/lang/String;)Ljava/util/regex/Pattern;

move-result-object v5

return-object v5
.end method

.method private buildSmileyToRes()Ljava/util/HashMap;
.registers 5
.annotation system Ldalvik/annotation/Signature;
value = {
"()",
"Ljava/util/HashMap",
"<",
"Ljava/lang/String;",
"Ljava/lang/Integer;",
">;"
}
.end annotation

.prologue
.line 129
sget-object v2, Lcom/android/mms/util/SmileyParser;->DEFAULT_SMILEY_RES_IDS:[I

array-length v2, v2

iget-object v3, p0, Lcom/android/mms/util/SmileyParser;->mSmileyTexts:[Ljava/lang/String;

array-length v3, v3

if-eq v2, v3, :cond_10

.line 132
new-instance v2, Ljava/lang/IllegalStateException;

const-string v3, "Smiley resource ID/text mismatch"

invoke-direct {v2, v3}, Ljava/lang/IllegalStateException;-><init>(Ljava/lang/String;)V

throw v2

.line 135
:cond_10
new-instance v1, Ljava/util/HashMap;

iget-object v2, p0, Lcom/android/mms/util/SmileyParser;->mSmileyTexts:[Ljava/lang/String;

array-length v2, v2

invoke-direct {v1, v2}, Ljava/util/HashMap;-><init>(I)V

.line 137
.local v1, smileyToRes:Ljava/util/HashMap;,"Ljava/util/HashMap<Ljava/lang/String;Ljava/lang/Integer;>;"
const/4 v0, 0x0

.local v0, i:I
:goto_19
iget-object v2, p0, Lcom/android/mms/util/SmileyParser;->mSmileyTexts:[Ljava/lang/String;

array-length v2, v2

if-ge v0, v2, :cond_30

.line 138
iget-object v2, p0, Lcom/android/mms/util/SmileyParser;->mSmileyTexts:[Ljava/lang/String;

aget-object v2, v2, v0

sget-object v3, Lcom/android/mms/util/SmileyParser;->DEFAULT_SMILEY_RES_IDS:[I

aget v3, v3, v0

invoke-static {v3}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;

move-result-object v3

invoke-virtual {v1, v2, v3}, Ljava/util/HashMap;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;

.line 137
add-int/lit8 v0, v0, 0x1

goto :goto_19

.line 141
:cond_30
return-object v1
.end method

.method public static getInstance()Lcom/android/mms/util/SmileyParser;
.registers 1

.prologue
.line 38
sget-object v0, Lcom/android/mms/util/SmileyParser;->sInstance:Lcom/android/mms/util/SmileyParser;

return-object v0
.end method

.method public static init(Landroid/content/Context;)V
.registers 2
.parameter "context"

.prologue
.line 40
new-instance v0, Lcom/android/mms/util/SmileyParser;

invoke-direct {v0, p0}, Lcom/android/mms/util/SmileyParser;-><init>(Landroid/content/Context;)V

sput-object v0, Lcom/android/mms/util/SmileyParser;->sInstance:Lcom/android/mms/util/SmileyParser;

.line 41
return-void
.end method

# virtual methods
.method public addSmileySpans(Ljava/lang/CharSequence;)Ljava/lang/CharSequence;
.registers 13
.parameter "text"

.prologue
const/16 v10, 0x29

const/4 v9, 0x1

.line 175
new-instance v0, Landroid/text/SpannableStringBuilder;

invoke-direct {v0, p1}, Landroid/text/SpannableStringBuilder;-><init>(Ljava/lang/CharSequence;)V

.line 176
.local v0, builder:Landroid/text/SpannableStringBuilder;
invoke-interface {p1}, Ljava/lang/CharSequence;->length()I

move-result v5

.line 178
.local v5, textLength:I
iget-object v6, p0, Lcom/android/mms/util/SmileyParser;->mPattern:Ljava/util/regex/Pattern;

invoke-virtual {v6, p1}, Ljava/util/regex/Pattern;->matcher(Ljava/lang/CharSequence;)Ljava/util/regex/Matcher;

move-result-object v2

.line 179
.local v2, matcher:Ljava/util/regex/Matcher;
:cond_12
:goto_12
invoke-virtual {v2}, Ljava/util/regex/Matcher;->find()Z

move-result v6

if-eqz v6, :cond_79

.line 180
invoke-virtual {v2}, Ljava/util/regex/Matcher;->group()Ljava/lang/String;

move-result-object v4

.line 181
.local v4, smileyText:Ljava/lang/CharSequence;
invoke-virtual {v2}, Ljava/util/regex/Matcher;->end()I

move-result v1

.line 183
.local v1, end:I
const-string v6, ":-)"

invoke-virtual {v4, v6}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

move-result v6

if-eqz v6, :cond_36

.line 184
sub-int v6, v5, v9

if-gt v1, v6, :cond_36

invoke-virtual {p1}, Ljava/lang/Object;->toString()Ljava/lang/String;

move-result-object v6

invoke-virtual {v6, v1}, Ljava/lang/String;->charAt(I)C

move-result v6

if-eq v6, v10, :cond_12

.line 187
:cond_36
const-string v6, ":-("

invoke-virtual {v4, v6}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

move-result v6

if-eqz v6, :cond_58

.line 188
sub-int v6, v5, v9

if-gt v1, v6, :cond_58

invoke-virtual {p1}, Ljava/lang/Object;->toString()Ljava/lang/String;

move-result-object v6

invoke-virtual {v6, v1}, Ljava/lang/String;->charAt(I)C

move-result v6

if-eq v6, v10, :cond_12

invoke-virtual {p1}, Ljava/lang/Object;->toString()Ljava/lang/String;

move-result-object v6

invoke-virtual {v6, v1}, Ljava/lang/String;->charAt(I)C

move-result v6

const/16 v7, 0x28

if-eq v6, v7, :cond_12

.line 192
:cond_58
iget-object v6, p0, Lcom/android/mms/util/SmileyParser;->mSmileyToRes:Ljava/util/HashMap;

invoke-virtual {v2}, Ljava/util/regex/Matcher;->group()Ljava/lang/String;

move-result-object v7

invoke-virtual {v6, v7}, Ljava/util/HashMap;->get(Ljava/lang/Object;)Ljava/lang/Object;

move-result-object v6

check-cast v6, Ljava/lang/Integer;

invoke-virtual {v6}, Ljava/lang/Integer;->intValue()I

move-result v3

.line 193
.local v3, resId:I
new-instance v6, Landroid/text/style/ImageSpan;

iget-object v7, p0, Lcom/android/mms/util/SmileyParser;->mContext:Landroid/content/Context;

invoke-direct {v6, v7, v3}, Landroid/text/style/ImageSpan;-><init>(Landroid/content/Context;I)V

invoke-virtual {v2}, Ljava/util/regex/Matcher;->start()I

move-result v7

const/16 v8, 0x21

invoke-virtual {v0, v6, v7, v1, v8}, Landroid/text/SpannableStringBuilder;->setSpan(Ljava/lang/Object;III)V

goto :goto_12

.line 198
.end local v1 #end:I
.end local v3 #resId:I
.end local v4 #smileyText:Ljava/lang/CharSequence;
:cond_79
return-object v0
.end method

i hope, someone can help me.

APK File attached!

Kind regards.