Skip to content

Commit

Permalink
适配4.11的新协议
Browse files Browse the repository at this point in the history
  • Loading branch information
simonkimi committed Jul 15, 2020
1 parent f5a5807 commit 5fc8f29
Show file tree
Hide file tree
Showing 7 changed files with 36 additions and 5 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1 @@
护萌宝 ===安卓版战舰少女R辅助软件### 介绍本软件为本人学习android开发时的第一款练手作.本软件运行在android系统上的战舰少女R脱机辅助, 可以在不打开游戏的情况下进行自动挂机, 其结果完全等同于代练.玩家交流群 560271993: [![qun](http://pub.idqqimg.com/wpa/images/group.png)](http://shang.qq.com/wpa/qunwpa?idkey=e3c2bf6bbc3b670c3fcd699767bef02ca560e91998dec75bf4a38346bf979b04)### 结构本软件为Java + H5 混合编程, 其主要逻辑由Java(src/main/java/)完成, 添加任务界面等由Vue + React + Mui完成(src/main/assets/), 如果您想与我合作开发, 请在对应包内添加或修改代码, 谢谢.### 下载下载地址请看[releases](https://github.com/ProtectorMoe/pe-protector-moe/releases)如果下载速度过慢请查看群文件### TODO List- [x] 远征功能- [x] 出征功能- [x] 战役功能- [x] 演习功能- [ ] 演习保证C败以上- [ ] 定时功能- [ ] 大破泡澡功能- [ ] 船只轮换功能### 其他的一些作品电脑版地址: [点我传送](https://github.com/bcxmzbcxm/pc-protector-moe)代挂机服务: [点我传送](http://cloud.protector.moe)### 反馈如果您有任何问题, 您可以通过以下方式联系我* **issues*** **[email protected]*** [email protected]提交bug时, 请附带以下信息:* 软件版本号* 出错功能* **软件自带日志*** 您的联系方式### 鸣谢本软件设计参考了收费软件AutoR和舰队RT的设计模式目录结构参考自[EhViewer](https://github.com/seven332/EhViewer)以及群内众多大佬的协助, 和一直支持我的群友### Licence本软件遵循GNU General Public License v3, 仅作为学习用途, 请勿商用!
护萌宝 ===安卓版战舰少女R辅助软件### 介绍本软件为本人学习android开发时的第一款练手作.本软件运行在android系统上的战舰少女R脱机辅助, 可以在不打开游戏的情况下进行自动挂机, 其结果完全等同于代练.玩家交流群 726903006: [![qun](http://pub.idqqimg.com/wpa/images/group.png)](https://qm.qq.com/cgi-bin/qm/qr?k=tsDTMs3D4ZBvbBkyeMl5nOZsu7adQuxO&jump_from=webapi)### 结构本软件为Java + H5 混合编程, 其主要逻辑由Java(src/main/java/)完成, 添加任务界面等由Vue + React + Mui完成(src/main/assets/), 如果您想与我合作开发, 请在对应包内添加或修改代码, 谢谢.### 下载下载地址请看[releases](https://github.com/ProtectorMoe/pe-protector-moe/releases)如果下载速度过慢请查看群文件### TODO List- [x] 远征功能- [x] 出征功能- [x] 战役功能- [x] 演习功能- [ ] 演习保证C败以上- [ ] 定时功能- [ ] 大破泡澡功能- [ ] 船只轮换功能### 其他的一些作品电脑版地址: [点我传送](https://github.com/bcxmzbcxm/pc-protector-moe)代挂机服务: [点我传送](http://cloud.protector.moe)### 反馈如果您有任何问题, 您可以通过以下方式联系我* **issues*** **[email protected]*** [email protected]提交bug时, 请附带以下信息:* 软件版本号* 出错功能* **软件自带日志*** 您的联系方式### 鸣谢本软件设计参考了收费软件AutoR和舰队RT的设计模式目录结构参考自[EhViewer](https://github.com/seven332/EhViewer)以及群内众多大佬的协助, 和一直支持我的群友### Licence本软件遵循GNU General Public License v3, 仅作为学习用途, 请勿商用!
Expand Down
4 changes: 2 additions & 2 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ android {
applicationId "moe.protector.pe"
minSdkVersion 17
targetSdkVersion 28
versionCode 15
versionName "1.0.6.4"
versionCode 16
versionName "1.0.6.5"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/java/moe/protector/pe/bean/UserDataBean.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

public class UserDataBean {
public UserVo userVo;
public List<UserShipVO> userShipVO;
// public List<UserShipVO> userShipVO;
public List<EquipmentVo> equipmentVo;
public List<DockVo> dockVo;
public List<RepairDockVo> repairDockVo;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
package moe.protector.pe.bean.login;

import java.util.List;

import moe.protector.pe.bean.common.UserShipVO;

public class ApiGetShipList {
public List<UserShipVO> userShipVO;
}
13 changes: 13 additions & 0 deletions app/src/main/java/moe/protector/pe/game/NetSender.java
Original file line number Diff line number Diff line change
Expand Up @@ -1051,4 +1051,17 @@ public String getTask(String cid) throws HmException {
HmException.errorFind("task/getAward出错:", data);
return data;
}

public String getShipList() throws HmException {
String url = Config.host + "api/getShipList" + this.getUrlEnd();
Requests requests = new Requests.Builder()
.url(url)
.get()
.zlib()
.build()
.execute();
String data = requests.text;
HmException.errorFind("api/getShipList出错:", data);
return data;
}
}
3 changes: 3 additions & 0 deletions app/src/main/java/moe/protector/pe/game/SecondLogin.java
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,9 @@ public void login(final SecondLoginCallBack callBack) {
// 初始化用户基本信息
String apiInitGame = netSender.apiInitGame();
userData.parseUserData(apiInitGame);
// 获取船只信息
String userShipList = netSender.getShipList();
userData.parseUserShip(userShipList);
// 初始化点数信息
userData.pveNodeGet(netSender.pveGetPveData());
String pveData = netSender.peventGetPveData();
Expand Down
8 changes: 7 additions & 1 deletion app/src/main/java/moe/protector/pe/game/UserData.java
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
import moe.protector.pe.bean.common.UserResVo;
import moe.protector.pe.bean.common.UserShipVO;
import moe.protector.pe.bean.common.UserVo;
import moe.protector.pe.bean.login.ApiGetShipList;
import moe.protector.pe.bean.task.TaskVo;
import moe.protector.pe.bean.task.UpdateTaskVo;
import moe.protector.pe.util.Config;
Expand Down Expand Up @@ -71,7 +72,7 @@ public void parseUserData(String user_data) {
// 用户舰队
this.fleetSetAll(userBaseData.fleetVo);
// 用户船只
this.allShipSetAllUserShipVO(userBaseData.userShipVO);
// this.allShipSetAllUserShipVO(userBaseData.userShipVO);
// 远征数据
this.exploreSetAll(userBaseData.pveExploreVo.levels);
// 包裹信息
Expand All @@ -95,6 +96,11 @@ public void parseUserData(String user_data) {
}
}

public void parseUserShip(String userShipVo) {
ApiGetShipList shipList = JSON.parseObject(userShipVo, ApiGetShipList.class);
this.allShipSetAllUserShipVO(shipList.userShipVO);
}

// ----------------- 更新用户数据--------------
public void userVoUpdate(UserVo userVo) {
userBaseData.userVo.ammo = userVo.ammo;
Expand Down

0 comments on commit 5fc8f29

Please sign in to comment.