Files
myrzx_bot/analysis/API_INVENTORY.md
T

32 KiB
Raw Blame History

牧羊人之心客户端接口清单

生成日期:2026-11-07。来源:用户提供的 1.9.68 APK 留存反编译代码。

发现 116 个游戏侧路径,其中 115 个找到实际 send 调用;另列 13 种渠道 SDK 调用方式。 主体依据客户端静态证据,用途根据调用方法、参数和回调推定。账号验证、中心登录、进入区服和角色读取已由用户实测成功;其他接口未做官方实服验证。

阅读方式

  • 表内请求字段不含统一注入的 token、reqid、reqsid;空字段表示包装方法没有显式业务字段。
  • 返回字段是该方法回调直接读取的字段,不是完整响应 Schema。回调透传 表示把整个响应交给上层。
  • JSON 文件保留每个调用位置、方法签名、参数表达式、回调字段与路由;CSV 可直接用 Excel 打开。
  • 普通游戏接口是 POST,JSON 经 AES-ECB + PKCS7 + Base64 后作为请求体;支付调用有单独的路由/编码开关。
  • 登录中心来自 APK 配置;进入区服后的地址来自官方返回的 gameServerAddress;支付地址来自 payServerAddress。

登录顺序与当前排查

  1. POST https://gameapi.diyidan.net/g0.3/users/reallogin:发送渠道账号密码,取 SDK 用户会话。
  2. userServerService/loginUser:发送 SDK 用户 ID/Token、渠道和平台,客户端读取 playerInfo、servers、masterInfos。
  3. 用户选择返回的区服后,userServerService/enterGame:发送 serverId、设备信息和客户端计算的 random。
  4. 对选中区服调用 masterService/masterQueryDetail,读取角色与牧场/背包/任务等状态。

签名日期必须跟随 Paster.timestampFormat 的实际实现:格式串 yyMMdd 中的 yy 被替换为四位 Date.fullYear,因此日期是八位 yyyyMMdd。 channel 与 tjChannel 不同:这份 APK 的渠道为 DYD,而 assets/tjchannel.json 中的追踪渠道为 taptap。 辅助已修正这两处进入参数,并在调试日志的“进入参数检查”中记录日期、规则和渠道,不记录签名原文或 Token。

旧版 AccountCenter.as 使用 servers[].id;内部 ServerVo 保存为 serverId;masterInfos[].id 是角色编号。 实际登录日志返回前两条完整区服(含 id),后两条是 $.servers[0] / $.servers[1] 的 $ref 引用。 辅助现已还原数组引用、按区服编号去重,并按 masterInfos[].serverId 关联角色名;本地整理不会再发请求。 调试窗口已记录进入解析器之前的解密响应,文件为 local_state/ranch_helper/network_debug.jsonl。

培育室和冒险的关键组合

  • 看培育槽/背包:masterQueryDetail;刷新成长:stackCheckProcess;放蛋:stackAddMonster。
  • 收取到牧场:stackTransferMonster,datas 内具体结构需结合调用者;派遣:monsterSell。
  • 派遣统一使用 monsterIds 数组:MonsterCenter.sellAllStackMonsters 的培育室路径也调用 NetMonster.sellMonsters。NetStack.sellMonsters 的单数 monsterId 是未找到调用点的旧包装;用户日志中它返回997,复数请求成功。
  • 喂养升级:monsterIntensify,目标 targetId,素材数组 foods。
  • 委托:taskLoopFlush → taskLoopReceive → taskCompleteStep → taskComplete。
  • 普通冒险:stageStart → 客户端实际战斗 → battleEnd。后者提交 battleData,包含伤害、击杀、时间、阵容等。
  • 客户端 StageStartPanel.startSaodang/doSaodangBattle 复用上述接口;普通关卡三个难度全部通关后开放。详见 STAGES_DAILY.md。服务端如何验证仍未知。

游戏接口(按功能)

成就(NetAchi)

API 用途 请求字段 回调读取字段 代码位置
historyService/hisAchiComplete 领取成就奖励 achiTypeId reward NetAchi.as:27

签到与活动(NetActi)

