HTC 官方来电归属地加入教程(适用于Sense 3.6 /4.0 / 4.1)
这个最初是用在Sense4上面的,后来发现3.6也能用,3.0之类的就不知道了。HTC比较懒,3.6和4.0中这部分代码是一样的^^
原理是修改HTCExtension里面的一个已经写好的获得归属地信息的代码段,改一个布尔变量就行了,估计是那个"开关"吧,呵呵。
解包过程依旧不赘述,补充锁屏来电归属地修改
一、Idlescreen_Base.apk修改:
com\htc\idlescreen\base\reminderview\IncomingCallView.smali
找到: Lcom/htc/lockscreen/telephony/PhoneState;->mLocation:Ljava/lang/String;
在上一句的下面加入
继续往下找到 Lcom/htc/lockscreen/telephony/PhoneState;->mEventDesp:Ljava/lang/String;
在这一句的下面两行中间加入
以下为修改完成的
到这里锁屏修改完,打包进行替换
二、HTCExtension.jar修改
这个最初是用在Sense4上面的,后来发现3.6也能用,3.0之类的就不知道了。HTC比较懒,3.6和4.0中这部分代码是一样的^^
原理是修改HTCExtension里面的一个已经写好的获得归属地信息的代码段,改一个布尔变量就行了,估计是那个"开关"吧,呵呵。
解包过程依旧不赘述,补充锁屏来电归属地修改
一、Idlescreen_Base.apk修改:
com\htc\idlescreen\base\reminderview\IncomingCallView.smali
找到: Lcom/htc/lockscreen/telephony/PhoneState;->mLocation:Ljava/lang/String;
在上一句的下面加入
move-object/from16 v0, p0
iget-object v0, v0, Lcom/htc/idlescreen/base/reminderview/IncomingCallView;->mContext:Landroid/content/Context;
.local v1, info:Lcom/htc/util/phone/CityIdInfo;
new-instance v1, Lcom/htc/util/phone/CityIdInfo;
invoke-direct {v1}, Lcom/htc/util/phone/CityIdInfo;-><init>()V
const/4 v2, 0x0
invoke-virtual {v1, v0, v12, v2}, Lcom/htc/util/phone/CityIdInfo;->doLookup(Landroid/content/Context;Ljava/lang/CharSequence;Z)V
invoke-static {v2, v1}, Lcom/htc/util/phone/CityIdInfo;->getCityIdDisplay(Landroid/widget/TextView;Lcom/htc/util/phone/CityIdInfo;)Ljava/lang/String;
move-result-object v9
继续往下找到 Lcom/htc/lockscreen/telephony/PhoneState;->mEventDesp:Ljava/lang/String;
在这一句的下面两行中间加入
.end local v1 #info:Lcom/htc/util/phone/CityIdInfo;
以下为修改完成的
.line 203
move-object/from16 v0, v16
iget-object v9, v0, Lcom/htc/lockscreen/telephony/PhoneState;->mLocation:Ljava/lang/String;
move-object/from16 v0, p0
iget-object v0, v0, Lcom/htc/idlescreen/base/reminderview/IncomingCallView;->mContext:Landroid/content/Context;
.local v1, info:Lcom/htc/util/phone/CityIdInfo;
new-instance v1, Lcom/htc/util/phone/CityIdInfo;
invoke-direct {v1}, Lcom/htc/util/phone/CityIdInfo;-><init>()V
const/4 v2, 0x0
invoke-virtual {v1, v0, v12, v2}, Lcom/htc/util/phone/CityIdInfo;->doLookup(Landroid/content/Context;Ljava/lang/CharSequence;Z)V
invoke-static {v2, v1}, Lcom/htc/util/phone/CityIdInfo;->getCityIdDisplay(Landroid/widget/TextView;Lcom/htc/util/phone/CityIdInfo;)Ljava/lang/String;
move-result-object v9
.line 204
.end local v1 #info:Lcom/htc/util/phone/CityIdInfo;
move-object/from16 v0, v16
到这里锁屏修改完,打包进行替换
二、HTCExtension.jar修改
路径 com\htc\util\phone\CityIdInfo.smali
找到sput-boolean v0, Lcom/htc/util/phone/CityIdInfo;->CALL_LOCATION:Z
官方默认为V0 把0改为2
向下找到sput-boolean v0, Lcom/htc/util/phone/CityIdInfo;->EXCEPTION_PROJECTS:Z
官方默认为V0 把0改为1
现在,大家就可以拥有官方的来电归属地了。
红色部分为修改锁屏来电归属地的。