小仓鼠的生活(去广告+购买金币加钻石修改)
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.找到一个BuyCoin CoinShop ,修改这文件就可以达到了。
4.需要下载reflexil.1.9插件进行修改
public void BuyCoin(DiamondShop.DiamondInfo diamondInfo){ this.buySuccessWindow.text = LocalizationCustom.Get("638", LocalizationCustom.LocalizeType.Normal); if (SaveData.instance.data.diamondPoint >= [url=]diamondInfo[/url].valueJP) ------白话:当你身上的钻石大于等于购买商品的钻石时 { SaveData.instance.data.diamondPoint -= [url=]diamondInfo[/url].valueJP; 身上的钻石-商品钻石价格 SaveData.instance.data.coinNum += [url=]diamondInfo[/url].num; this.buySuccessWindow.openFlag = true; BuyDiamondWindow.SendUserItemsData(1, 0, 0, [url=]diamondInfo[/url].num, SaveData.instance.data.coinNum - [url=]diamondInfo[/url].num, SaveData.instance.data.coinNum, [url=]diamondInfo[/url].valueJP, SaveData.instance.data.diamondPoint + [url=]diamondInfo[/url].valueJP, SaveData.instance.data.diamondPoint); MainManager.instance.PlaySound(MainManager.SoundType.CashExchange); 下面就是扣除钻石了 |
我的方法就是删除判断达到即使你钻石不够也可以进行购买,但购买后你的钻石会是负数,因此我又修改下面代码。
把扣除钻石改成增加钻石。
修改完后替换原来的DLL文件,游戏重新签名就可以了
方法结束。
附镇文图两张:
[caption id="" align="alignnone" width="324"]
[caption id="" align="alignnone" width="324"]