|
使用到工具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
我一直没成功,哪位大侠给做一下呗,谢谢! |
|