Categories
Android

直接修改Market包显示支持收费软件,首页推荐软件

目前用MarketEnable,MarketAccess 之类的软件可以做到,但也有缺点:被修改apn,重启后无效。

大陆第三方ROM,一般都直接修改了电子市场包,观察一下安卓网自制的ROM,build.prop中都多了两行代码:

hiapk.vending.operator.name=T-Mobile
hiapk.vending.operator=310260

把运营商改为美国的。然后用

SystemProperties.get("hiapk.vending.operator.name");
SystemProperties.get("hiapk.vending.operator");

替换

TelephonyManager.getSimOperatorName();
TelephonyManager.getSimOperator()

下面是我修改的2.2.7版本的patch:

$ colordiff Vending_o/smali/com/android/vending/VendingApplication\$ApiClientContext.smali Vending/smali/com/android/vending/VendingApplication\$ApiClientContext.smali 
239,245c239
<     iget-object v2, p0, Lcom/android/vending/VendingApplication$ApiClientContext;->this$0:Lcom/android/vending/VendingApplication;
< 
<     invoke-static {v2}, Lcom/android/vending/VendingApplication;->access$100(Lcom/android/vending/VendingApplication;)Landroid/telephony/TelephonyManager;
< 
<     move-result-object v2
< 
<     invoke-virtual {v2}, Landroid/telephony/TelephonyManager;->getSimOperatorName()Ljava/lang/String;
---
>     const-string v2, "T-Mobile"
247c241
<     move-result-object v7
---
>     move-object/from16 v7, v2
259,265c253
<     iget-object v2, p0, Lcom/android/vending/VendingApplication$ApiClientContext;->this$0:Lcom/android/vending/VendingApplication;
< 
<     invoke-static {v2}, Lcom/android/vending/VendingApplication;->access$100(Lcom/android/vending/VendingApplication;)Landroid/telephony/TelephonyManager;
< 
<     move-result-object v2
< 
<     invoke-virtual {v2}, Landroid/telephony/TelephonyManager;->getSimOperator()Ljava/lang/String;
---
>     const-string v2, "310260"
267c255
<     move-result-object v9
---
>     move-object/from16 v9, v2

重新打包,签名即可。

If you enjoyed this post, make sure you subscribe to my RSS feed!

2 replies on “直接修改Market包显示支持收费软件,首页推荐软件”

I did a diff -r and it said this … diff -r unpatched patched .diff -r unpatched com android vending model DeviceConfigurationProto.smali patched com android vending model DeviceConfigurationProto.smali.43c43. .field public static final SCREEN LAYOUT SMALL I 0x2.diff -r unpatched com android vending model DeviceConfiguration ScreenLayoutSize.smali patched com android vending model DeviceConfiguration ScreenLayoutSize.smali.51c51. ….thank s lot…moneytoo5th July 2010 05 18 PMgetSystemAvailableFeatures returns only ….android.hardware.camera..android.hardware.camera.autofocus….while different phone returns…….android.hardware.camera..android.hardware.wifi..android.hardware.location.network..android.hardware.bluetooth..android.hardware.telephony..android.hardware.location..android.hardware.location.gps..android.hardware.camera.autofocus..android.hardware.telephony.gsm..android.hardware.touchscreen..android.hardware.touchscreen.multitouch..android.hardware.sensor.accelerometer..android.hardware.sensor.compass….I will fix one last issue and update the Market patch……svceon5th July 2010 05 48 PMim having trouble installing this apk could someone enlighten me up?…calimochoazucarado5th July 2010 05 50 PMim having trouble installing this apk could someone enlighten me up?..adb remount.adb push Vending.apk system app Vending.apk.adb reboot..Also take a look at the system etc permissions directory.

hi Monex: I know how to fix this. the SystemAvailableFeatures function reads all the xml file in /system/etc/permissions/ directory. If your phone has not the hardware features, you can fake it, just copy /frameworks/base/data/etc/* to your phone dir /system/etc/permissions/ hope it useful for you.

Leave a Reply to deli Cancel reply

Your email address will not be published. Required fields are marked *