Categories
Android

解决电子市场 3.13版本 “您的设备与此商品不兼容”的问题

Android market: Your device is not compatible with this item


用 apktool 1.4.1 反编译Vending.apk 3.1.3版本,遇到错误,无法插入调试信息再打包重新安装。搜索反编译后的文件查找信息:

您的设备与此商品不兼容。

smali/com/android/vending/R$string.smali:.field public static final availability_restriction_hardware:I = 0x7f080191

deli@deli-laptop:~/Desktop/a/Vending$ grep 0x7f080191 * -r
smali/com/google/android/finsky/activities/DetailsAvailabilityRestrictionViewBinder.smali: const v3, 0x7f080191

猜出大概代码:

public bind(View view, Document document, int iconWidth, int iconRightMargin, DfeToc toc) {

	TextView reason = view.findViewById(R.id.restriction_reason);
	int restriction = document.getAvailabilityRestriction();

	switch (restriction) {
	case 4:
		reason.setText(R.string.availability_restriction_hardware);
		break;
	}
}

public int getAvailabilityRestriction() {
	boolean hasAvailability = mFinskyDoc.hasAvailability();
	if (hasAvailability) {
		int restriction = mFinskyDoc.getAvailability().getRestriction();
		reutrn restriction;
	}

	return -1;
}

restriction的值是通过 setRestriction 设置,读取protobuf数据,也没弄清楚,因为无法插入调试信息。发现3.1.3版本比以前版本复杂多了。

最后发现

  deli@deli-laptop:~$ diff build.prop build.prop~
  31c31
  < ro.build.fingerprint=N708_800_600/broncho_N708/N708_800_600/:2.2/FRF91/user.N708_800_600.20110917.133140:user/test-keys
  ---
  > ro.build.fingerprint=N708/broncho_N708/N708_800_600/:2.2/FRF91/user.N708_800_600.20110917.133140:user/test-keys

ro.build.fingerprint=N708,N708这个是我们的项目名,临时修改编译脚本成N708_800_600,出现下划线,导致被google过滤掉了。搞第三方ROM的,注意了,别随意修改系统参数,除非你真的明白你在干啥东东。

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

4 replies on “解决电子市场 3.13版本 “您的设备与此商品不兼容”的问题”

你写的文章无关的东西太多,导致我看我根本不知道解决方法是怎样做,你应该统一整理一下解决的信息,而不是写你杨sir的屁事

Leave a Reply to yaocong Cancel reply

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