API 用途 请求字段 回调读取字段 代码位置
dailyCheckService/dailyCheck 每日签到 无显式业务字段 reward NetActi.as:146
dailyGiftService/dailyGiftSign 领取每日礼包/签到奖励 无显式业务字段 dailyGift, reward NetActi.as:98
dailyGiftService/dailyGiftUpdate 更新每日礼包状态 无显式业务字段 dailyGift, reward NetActi.as:114
dailyGiftService/dailyLoopReward 领取每日循环奖励 无显式业务字段 回调透传 NetActi.as:66
vipService/getReward 领取 VIP 奖励 无显式业务字段 reward NetActi.as:130
weekActivityService/getWeekActivityReward 领取周活动奖励 无显式业务字段 回调透传 NetActi.as:50
weekActivityService/queryWeekActivityInfo 查询周活动状态 无显式业务字段 回调透传 NetActi.as:82

炼金(NetAlchemy)

API 用途 请求字段 回调读取字段 代码位置
alchemyStackService/alchemyComplete 领取炼金成品 alchemyStackId item NetAlchemy.as:67
alchemyStackService/alchemyOpen 开启炼金槽 无显式业务字段 alchemyStack NetAlchemy.as:83
alchemyStackService/alchemySpeed 加速炼金 stackId, num, itemId endTime NetAlchemy.as:108
alchemyStackService/alchemyStart 开始炼金 alChemyStackId, materialDic cost, endTime NetAlchemy.as:51

特殊战斗(NetBattle)

API 用途 请求字段 回调读取字段 代码位置
battleService/battleStart 开始特殊战斗 battleType, stageTypeId, stageLevel, taskTypeId 此回调未显式读取字段 NetBattle.as:54
battleService/recordBattleResult 记录特殊战斗结果 stageId, cityId, result 此回调未显式读取字段 NetBattle.as:32

世界 BOSS(NetBoss)

API 用途 请求字段 回调读取字段 代码位置
worldBossService/finishHuntBoss 结算世界 BOSS 挑战 bossId, damage, battleDataReq 回调透传 NetBoss.as:76
worldBossService/getBossRewardByDamage 领取 BOSS 伤害奖励 bossId 回调透传 NetBoss.as:92
worldBossService/queryCurrentBoss 查询当前世界 BOSS 无显式业务字段 回调透传 NetBoss.as:43
worldBossService/queryCurrentBossHp 查询世界 BOSS 剩余生命 bossId hp NetBoss.as:108
worldBossService/startHuntBoss 开始世界 BOSS 挑战 bossId 回调透传 NetBoss.as:56

羁绊(NetEntangle)

API 用途 请求字段 回调读取字段 代码位置
monsterService/monsterEntangleLevelUp 提升羁绊等级 monsterId entangleLevel, unlockTask NetEntangle.as:54
monsterService/monsterMakeEntangle 建立魔物羁绊 monsterId unlockTask NetEntangle.as:38
monsterService/monsterResetEntangleSkill 重置羁绊技能 monsterId globalAdd, monAdd NetEntangle.as:90
monsterService/monsterSetEntangleSkill 设置羁绊技能 monsterId, entangleSkillLevel, entangleSkillType globalAdd, monAdd NetEntangle.as:74

装备(NetEquip)

API 用途 请求字段 回调读取字段 代码位置
itemService/itemEquipUnfix 卸下装备 monsterId, part monAdd NetEquip.as:52
itemService/itemEquipUsed 穿戴装备 monsterId, itemId monAdd NetEquip.as:33

物品兑换(NetExchange)

API 用途 请求字段 回调读取字段 代码位置
itemService/itemExchange 兑换物品 exchangeId, exchangeNum reward NetExchange.as:36

探索派遣(NetExplore)

API 用途 请求字段 回调读取字段 代码位置
exploreService/addTeam 增加探索队伍 无显式业务字段 exploreTeam NetExplore.as:38
exploreService/cancelExplore 取消探索 exploreTeamId 回调透传 NetExplore.as:54
exploreService/finish 完成并领取探索奖励 exploreTeamId monExp, rewardResult, unlockStage NetExplore.as:90
exploreService/start 派出探索队伍 exploreTeamId, monsters, area exploreTeam, startTime NetExplore.as:74

扭蛋(NetGacha)

