小仓鼠的生活(去广告+购买金币加钻石修改)
TO:想了解安卓游戏修改的人(大神请路过),因为游戏是我自己玩所以不想修改太变态什么都无限,需要金币和钻石的时候购买一下。
首先说说去广告吧。
游戏是谷歌应用商店的游戏,带的广告为谷歌广告底部横条广告,所以这方法可以去除大部分谷歌游戏广告。
1.打开killer,搜索AndroidManifest.xml搜索到--- const-string v4, "Missing internet permission in AndroidManifest.xml."
2.进入后下面的是执行广告的代码,我修改方法就是直接让代码结束,修改的部分是下面#部分
.method protected zzaV()Z
.locals 6
const/4 v1, 0x0 #const/4 v1, 0x0那v1修改成v0
return v0 #这是我自己添加进去的,原本的没有,直接返回V0
const/4 v0, 0x1
invoke-static {}, Lcom/google/android/gms/ads/internal/zzr;->zzbC()Lcom/google/android/gms/internal/zzir;
move-result-object v2
iget-object v3, p0, Lcom/google/android/gms/ads/internal/zzf;->zzpj:Lcom/google/android/gms/ads/internal/zzs;
iget-object v3, v3, Lcom/google/android/gms/ads/internal/zzs;->context:Landroid/content/Context;
invoke-virtual {v3}, Landroid/content/Context;->getPackageManager()Landroid/content/pm/PackageManager;
move-result-object v3
iget-object v4, p0, Lcom/google/android/gms/ads/internal/zzf;->zzpj:Lcom/google/android/gms/ads/internal/zzs;
iget-object v4, v4, Lcom/google/android/gms/ads/internal/zzs;->context:Landroid/content/Context;
invoke-virtual {v4}, Landroid/content/Context;->getPackageName()Ljava/lang/String;
move-result-object v4
const-string v5, "android.permission.INTERNET"
invoke-virtual {v2, v3, v4, v5}, Lcom/google/android/gms/internal/zzir;->zza(Landroid/content/pm/PackageManager;Ljava/lang/String;Ljava/lang/String;)Z
move-result v2
if-nez v2, :cond_0
invoke-static {}, Lcom/google/android/gms/ads/internal/client/zzn;->zzcS()Lcom/google/android/gms/ads/internal/util/client/zza;
move-result-object v0
iget-object v2, p0, Lcom/google/android/gms/ads/internal/zzf;->zzpj:Lcom/google/android/gms/ads/internal/zzs;
iget-object v2, v2, Lcom/google/android/gms/ads/internal/zzs;->zzrm:Lcom/google/android/gms/ads/internal/zzs$zza;
iget-object v3, p0, Lcom/google/android/gms/ads/internal/zzf;->zzpj:Lcom/google/android/gms/ads/internal/zzs;
iget-object v3, v3, Lcom/google/android/gms/ads/internal/zzs;->zzrp:Lcom/google/android/gms/ads/internal/client/AdSizeParcel;
const-string v4, "Missing internet permission in AndroidManifest.xml."
const-string v5, "Missing internet permission in AndroidManifest.xml. You must have the following declaration: <uses-permission android:name=\"android.permission.INTERNET\" />"
invoke-virtual {v0, v2, v3, v4, v5}, Lcom/google/android/gms/ads/internal/util/client/zza;->zza(Landroid/view/ViewGroup;Lcom/google/android/gms/ads/internal/client/AdSizeParcel;Ljava/lang/String;Ljava/lang/String;)V
move v0, v1
:cond_0
invoke-static {}, Lcom/google/android/gms/ads/internal/zzr;->zzbC()Lcom/google/android/gms/internal/zzir;
move-result-object v2
iget-object v3, p0, Lcom/google/android/gms/ads/internal/zzf;->zzpj:Lcom/google/android/gms/ads/internal/zzs;
iget-object v3, v3, Lcom/google/android/gms/ads/internal/zzs;->context:Landroid/content/Context;
invoke-virtual {v2, v3}, Lcom/google/android/gms/internal/zzir;->zzI(Landroid/content/Context;)Z
move-result v2
if-nez v2, :cond_1
invoke-static {}, Lcom/google/android/gms/ads/internal/client/zzn;->zzcS()Lcom/google/android/gms/ads/internal/util/client/zza;
move-result-object v0
iget-object v2, p0, Lcom/google/android/gms/ads/internal/zzf;->zzpj:Lcom/google/android/gms/ads/internal/zzs;
iget-object v2, v2, Lcom/google/android/gms/ads/internal/zzs;->zzrm:Lcom/google/android/gms/ads/internal/zzs$zza;
iget-object v3, p0, Lcom/google/android/gms/ads/internal/zzf;->zzpj:Lcom/google/android/gms/ads/internal/zzs;
iget-object v3, v3, Lcom/google/android/gms/ads/internal/zzs;->zzrp:Lcom/google/android/gms/ads/internal/client/AdSizeParcel;
const-string v4, "Missing AdActivity with android:configChanges in AndroidManifest.xml."
const-string v5, "Missing AdActivity with android:configChanges in AndroidManifest.xml. You must have the following declaration within the <application> element: <activity android:name=\"com.google.android.gms.ads.AdActivity\" android:configChanges=\"keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize\" />"
invoke-virtual {v0, v2, v3, v4, v5}, Lcom/google/android/gms/ads/internal/util/client/zza;->zza(Landroid/view/ViewGroup;Lcom/google/android/gms/ads/internal/client/AdSizeParcel;Ljava/lang/String;Ljava/lang/String;)V
move v0, v1
:cond_1
if-nez v0, :cond_2
iget-object v2, p0, Lcom/google/android/gms/ads/internal/zzf;->zzpj:Lcom/google/android/gms/ads/internal/zzs;
iget-object v2, v2, Lcom/google/android/gms/ads/internal/zzs;->zzrm:Lcom/google/android/gms/ads/internal/zzs$zza;
if-eqz v2, :cond_2
iget-object v2, p0, Lcom/google/android/gms/ads/internal/zzf;->zzpj:Lcom/google/android/gms/ads/internal/zzs;
iget-object v2, v2, Lcom/google/android/gms/ads/internal/zzs;->zzrm:Lcom/google/android/gms/ads/internal/zzs$zza;
invoke-virtual {v2, v1}, Lcom/google/android/gms/ads/internal/zzs$zza;->setVisibility(I)V
:cond_2
return v0
.end method
接下来说下购买金币增加钻石的方法--修改DLL文件。
1.把游戏的DLL文件解压到另一个文件夹里面,路径:小仓鼠的生活.apk\assets\bin\Data\Managed
2.解压好友把所有的dll文件放入.net reflector软件搜索(放大镜按钮)coin,搜索方式为search member(快捷键ctrl+m)
3.找到一个BuyCoinCoinShop,修改这文件就可以达到了。
4.需要下载reflexil.1.9插件进行修改
public void BuyCoin(DiamondShop.DiamondInfo diamondInfo){ this.buySuccessWindow.text = LocalizationCustom.Get("638", LocalizationCustom.LocalizeType.Normal); if (SaveData.instance.data.diamondPoint >= diamondInfo.valueJP) ------白话:当你身上的钻石大于等于购买商品的钻石时 { SaveData.instance.data.diamondPoint -= diamondInfo.valueJP; 身上的钻石-商品钻石价格 SaveData.instance.data.coinNum += diamondInfo.num; this.buySuccessWindow.openFlag = true; BuyDiamondWindow.SendUserItemsData(1, 0, 0, diamondInfo.num, SaveData.instance.data.coinNum - diamondInfo.num, SaveData.instance.data.coinNum, diamondInfo.valueJP, SaveData.instance.data.diamondPoint + diamondInfo.valueJP, SaveData.instance.data.diamondPoint); MainManager.instance.PlaySound(MainManager.SoundType.CashExchange); 下面就是扣除钻石了
http://attach.52pojie.cn/album/201609/28/095221whmnymdmxxgxjdpl.png
我的方法就是删除判断达到即使你钻石不够也可以进行购买,但购买后你的钻石会是负数,因此我又修改下面代码。
把扣除钻石改成增加钻石。
修改完后替换原来的DLL文件,游戏重新签名就可以了
方法结束。
van_jason 发表于 2016-12-5 19:51
连接WiFi就有广告弹窗,不连接就不弹广告,,怎么破?
链接:http://pan.baidu.com/s/1jHY1JHc 密码:8kyk
貌似去除联网权限就行了!
但去除联网权限有几率造成游戏闪退!
建议幸运一下! 看了你这个帖子感悟很大
但是我按照你的思路改了一遍之后发现 购买金币 钻石成负数
请问大神 修改哪段代码能解决钻石变成负数? 支持一下!!!! 楼主最好 apk加上版本信息或者提供链接 感谢分享,学习下 支持一下
要是能附带上软件就更好了 支持一下 非常感谢,又学到了一招。 感谢分享,过来支持一下! 好的,有些难操作{:1_937:}
页:
[1]
2