设为首页收藏本站

移动叔叔

搜索
查看: 2194|回复: 0
打印 上一主题 下一主题

android 4.0 原生归属地显示

[复制链接]
跳转到指定楼层
楼主
发表于 2012-7-25 00:25:36 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
使用到工具baksmali及smali(查自行下载这两个工具)
classes.dex 为 Phone.apk提取

java -jar baksmali-1.3.jar -o Phone classes.dex

java -jar baksmali-1.3.jar -o Phone  -x Phone.odex
在Phone目录下得到smail文件
找com\android\phone\CallCard.smali

添加一个方法,用于显示及修改原有联系人去电不查询归属地逻辑

  • .method private setGeoDescription(Lcom/android/internal/telephony/CallerInfo;)V
  •     .locals 3
  •     .parameter "info"
  •     .prologue
  •     const/16 v2, 0x8
  •     .line 36
  •     if-nez p1, :cond_1
  •     .line 51
  •     :cond_0
  •     :goto_0
  •     return-void
  •     .line 38
  •     :cond_1
  •     iget-object v0, p0, Lcom/android/phone/CallCard;->mCallTypeLabelandroid/widget/TextView;
  •     invoke-virtual {v0}, Landroid/widget/TextView;->getVisibility()I
  •     move-result v0
  •     if-ne v0, v2, :cond_0
  •     .line 39
  •     iget-object v0, p1, Lcom/android/internal/telephony/CallerInfo;->geoDescriptionjava/lang/String;
  •     invoke-static {v0}, Landroid/text/TextUtils;->isEmpty(Ljava/lang/CharSequence;)Z
  •     move-result v0
  •     if-eqz v0, :cond_2
  •     .line 40
  •     invoke-virtual {p0}, Lcom/android/phone/CallCard;->getContext()Landroid/content/Context;
  •     move-result-object v0
  •     iget-object v1, p1, Lcom/android/internal/telephony/CallerInfo;->phoneNumberjava/lang/String;
  •     invoke-virtual {p1, v0, v1}, Lcom/android/internal/telephony/CallerInfo;->updateGeoDescription(Landroid/content/Context;Ljava/lang/String;)V
  •     .line 42
  •     :cond_2
  •     iget-object v0, p1, Lcom/android/internal/telephony/CallerInfo;->geoDescriptionjava/lang/String;
  •     invoke-static {v0}, Landroid/text/TextUtils;->isEmpty(Ljava/lang/CharSequence;)Z
  •     move-result v0
  •     if-nez v0, :cond_0
  •     .line 43
  •     iget-object v0, p0, Lcom/android/phone/CallCard;->mCallTypeLabelandroid/widget/TextView;
  •     const/4 v1, 0x0
  •     invoke-virtual {v0, v1}, Landroid/widget/TextView;->setVisibility(I)V
  •     .line 44
  •     iget-object v0, p0, Lcom/android/phone/CallCard;->mCallTypeLabelandroid/widget/TextView;
  •     iget-object v1, p1, Lcom/android/internal/telephony/CallerInfo;->geoDescriptionjava/lang/String;
  •     invoke-virtual {v0, v1}, Landroid/widget/TextView;->setText(Ljava/lang/CharSequence;)V
  •     .line 45
  •     iget-object v0, p0, Lcom/android/phone/CallCard;->mCallTypeLabelandroid/widget/TextView;
  •     iget v1, p0, Lcom/android/phone/CallCard;->mTextColorCallTypeSip:I
  •     invoke-virtual {v0, v1}, Landroid/widget/TextView;->setTextColor(I)V
  •     .line 46
  •     iget-object v0, p1, Lcom/android/internal/telephony/CallerInfo;->geoDescriptionjava/lang/String;
  •     iget-object v1, p0, Lcom/android/phone/CallCard;->mPhoneNumberandroid/widget/TextView;
  •     invoke-virtual {v1}, Landroid/widget/TextView;->getText()Ljava/lang/CharSequence;
  •     move-result-object v1
  •     invoke-virtual {v0, v1}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
  •     move-result v0
  •     if-eqz v0, :cond_0
  •     .line 47
  •     iget-object v0, p0, Lcom/android/phone/CallCard;->mPhoneNumber:Landroid/widget/TextView;
  •     invoke-virtual {v0, v2}, Landroid/widget/TextView;->setVisibility(I)V
  •     goto :goto_0
  • .end method

复制代码
------在updateDisplayForPerson中添加调用 (可能各自反编译的smali变量名不一样,自行找关键字updateSocialStatus)
查找类似:

  • invoke-direct {p0, v14, v13, v0}, Lcom/android/phone/CallCard;->updateSocialStatus(Ljava/lang/String;Landroid/graphics/drawable/Drawable;Lcom/android/internal/telephony/Call;)V

复制代码
后添加两句

  •         move-object/from16 v0, p1
  •         invoke-direct {p0, v0}, Lcom/android/phone/CallCard;->setGeoDescription(Lcom/android/internal/telephony/CallerInfo;)V

复制代码
如果你的手机找到是类似或提示All register args must fit in 4 bits:

  • invoke-direct {v0, v1, v2, v3}, Lcom/android/phone/CallCard;->updateSocialStatus(Ljava/lang/String;Landroid/graphics/drawable/Drawable;Lcom/android/internal/telephony/Call;)V

复制代码
将上面两句改成:

  • invoke-direct/range {p0 .. p1}, Lcom/android/phone/CallCard;->setGeoDescription(Lcom/android/internal/telephony/CallerInfo;)V

复制代码
祝好运!!

再java -jar smali-1.3.jar Phone -o classes.dex

用zip软件拖回原来的Phone.apk ,替换手机的Phone.apk 修改权限,重启即可
原帖http://bbs.gfan.com/android-3513449-1-1.html
我一直没成功,哪位大侠给做一下呗,谢谢!
您需要登录后才可以回帖 登录 | 注册

© 2008-2025 移动叔叔. 版权所有,专业的网络售后平台 ( 闽ICP备18006692号-3 )

商务合作点击这里给我发消息|Email:service@mobileuncle.com|手机版|移动叔叔     

GMT+8, 2025-1-7 14:52 , Processed in 0.137918 second(s), 12 queries , Gzip On, Memcache On.

返回顶部