API 用途 请求字段 回调读取字段 代码位置
gachaService/gachaBuyTimeEgg 购买时段扭蛋 timeEggId 回调透传 NetGacha.as:52
gachaService/gachaGetEggs 执行扭蛋抽取并返回蛋/附带奖励 id, num, voucherNum, traceInfo eggs, getItem, getMoney NetGacha.as:83
gachaService/gachaTimeEgg 执行时段扭蛋操作 无显式业务字段 回调透传 NetGacha.as:36

物品与礼包码(NetItem)

API 用途 请求字段 回调读取字段 代码位置
giftService/useGiftCode 兑换礼包码 giftCode, masterId, serverId, isMail resCode, resMsg, rewardResult NetItem.as:91
itemService/itemSell 出售物品 itemId, num money NetItem.as:46
itemService/itemUse 使用物品 itemId, num param, reward NetItem.as:70

邮件(NetMail)

API 用途 请求字段 回调读取字段 代码位置
mailService/mailBatchDel 批量删除邮件 mailIds datas NetMail.as:69
mailService/mailGetReward 领取邮件附件 mailId 回调透传 NetMail.as:86
mailService/mailQuery 查询邮件列表 无显式业务字段 datas NetMail.as:53
mailService/mailRead 标记邮件已读 mailIds 此回调未显式读取字段 NetMail.as:38

角色、体力与迁移(NetMaster)

API 用途 请求字段 回调读取字段 代码位置
guideService/guideUpdate 更新引导进度 `{
"tag":guide,
"isMain":isMain
}` level NetMaster.as:235
heartBeatService/keepAlive 会话心跳 无显式业务字段 此回调未显式读取字段 NetMaster.as:113
masterService/masterCheckTiAdd 检查体力恢复 无显式业务字段 ti, timeTi NetMaster.as:120
masterService/masterLevelUpdate 更新角色等级状态 无显式业务字段 level NetMaster.as:221
masterService/masterNameUpdate 修改角色名字 newName 回调透传 NetMaster.as:280
masterService/masterQuery 查询角色基础信息 {"token":AccountCenter.getIns().userToken} masterInfo NetMaster.as:171
masterService/masterQueryDetail 查询角色主快照(牧场、背包、队伍、任务等) 无显式业务字段 此回调未显式读取字段 NetMaster.as:186
masterService/queryMasterSecondDetail 查询角色补充信息 无显式业务字段 data, resCode NetMaster.as:197
masterService/queryRoleAvatars 查询可用头像 无显式业务字段 avatars NetMaster.as:264
masterService/updateMasterAvatar 更换头像 avatar 此回调未显式读取字段 NetMaster.as:249
migrateService/migrateIn 执行角色迁入 migrateCode, sdkUid, channel, platform 回调透传 NetMaster.as:99
migrateService/migrateOut 执行角色迁出 masterId 回调透传 NetMaster.as:78
userServerService/createMaster 创建区服角色 roleName, serverId, avatar, tjChannel, random masterInfo, resCode NetMaster.as:142

小游戏与存档(NetMiniGame)

API 用途 请求字段 回调读取字段 代码位置
archiveInfoService/getArchiveInfo 读取小游戏存档 typeId archiveInfo NetMiniGame.as:67
archiveInfoService/saveInfo 保存小游戏存档 typeId, data, keyValue1, keyValue2, dataTime 回调透传 NetMiniGame.as:51
miniGameService/gameOver 结算小游戏 score 回调透传 NetMiniGame.as:97
miniGameService/gameStart 开始小游戏 type 此回调未显式读取字段 NetMiniGame.as:81
miniGameService/getRecord 查询小游戏记录 无显式业务字段 回调透传 NetMiniGame.as:113

魔物管理(NetMonster)

