好友
阅读权限 40
听众
最后登录 1970-1-1
芽衣
发表于 2021-7-18 12:15
本帖最后由 芽衣 于 2021-7-18 12:15 编辑
一个塔防游戏,原版下载地址:https://apkcombo.com/zh/king-of-defense-battle-frontier-merge-td/com.gcenter.kingofdefense.battle.frontier.td/
有机翻中文,勉强能看。
apk用mt管理器打开,然后新建一个类插入smali代码,再找到入口调用a方法就可以了。每次启动都会还原钻石数量。
Java:
package com;
import android.annotation.SuppressLint;
import android.content.Context;
import android.content.SharedPreferences.Editor;
import java.util.concurrent.atomic.AtomicReference;
public class mod {
private static final String b = "com.gcenter.kingofdefense.battle.frontier.td.v2.playerprefs";
private static final String c = "Gems";
private static final String e = "Crystals";
@SuppressLint("CommitPrefEdits")
public static void a(Context context) {
@SuppressLint("CommitPrefEdits") AtomicReference<Editor> d;
d = new AtomicReference<>(context.getSharedPreferences(b, 0).edit());
d.get().putInt(c, 666666);
d.get().putInt(e, 666666);
d.get().apply();
}
}
smali:
.class public Lcom/mod;
.super Ljava/lang/Object;
.source "mod.java"
# static fields
.field private static final b:Ljava/lang/String; = "com.gcenter.kingofdefense.battle.frontier.td.v2.playerprefs"
.field private static final c:Ljava/lang/String; = "Gems"
.field private static final e:Ljava/lang/String; = "Crystals"
# direct methods
.method public constructor <init>()V
.registers 1
.prologue
.line 9
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
return-void
.end method
.method public static a(Landroid/content/Context;)V
.registers 5
.param p0, "context" # Landroid/content/Context;
.annotation build Landroid/annotation/SuppressLint;
value = {
"CommitPrefEdits"
}
.end annotation
.prologue
const v3, 0xa2c2a
.line 18
new-instance v0, Ljava/util/concurrent/atomic/AtomicReference;
const-string v1, "com.gcenter.kingofdefense.battle.frontier.td.v2.playerprefs"
const/4 v2, 0x0
invoke-virtual {p0, v1, v2}, Landroid/content/Context;->getSharedPreferences(Ljava/lang/String;I)Landroid/content/SharedPreferences;
move-result-object v1
invoke-interface {v1}, Landroid/content/SharedPreferences;->edit()Landroid/content/SharedPreferences$Editor;
move-result-object v1
invoke-direct {v0, v1}, Ljava/util/concurrent/atomic/AtomicReference;-><init>(Ljava/lang/Object;)V
.line 19
.local v0, "d":Ljava/util/concurrent/atomic/AtomicReference;, "Ljava/util/concurrent/atomic/AtomicReference<Landroid/content/SharedPreferences$Editor;>;"
invoke-virtual {v0}, Ljava/util/concurrent/atomic/AtomicReference;->get()Ljava/lang/Object;
move-result-object v1
check-cast v1, Landroid/content/SharedPreferences$Editor;
const-string v2, "Gems"
invoke-interface {v1, v2, v3}, Landroid/content/SharedPreferences$Editor;->putInt(Ljava/lang/String;I)Landroid/content/SharedPreferences$Editor;
.line 20
invoke-virtual {v0}, Ljava/util/concurrent/atomic/AtomicReference;->get()Ljava/lang/Object;
move-result-object v1
check-cast v1, Landroid/content/SharedPreferences$Editor;
const-string v2, "Crystals"
invoke-interface {v1, v2, v3}, Landroid/content/SharedPreferences$Editor;->putInt(Ljava/lang/String;I)Landroid/content/SharedPreferences$Editor;
.line 21
invoke-virtual {v0}, Ljava/util/concurrent/atomic/AtomicReference;->get()Ljava/lang/Object;
move-result-object v1
check-cast v1, Landroid/content/SharedPreferences$Editor;
invoke-interface {v1}, Landroid/content/SharedPreferences$Editor;->apply()V
.line 22
return-void
.end method
效果图:
免费评分
查看全部评分
发帖前要善用【论坛搜索 】 功能,那里可能会有你要找的答案或者已经有人发布过相同内容了,请勿重复发帖。