[Android General] Abdullaharis:
Continued.

Third part

( TeleService.apk )

1.Decompile TeleService.apk

2.Downlaod breathingteleservice.zip from attachment. Extract and copy files to your decompiled TeleService

3.Recompile and Decompile TeleService (For ids)

4.Open TeleService\smali\com\android\phone\NotificationMgr.smali

find below method

.method updateMwi(ZLcom/android/internal/telephony/Phone;)V

replace whole method with this

.method updateMwi(ZLcom/android/internal/telephony/Phone;)V
.locals 29
.param p1, "visible" # Z
.param p2, "phone" # Lcom/android/internal/telephony/Phone;

.prologue
.line 290
invoke-interface/range {p2 .. p2}, Lcom/android/internal/telephony/Phone;->getPhoneId()I

move-result v13

.line 291
.local v13, "phoneId":I
sget-boolean v25, Lcom/android/phone/NotificationMgr;->DBG:Z

if-eqz v25, :cond_0

new-instance v25, Ljava/lang/StringBuilder;

invoke-direct/range {v25 .. v25}, Ljava/lang/StringBuilder;-><init>()V

const-string v26, "updateMwi(): "

invoke-virtual/range {v25 .. v26}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

move-result-object v25

move-object/from16 v0, v25

move/from16 v1, p1

invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Z)Ljava/lang/StringBuilder;

move-result-object v25

const-string v26, " phoneId = "

invoke-virtual/range {v25 .. v26}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

move-result-object v25

move-object/from16 v0, v25

invoke-virtual {v0, v13}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;

move-result-object v25

invoke-virtual/range {v25 .. v25}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

move-result-object v25

move-object/from16 v0, p0

move-object/from16 v1, v25

invoke-direct {v0, v1}, Lcom/android/phone/NotificationMgr;->log(Ljava/lang/String;)V

.line 292
:cond_0
const/16 v25, 0x3

move/from16 v0, v25