API 用途 请求字段 回调读取字段 代码位置
monsterService/monsterExchange 交换魔物成长属性 monsterIdA, monsterIdB 此回调未显式读取字段 NetMonster.as:232
monsterService/monsterIntensify 消耗素材魔物强化目标魔物 targetId, foods exp, level, tpExp, tpLevel NetMonster.as:159
monsterService/monsterLock 锁定/解锁魔物 monsterId, lock 此回调未显式读取字段 NetMonster.as:251
monsterService/monsterNameUpdate 修改魔物名字 monsterId, name 此回调未显式读取字段 NetMonster.as:178
monsterService/monsterPotential 处理魔物潜能(仅常量,未找到 send 调用) 未确认 未确认 NetMonster.as:20
monsterService/monsterQualification 重设/提升魔物资质 monId 回调透传 NetMonster.as:82
monsterService/monsterSell 派遣/出售魔物 monsterIds money NetMonster.as:194
monsterService/monsterSendGift 给魔物赠礼 monsterId, itemId addFeel, feel, giftDate NetMonster.as:140
monsterService/monsterTranster2Room 转移魔物到牧场(保留原拼写) monsterId, itemId, addType 此回调未显式读取字段 NetMonster.as:102
monsterService/monsterTranster2Room 转移魔物到牧场(保留原拼写) monsterId, roomId 此回调未显式读取字段 NetMonster.as:121
monsterService/monsterTranster2Room 转移魔物到牧场(保留原拼写) monsterId, roomId 此回调未显式读取字段 NetMonster.as:213
monsterService/monsterUpStar 提升魔物星级 monId 回调透传 NetMonster.as:66

支付订单(NetPay)

API 用途 请求字段 回调读取字段 代码位置
pay-server/pay/getPayReward 查询/领取已支付订单奖励 tradeId, uid, outOrderNo, phoneModel, deviceId, osType, imei, tjChannel payRwardResult, resCode, resMsg NetPay.as:138
pay-server/pay/payApply 申请支付交易号 rewardTypeId, masterId, serverId, money, payAccountName, channel, tjChannel, imei extResponse, resCode, resMsg, tradeId NetPay.as:63
pay-server/pay/queryNoGetRewardPay 查询未领取的支付订单 masterId notGetRewardOrderList NetPay.as:167

充值奖励(NetPayPoint)

API 用途 请求字段 回调读取字段 代码位置
pay-server/timeRecharge/getChargeReward 领取时段充值奖励 masterId, chargeRewardId reward NetPayPoint.as:75
pay-server/timeRecharge/getChargeRewardList 查询时段充值奖励列表 masterId, startTime, endTime 回调透传 NetPayPoint.as:56
rechargeService/getPayGift 领取充值积分礼包 giftTypeId reward NetPayPoint.as:36

潜能(NetPotential)

API 用途 请求字段 回调读取字段 代码位置
monsterService/monsterPotentialLevelUpgrade 提升魔物潜能等级 monId, itemIds potentailLevel NetPotential.as:54
monsterService/monsterPotentialUpgrade 提升魔物潜能阶段 traceInfo, monId, itemId, monsterAttr pAtk, pDef, pDex, pHp NetPotential.as:35

PVE 活动(NetPve)

API 用途 请求字段 回调读取字段 代码位置
pveService/finishPVE 结算 PVE 活动挑战 battleDataReq, pveAreaName 回调透传 NetPve.as:58
pveService/getPVEWeekReward 领取 PVE 周奖励 pveAreaName 回调透传 NetPve.as:74
pveService/queryPVEInfo 查询 PVE 活动信息 无显式业务字段 pveInfo NetPve.as:90
pveService/startPVE 开始 PVE 活动挑战 pveAreaName 回调透传 NetPve.as:39

牧场事件(NetRandomEvent)

API 用途 请求字段 回调读取字段 代码位置
gameEventService/finishFarmEvent 完成牧场随机事件 无显式业务字段 getTasks, result, unlockTasks NetRandomEvent.as:46
gameEventService/getFarmEvent 查询牧场随机事件 无显式业务字段 currentTime, masterEventTimer, triggerEvent, typeId NetRandomEvent.as:30

排行榜(NetRank)

API 用途 请求字段 回调读取字段 代码位置
rankService/queryRank 查询排行榜 rankName 回调透传 NetRank.as:26

牧场建造(NetRoom)

API 用途 请求字段 回调读取字段 代码位置
roomService/roomCreateByKe 用氪金建造牧场 无显式业务字段 room NetRoom.as:60
roomService/roomCreateByMoney 用金币建造牧场 无显式业务字段 room NetRoom.as:56
roomService/roomUpgrade 升级牧场 roomId, targetTypeId, useVoucher room NetRoom.as:38

商店(NetShop)

API 用途 请求字段 回调读取字段 代码位置
shopService/shopItemBuy 购买商店物品 shopId, shopType, num costKe, costMoney, items NetShop.as:41
shopService/shopQuery 查询商店商品 无显式业务字段 keShopList, moneyShopList, shopBuyNum NetShop.as:57

皮肤(NetSkin)

API 用途 请求字段 回调读取字段 代码位置
monsterService/monsterSetSkin 设置魔物皮肤 monsterId, skinType 回调透传 NetSkin.as:29

培育室(NetStack)

API 用途 请求字段 回调读取字段 代码位置
monsterService/monsterSell 派遣/出售魔物 monsterId money NetStack.as:137
stackService/stackAddMonster 向培育槽放入魔物蛋 eggs monsters NetStack.as:90
stackService/stackCheckProcess 推进/检查培育成长阶段 无显式业务字段 allExp, datas, stackMonsterInfos NetStack.as:121
stackService/stackGrowthNumber 增加培育槽属性加成次数 stackId, name 回调透传 NetStack.as:55
stackService/stackOpen 开启培育槽 openType, position stack NetStack.as:74
stackService/stackSpeedUp 加速培育 monsterId, num startTime NetStack.as:162
stackService/stackTransferMonster 从培育槽收取魔物到牧场 datas 此回调未显式读取字段 NetStack.as:106

冒险关卡与结算(NetStage)

API 用途 请求字段 回调读取字段 代码位置
battleService/battleEnd 提交普通关卡战斗数据并结算 battleData costTi, lockStage, monsterExpInfos, reward, unlockStage NetStage.as:89
loopStageService/checkNextWeek 检查循环关卡跨周更新 无显式业务字段 回调透传 NetStage.as:54
loopStageService/getStageReward 领取循环关卡阶段奖励 rewardId 回调透传 NetStage.as:38
stageService/stageStart 进入指定关卡和难度 stageTypeId, stageLevel stageEvent, triggerEvent NetStage.as:73

配置、公告与时间(NetSystem)

API 用途 请求字段 回调读取字段 代码位置
gameService/queryGameConfig 查询游戏配置 无显式业务字段 config NetSystem.as:115
gameService/queryGameNotice 查询公告 无显式业务字段 gameNotice NetSystem.as:91
getSysCurTime/execute 查询系统时间 无显式业务字段 time NetSystem.as:44
userServerService/firstOpenGame 上报首次启动 os, osType, phoneScreen, phoneFactory, phoneModel, channel, isp, network, deviceId, imei, tjChannel 此回调未显式读取字段 NetSystem.as:76

任务与委托(NetTask)

API 用途 请求字段 回调读取字段 代码位置
taskService/taskComplete 完成任务并领取奖励 taskId, taskTypeId nextTasks, reward, unlockStages, unlockTasks NetTask.as:94
taskService/taskCompleteStep 推进任务当前步骤 taskId, removeIds, taskTypeId, battleData reward, stageReward NetTask.as:70
taskService/taskLoopFlush 刷新每日循环委托 无显式业务字段 loopTask NetTask.as:110
taskService/taskLoopReceive 接取指定城市的循环委托 taskTypeId, city task NetTask.as:129
taskService/taskReceive 接取普通任务 taskTypeId task NetTask.as:46
taskService/taskUpdate 更新任务状态/解锁 unlockTasks, receiveTasks, removeTasks receiveTasks, unlockTasks NetTask.as:149

战斗编队(NetTeam)

API 用途 请求字段 回调读取字段 代码位置
monsterService/monsterPlaceBattleTeam 将魔物加入战斗队伍 monsterId, battleTeamName, position 此回调未显式读取字段 NetTeam.as:34
monsterService/monsterWithdrawBattleTeam 从战斗队伍移除魔物 battleTeamName, position 此回调未显式读取字段 NetTeam.as:53

登录、区服与实名(NetUser)

API 用途 请求字段 回调读取字段 代码位置
userInfoService/userActive 提交激活码 activeCode 回调透传 NetUser.as:205
userInfoService/userRegister 客户端保留的游戏用户注册路径 userName, passWord 回调透传 NetUser.as:104
userServerService/enterGame 选择区服并进入游戏 serverId, deviceId, network, isp, imei, tjChannel, random, osType 回调透传 NetUser.as:140
userServerService/loginUser 用渠道会话登录中心并取得区服/角色列表;另有开发模式调用 sdkUid, sdkToken, deviceId, channel, platform, loginType, imei, osType, tjChannel, network, isp 回调透传 NetUser.as:86
userServerService/loginUser 客户端保留的开发模式登录(loginType=dev);辅助不使用此模式 channel, platform, loginType, password, sdkUid, network, isp, tjChannel 回调透传 NetUser.as:188
userServerService/userCertification 提交游戏侧实名信息 userName, idCard 回调透传 NetUser.as:56