new-array v7, v0, [I

fill-array-data v7, :array_0

.line 296
.local v7, "mwiIcon":[I
const/16 v25, 0x3

move-object/from16 v0, p0

move/from16 v1, v25

invoke-direct {v0, v1, v13}, Lcom/android/phone/NotificationMgr;->getNotificationId(II)I

move-result v9

.line 298
.local v9, "notificationId":I
if-eqz p1, :cond_e

.line 299
move-object/from16 v0, p0

iget-object v0, v0, Lcom/android/phone/NotificationMgr;->mContext:Landroid/content/Context;

move-object/from16 v25, v0

invoke-virtual/range {v25 .. v25}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;

move-result-object v25

const-string v26, "gk_voicemail_breath"

const/16 v27, 0x0

invoke-static/range {v25 .. v27}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I

move-result v25

const/16 v26, 0x1

move/from16 v0, v25

move/from16 v1, v26

if-ne v0, v1, :cond_6

.line 301
const v15, 0x7f02003f

.line 305
.local v15, "resId":I
:goto_0
invoke-static {}, Lcom/android/phone/PhoneUtils;->isMultiSimEnabled()Z

move-result v25

if-eqz v25, :cond_1

.line 306
aget v15, v7, v13

.line 319
:cond_1
move-object/from16 v0, p0

iget-object v0, v0, Lcom/android/phone/NotificationMgr;->mContext:Landroid/content/Context;

move-object/from16 v25, v0

const v26, 0x7f0802e4

invoke-virtual/range {v25 .. v26}, Landroid/content/Context;->getString(I)Ljava/lang/String;

move-result-object v11

.line 320
.local v11, "notificationTitle":Ljava/lang/String;
invoke-interface/range {p2 .. p2}, Lcom/android/internal/telephony/Phone;->getVoiceMailNumber()Ljava/lang/String;

move-result-object v24

.line 321
.local v24, "vmNumber":Ljava/lang/String;
sget-boolean v25, Lcom/android/phone/NotificationMgr;->DBG:Z

if-eqz v25, :cond_2

new-instance v25, Ljava/lang/StringBuilder;

invoke-direct/range {v25 .. v25}, Ljava/lang/StringBuilder;-><init>()V

const-string v26, "- got vm number: \'"

invoke-virtual/range {v25 .. v26}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

move-result-object v25

move-object/from16 v0, v25

move-object/from16 v1, v24

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

move-result-object v25

const-string v26, "\'"

invoke-virtual/range {v25 .. v26}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

move-result-object v25

invoke-virtual/range {v25 .. v25}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

move-result-object v25

move-object/from16 v0, p0

move-object/from16 v1, v25

invoke-direct {v0, v1}, Lcom/android/phone/NotificationMgr;->log(Ljava/lang/String;)V

.line 338
:cond_2
if-nez v24, :cond_8

invoke-interface/range {p2 .. p2}, Lcom/android/internal/telephony/Phone;->getIccRecordsLoaded()Z

move-result v25

if-nez v25, :cond_8

.line 339
sget-boolean v25, Lcom/android/phone/NotificationMgr;->DBG:Z

if-eqz v25, :cond_3

const-string v25, "- Null vm number: SIM records not loaded (yet)..."

move-object/from16 v0, p0

move-object/from16 v1, v25

invoke-direct {v0, v1}, Lcom/android/phone/NotificationMgr;->log(Ljava/lang/String;)V

.line 352
:cond_3
move-object/from16 v0, p0

iget v0, v0, Lcom/android/phone/NotificationMgr;->mVmNumberRetriesRemaining:I

move/from16 v25, v0

add-int/lit8 v26, v25, -0x1

move/from16 v0, v26

move-object/from16 v1, p0

iput v0, v1, Lcom/android/phone/NotificationMgr;->mVmNumberRetriesRemaining:I

if-lez v25, :cond_7

.line 353
sget-boolean v25, Lcom/android/phone/NotificationMgr;->DBG:Z

if-eqz v25, :cond_4

const-string v25, " - Retrying in 10000 msec..."

move-object/from16 v0, p0

move-object/from16 v1, v25

invoke-direct {v0, v1}, Lcom/android/phone/NotificationMgr;->log(Ljava/lang/String;)V

.line 354
:cond_4
move-object/from16 v0, p0

iget-object v0, v0, Lcom/android/phone/NotificationMgr;->mApp:Lcom/android/phone/PhoneGlobals;

move-object/from16 v25, v0

move-object/from16 v0, v25

iget-object v0, v0, Lcom/android/phone/PhoneGlobals;->notifier:Lcom/android/phone/CallNotifier;

move-object/from16 v25, v0

const-wide/16 v26, 0x2710

move-object/from16 v0, v25

move-wide/from16 v1, v26

move-object/from16 v3, p2

invoke-virtual {v0, v1, v2, v3}, Lcom/android/phone/CallNotifier;->sendMwiChangedDelayed(JLcom/android/internal/telephony/Phone;)V

.line 428
.end local v11 # "notificationTitle":Ljava/lang/String;
.end local v15 # "resId":I
.end local v24 # "vmNumber":Ljava/lang/String;
:cond_5
:goto_1
return-void

.line 303
:cond_6
const v15, 0x108007e

.restart local v15 # "resId":I
goto/16 :goto_0

.line 357
.restart local v11 # "notificationTitle":Ljava/lang/String;
.restart local v24 # "vmNumber":Ljava/lang/String;
:cond_7
const-string v25, "NotificationMgr"

const-string v26, "NotificationMgr.updateMwi: getVoiceMailNumber() failed after 5 retries; giving up."

invoke-static/range {v25 .. v26}, Landroid/util/Log;->w(Ljava/lang/String;Ljava/lang/String;)I

.line 364
:cond_8
invoke-static/range {p2 .. p2}, Lcom/android/internal/telephony/TelephonyCapabilities;->supportsVoiceMessageCount(Lcom/android/internal/telephony/Phone;)Z

move-result v25

if-eqz v25, :cond_9

.line 365
invoke-interface/range {p2 .. p2}, Lcom/android/internal/telephony/Phone;->getVoiceMessageCount()I

move-result v23

.line 366
.local v23, "vmCount":I
move-object/from16 v0, p0

iget-object v0, v0, Lcom/android/phone/NotificationMgr;->mContext:Landroid/content/Context;

move-object/from16 v25, v0

const v26, 0x7f0802e5

invoke-virtual/range {v25 .. v26}, Landroid/content/Context;->getString(I)Ljava/lang/String;

move-result-object v17

.line 367
.local v17, "titleFormat":Ljava/lang/String;
const/16 v25, 0x1

move/from16 v0, v25

new-array v0, v0, [Ljava/lang/Object;

move-object/from16 v25, v0

const/16 v26, 0x0

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

move-result-object v27

aput-object v27, v25, v26

move-object/from16 v0, v17

move-object/from16 v1, v25

invoke-static {v0, v1}, Ljava/lang/String;->format(Ljava/lang/String;[Ljava/lang/Object;)Ljava/lang/String;

move-result-object v11

.line 371
.end local v17 # "titleFormat":Ljava/lang/String;
.end local v23 # "vmCount":I
:cond_9
invoke-static/range {v24 .. v24}, Landroid/text/TextUtils;->isEmpty(Ljava/lang/CharSequence;)Z

move-result v25

if-eqz v25, :cond_c

.line 372
move-object/from16 v0, p0

iget-object v0, v0, Lcom/android/phone/NotificationMgr;->mContext:Landroid/content/Context;

move-object/from16 v25, v0

const v26, 0x7f0802e7

invoke-virtual/range {v25 .. v26}, Landroid/content/Context;->getString(I)Ljava/lang/String;

move-result-object v10

.line 380
.local v10, "notificationText":Ljava/lang/String;
:goto_2
new-instance v6, Landroid/content/Intent;

const-string v25, "android.intent.action.CALL"

const-string v26, "voicemail"

const-string v27, ""

const/16 v28, 0x0

invoke-static/range {v26 .. v28}, Landroid/net/Uri;->fromParts(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)Landroid/net/Uri;

move-result-object v26

move-object/from16 v0, v25

move-object/from16 v1, v26

invoke-direct {v6, v0, v1}, Landroid/content/Intent;-><init>(Ljava/lang/String;Landroid/net/Uri;)V

.line 382
.local v6, "intent":Landroid/content/Intent;
move-object/from16 v0, p0

iget-object v0, v0, Lcom/android/phone/NotificationMgr;->mContext:Landroid/content/Context;

move-object/from16 v25, v0

const/16 v26, 0x0

const/16 v27, 0x0

move-object/from16 v0, v25

move/from16 v1, v26

move/from16 v2, v27

invoke-static {v0, v1, v6, v2}, Landroid/app/PendingIntent;->getActivity(Landroid/content/Context;ILandroid/content/Intent;I)Landroid/app/PendingIntent;

move-result-object v12

.line 384
.local v12, "pendingIntent":Landroid/app/PendingIntent;
move-object/from16 v0, p0

iget-object v0, v0, Lcom/android/phone/NotificationMgr;->mContext:Landroid/content/Context;

move-object/from16 v25, v0

invoke-static/range {v25 .. v25}, Landroid/preference/PreferenceManager;->getDefaultSharedPreferences(Landroid/content/Context;)Landroid/content/SharedPreferences;

move-result-object v14

.line 386
.local v14, "prefs":Landroid/content/SharedPreferences;
const-string v25, "button_voicemail_notification_ringtone_key"

const/16 v26, 0x0

move-object/from16 v0, v25

move-object/from16 v1, v26

invoke-interface {v14, v0, v1}, Landroid/content/SharedPreferences;->getString(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;

move-result-object v18

.line 388
.local v18, "uriString":Ljava/lang/String;
invoke-static/range {v18 .. v18}, Landroid/text/TextUtils;->isEmpty(Ljava/lang/CharSequence;)Z

move-result v25

if-nez v25, :cond_d

.line 389
invoke-static/range {v18 .. v18}, Landroid/net/Uri;->parse(Ljava/lang/String;)Landroid/net/Uri;

move-result-object v16

.line 394
.local v16, "ringtoneUri":Landroid/net/Uri;
:goto_3
new-instance v4, Landroid/app/Notification$Builder;

move-object/from16 v0, p0

iget-object v0, v0, Lcom/android/phone/NotificationMgr;->mContext:Landroid/content/Context;

move-object/from16 v25, v0

move-object/from16 v0, v25

invoke-direct {v4, v0}, Landroid/app/Notification$Builder;-><init>(Landroid/content/Context;)V

.line 395
.local v4, "builder":Landroid/app/Notification$Builder;
invoke-virtual {v4, v15}, Landroid/app/Notification$Builder;->setSmallIcon(I)Landroid/app/Notification$Builder;

move-result-object v25

invoke-static {}, Ljava/lang/System;->currentTimeMillis()J

move-result-wide v26

invoke-virtual/range {v25 .. v27}, Landroid/app/Notification$Builder;->setWhen(J)Landroid/app/Notification$Builder;

move-result-object v25

move-object/from16 v0, v25

invoke-virtual {v0, v11}, Landroid/app/Notification$Builder;->setContentTitle(Ljava/lang/CharSequence;)Landroid/app/Notification$Builder;

move-result-object v25

move-object/from16 v0, v25

invoke-virtual {v0, v10}, Landroid/app/Notification$Builder;->setContentText(Ljava/lang/CharSequence;)Landroid/app/Notification$Builder;

move-result-object v25

move-object/from16 v0, v25

invoke-virtual {v0, v12}, Landroid/app/Notification$Builder;->setContentIntent(Landroid/app/PendingIntent;)Landroid/app/Notification$Builder;

move-result-object v25

move-object/from16 v0, v25

move-object/from16 v1, v16

invoke-virtual {v0, v1}, Landroid/app/Notification$Builder;->setSound(Landroid/net/Uri;)Landroid/app/Notification$Builder;

move-result-object v25

move-object/from16 v0, p0

iget-object v0, v0, Lcom/android/phone/NotificationMgr;->mContext:Landroid/content/Context;

move-object/from16 v26, v0

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

move-result-object v26

const/high16 v27, 0x7f0b0000

invoke-virtual/range {v26 .. v27}, Landroid/content/res/Resources;->getColor(I)I

move-result v26

invoke-virtual/range {v25 .. v26}, Landroid/app/Notification$Builder;->setColor(I)Landroid/app/Notification$Builder;

move-result-object v25

const/16 v26, 0x0

invoke-virtual/range {v25 .. v26}, Landroid/app/Notification$Builder;->setOngoing(Z)Landroid/app/Notification$Builder;

.line 404
invoke-static {v14, v13}, Lcom/android/phone/CallFeaturesSetting;->migrateVoicemailVibrationSettingsIfNeeded(Landroid/content/SharedPreferences;I)Z

.line 405
const-string v25, "button_voicemail_notification_vibrate_key"

const/16 v26, 0x0

move-object/from16 v0, v25

move/from16 v1, v26

invoke-interface {v14, v0, v1}, Landroid/content/SharedPreferences;->getBoolean(Ljava/lang/String;Z)Z

move-result v22

.line 407
.local v22, "vibrate":Z
if-eqz v22, :cond_a

.line 408
const/16 v25, 0x2

move/from16 v0, v25

invoke-virtual {v4, v0}, Landroid/app/Notification$Builder;->setDefaults(I)Landroid/app/Notification$Builder;

.line 411
:cond_a
invoke-virtual {v4}, Landroid/app/Notification$Builder;->build()Landroid/app/Notification;

move-result-object v8

.line 412
.local v8, "notification":Landroid/app/Notification;
move-object/from16 v0, p0

iget-object v0, v0, Lcom/android/phone/NotificationMgr;->mUserManager:Landroid/os/UserManager;

move-object/from16 v25, v0

const/16 v26, 0x1

invoke-virtual/range {v25 .. v26}, Landroid/os/UserManager;->getUsers(Z)Ljava/util/List;

move-result-object v21

.line 413
.local v21, "users":Ljava/util/List;, "Ljava/util/List<Landroid/content/pm/UserInfo;>;"
const/4 v5, 0x0

.local v5, "i":I
:goto_4
invoke-interface/range {v21 .. v21}, Ljava/util/List;->size()I

move-result v25

move/from16 v0, v25

if-ge v5, v0, :cond_5

.line 414
move-object/from16 v0, v21

invoke-interface {v0, v5}, Ljava/util/List;->get(I)Ljava/lang/Object;

move-result-object v19

check-cast v19, Landroid/content/pm/UserInfo;

.line 415
.local v19, "user":Landroid/content/pm/UserInfo;
invoke-virtual/range {v19 .. v19}, Landroid/content/pm/UserInfo;->getUserHandle()Landroid/os/UserHandle;

move-result-object v20

.line 416
.local v20, "userHandle":Landroid/os/UserHandle;
move-object/from16 v0, p0

iget-object v0, v0, Lcom/android/phone/NotificationMgr;->mUserManager:Landroid/os/UserManager;

move-object/from16 v25, v0

const-string v26, "no_outgoing_calls"

move-object/from16 v0, v25

move-object/from16 v1, v26

move-object/from16 v2, v20

invoke-virtual {v0, v1, v2}, Landroid/os/UserManager;->hasUserRestriction(Ljava/lang/String;Landroid/os/UserHandle;)Z

move-result v25

if-nez v25, :cond_b

invoke-virtual/range {v19 .. v19}, Landroid/content/pm/UserInfo;->isManagedProfile()Z

move-result v25

if-nez v25, :cond_b

.line 419
move-object/from16 v0, p0

iget-object v0, v0, Lcom/android/phone/NotificationMgr;->mContext:Landroid/content/Context;

move-object/from16 v25, v0

move-object/from16 v0, v25

invoke-static {v0, v8}, Lcom/android/phone/NotificationMgr;->configureLedNotification(Landroid/content/Context;Landroid/app/Notification;)V

.line 420
move-object/from16 v0, p0

iget-object v0, v0, Lcom/android/phone/NotificationMgr;->mNotificationManager:Landroid/app/NotificationManager;

move-object/from16 v25, v0

const/16 v26, 0x0

move-object/from16 v0, v25

move-object/from16 v1, v26

move-object/from16 v2, v20

invoke-virtual {v0, v1, v9, v8, v2}, Landroid/app/NotificationManager;->notifyAsUser(Ljava/lang/String;ILandroid/app/Notification;Landroid/os/UserHandle;)V

.line 413
:cond_b
add-int/lit8 v5, v5, 0x1

goto :goto_4

.line 375
.end local v4 # "builder":Landroid/app/Notification$Builder;
.end local v5 # "i":I
.end local v6 # "intent":Landroid/content/Intent;
.end local v8 # "notification":Landroid/app/Notification;
.end local v10 # "notificationText":Ljava/lang/String;
.end local v12 # "pendingIntent":Landroid/app/PendingIntent;
.end local v14 # "prefs":Landroid/content/SharedPreferences;
.end local v16 # "ringtoneUri":Landroid/net/Uri;
.end local v18 # "uriString":Ljava/lang/String;
.end local v19 # "user":Landroid/content/pm/UserInfo;
.end local v20 # "userHandle":Landroid/os/UserHandle;
.end local v21 # "users":Ljava/util/List;, "Ljava/util/List<Landroid/content/pm/UserInfo;>;"
.end local v22 # "vibrate":Z
:cond_c
move-object/from16 v0, p0

iget-object v0, v0, Lcom/android/phone/NotificationMgr;->mContext:Landroid/content/Context;

move-object/from16 v25, v0

const v26, 0x7f0802e6

invoke-virtual/range {v25 .. v26}, Landroid/content/Context;->getString(I)Ljava/lang/String;

move-result-object v25

const/16 v26, 0x1

move/from16 v0, v26

new-array v0, v0, [Ljava/lang/Object;

move-object/from16 v26, v0

const/16 v27, 0x0

invoke-static/range {v24 .. v24}, Landroid/telephony/PhoneNumberUtils;->formatNumber(Ljava/lang/String;)Ljava/lang/String;

move-result-object v28

aput-object v28, v26, v27

invoke-static/range {v25 .. v26}, Ljava/lang/String;->format(Ljava/lang/String;[Ljava/lang/Object;)Ljava/lang/String;

move-result-object v10

.restart local v10 # "notificationText":Ljava/lang/String;
goto/16 :goto_2

.line 391
.restart local v6 # "intent":Landroid/content/Intent;
.restart local v12 # "pendingIntent":Landroid/app/PendingIntent;
.restart local v14 # "prefs":Landroid/content/SharedPreferences;
.restart local v18 # "uriString":Ljava/lang/String;
:cond_d
sget-object v16, Landroid/provider/Settings$System;->DEFAULT_NOTIFICATION_URI:Landroid/net/Uri;

.restart local v16 # "ringtoneUri":Landroid/net/Uri;
goto/16 :goto_3

.line 425
.end local v6 # "intent":Landroid/content/Intent;
.end local v10 # "notificationText":Ljava/lang/String;
.end local v11 # "notificationTitle":Ljava/lang/String;
.end local v12 # "pendingIntent":Landroid/app/PendingIntent;
.end local v14 # "prefs":Landroid/content/SharedPreferences;
.end local v15 # "resId":I
.end local v16 # "ringtoneUri":Landroid/net/Uri;
.end local v18 # "uriString":Ljava/lang/String;
.end local v24 # "vmNumber":Ljava/lang/String;
:cond_e
move-object/from16 v0, p0

iget-object v0, v0, Lcom/android/phone/NotificationMgr;->mNotificationManager:Landroid/app/NotificationManager;

move-object/from16 v25, v0

const/16 v26, 0x0

sget-object v27, Landroid/os/UserHandle;->ALL:Landroid/os/UserHandle;

move-object/from16 v0, v25

move-object/from16 v1, v26

move-object/from16 v2, v27

invoke-virtual {v0, v1, v9, v2}, Landroid/app/NotificationManager;->cancelAsUser(Ljava/lang/String;ILandroid/os/UserHandle;)V

goto/16 :goto_1

.line 292
:array_0
.array-data 4
0x7f020040
0x7f020041
0x7f020042
.end array-data
.end method

find and replace id's

5.Compile TeleService and move to your device

Continued on next post