第一弹渠道 SDK(已导出的 UserNetwork2 类)

SDK 方法号对应 Volley 的 GET/POST/PUT/DELETE。共享 URL 的不同方法/参数分别列出。 绑定调用额外含混淆常量 d.p 对应的字段,未在本清单猜测其原名。

方法 URL 表达式 用途 显式表单字段 代码位置
POST "https://gameapi.diyidan.net/g0.3/users/reallogin" 账号密码登录 account, password com.diyidan.game.network.UserNetwork2.java:21
POST "https://gameapi.diyidan.net/g0.3/users/register" 手机号注册 nickName, mobile, password, smsCode, userSource com.diyidan.game.network.UserNetwork2.java:36
PUT "https://gameapi.diyidan.net/g0.3/users/register" 游客升级手机号账号 mobile, password, smsCode com.diyidan.game.network.UserNetwork2.java:47
POST "https://gameapi.diyidan.net/g0.3/users/register" 游客注册 deviceId com.diyidan.game.network.UserNetwork2.java:53
DELETE "https://gameapi.diyidan.net/g0.3/users/reallogin" 退出渠道会话 无显式表单字段 com.diyidan.game.network.UserNetwork2.java:57
POST "https://gameapi.diyidan.net/g0.3/users/reallogin" 使用第一弹 Token 登录 token com.diyidan.game.network.UserNetwork2.java:66
GET "https://gameapi.diyidan.net/g0.3/users/realtoken" 使用永久 Token 获取会话 无显式表单字段 com.diyidan.game.network.UserNetwork2.java:73
GET "https://gameapi.diyidan.net/g0.3/users/realtoken" 验证 Token 无显式表单字段 com.diyidan.game.network.UserNetwork2.java:80
GET "https://gameapi.diyidan.net/g0.3/users/realtoken?duration=" + j 生成指定有效期 Token 无显式表单字段 com.diyidan.game.network.UserNetwork2.java:87
PUT "https://gameapi.diyidan.net/g0.3/users/realforgetpass" 短信验证后重设密码 mobile, newPass, smsCode com.diyidan.game.network.UserNetwork2.java:98
POST "https://gameapi.diyidan.net/g0.3/users/reallogin" 通过 Token 绑定已有账号 token com.diyidan.game.network.UserNetwork2.java:108
POST "https://gameapi.diyidan.net/g0.3/users/reallogin" 通过密码绑定已有账号 account, password com.diyidan.game.network.UserNetwork2.java:116
POST "https://gameapi.diyidan.net/g0.3/users/real" 渠道侧实名验证 user_real_name, user_ID_card com.diyidan.game.network.UserNetwork2.java:123

账号密码接口的 SDK 查询参数含 versionCode、buildNumber、appChannel,请求头有应用身份签名与设备字段。 Token 校验类方法还涉及 SDK 自身的 Header/会话状态,不能把表内空表单理解为无需认证。

范围和待确认项

  • 本清单检查 31 个网络类的字符串及常量请求。此前 endpoints.json 的 111 路径未覆盖 pay-server/... 前缀,本次补入 5 条。
  • monsterService/monsterPotential 只找到常量声明,未在此范围找到调用,不能视为已确认可用的 API。
  • NetMonster.addPotential 实际向 monsterTranster2Room 发送潜能参数;清单保留该反编译事实,不改写成猜测的路径。
  • 参数集合是静态分支的并集,不表示每次都必填。嵌套对象、服务端默认值、类型约束需要逐个联调。
  • 同一个接口可能被多个包装方法调用;CSV/JSON 保留这些变体,因此行数可能大于唯一接口数。
  • 未恢复服务端源代码、完整数据库结构、服务端验签/战斗校验规则。未对库存、支付等路径进行官方实服测试。
  • 动态拼接、其他未导出渠道 SDK、热更新资源或其他版本新增 API 不在当前静态覆盖范围。