Skip to content

Commit eef549a

Browse files
committed
Merge branch 'fix_gar_proxy' into main
2 parents 647a9ef + f558437 commit eef549a

2 files changed

Lines changed: 33 additions & 5 deletions

File tree

src/constants/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -407,7 +407,7 @@ export const requestMessagesResponses = {
407407
REQUEST_TYPE_METHOD_START_TEAM_LEADER_BATTLE: [3059, POGOProtos.Rpc.StartTeamLeaderBattleProto, POGOProtos.Rpc.StartTeamLeaderBattleOutProto],
408408
REQUEST_TYPE_METHOD_COMPLETE_TEAM_LEADER_BATTLE: [3060, POGOProtos.Rpc.CompleteTeamLeaderBattleProto, POGOProtos.Rpc.CompleteTeamLeaderBattleOutProto],
409409
REQUEST_TYPE_METHOD_GET_DEBUG_ENCOUNTER_STATISTICS_ACTION: [3061, POGOProtos.Rpc.DebugEncounterStatisticsProto, POGOProtos.Rpc.DebugEncounterStatisticsOutProto],
410-
REQUEST_TYPE_METHOD_REJOIN_BATTLE_CHECK: [3062, POGOProtos.Rpc.CheckBattleRejoinProto, POGOProtos.Rpc.CheckBattleRejoinOutProto],
410+
REQUEST_TYPE_METHOD_REJOIN_BATTLE_CHECK: [3062, POGOProtos.Rpc.GetBattleRejoinStatusProto, POGOProtos.Rpc.GetBattleRejoinStatusOutProto],
411411
REQUEST_TYPE_METHOD_COMPLETE_ALL_QUEST: [3063, POGOProtos.Rpc.CompleteAllQuestProto, POGOProtos.Rpc.CompleteAllQuestOutProto],
412412
REQUEST_TYPE_METHOD_LEAVE_WEEKLY_CHALLENGE_MATCHMAKING: [3064, POGOProtos.Rpc.LeaveWeeklyChallengeMatchmakingProto, POGOProtos.Rpc.LeaveWeeklyChallengeMatchmakingOutProto],
413413
REQUEST_TYPE_METHOD_GET_PLAYER_FIELD_BOOK: [3065, POGOProtos.Rpc.GetPlayerPokemonFieldBookProto, POGOProtos.Rpc.GetPlayerPokemonFieldBookOutProto],
@@ -418,7 +418,7 @@ export const requestMessagesResponses = {
418418
REQUEST_TYPE_METHOD_NATURAL_ART_POI_ENCOUNTER: [3070, POGOProtos.Rpc.NaturalArtPoiEncounterProto, POGOProtos.Rpc.NaturalArtPoiEncounterOutProto],
419419
REQUEST_TYPE_METHOD_START_PVP_BATTLE: [3071, POGOProtos.Rpc.StartPvpBattleProto, POGOProtos.Rpc.StartPvpBattleOutProto],
420420
REQUEST_TYPE_METHOD_COMPLETE_PVP_BATTLE: [3072, POGOProtos.Rpc.CompletePvpBattleProto, POGOProtos.Rpc.CompletePvpBattleOutProto],
421-
REQUEST_TYPE_METHOD_AUTO_CATCH_LOCATION_UPDATE: [3073, POGOProtos.Rpc.AutoCatcherProto, POGOProtos.Rpc.AutoCatcherOutProto],
421+
REQUEST_TYPE_METHOD_AR_PHOTO_REWARD: [3074, null, null],
422422
REQUEST_TYPE_PLATFORM_REGISTER_PUSH_NOTIFICATION: [5000, POGOProtos.Rpc.PushNotificationRegistryProto, POGOProtos.Rpc.PushNotificationRegistryOutProto],
423423
REQUEST_TYPE_PLATFORM_UNREGISTER_PUSH_NOTIFICATION: [5001, null, null],
424424
REQUEST_TYPE_PLATFORM_UPDATE_NOTIFICATION_STATUS: [5002, POGOProtos.Rpc.UpdateNotificationProto, POGOProtos.Rpc.UpdateNotificationOutProto],

src/parser/proto-parser.ts

Lines changed: 31 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,25 @@
11
import { b64Decode } from "../utils";
22
import { requestMessagesResponses } from "../constants";
33
import { DecodedProto } from "../types";
4+
import POGOProtos from "@na-ji/pogo-protos";
45

56
let action_social = 0;
7+
let action_gar_proxy = 0;
8+
9+
function DecoderInternalGarPayloadAsResponse(method: number, data: any): any {
10+
action_gar_proxy = 0;
11+
if (!data) {
12+
return {};
13+
}
14+
15+
switch (method) {
16+
case 4:
17+
return POGOProtos.Rpc.InternalCreateSharedLoginTokenResponse.decode(b64Decode(data)).toJSON();
18+
default:
19+
return { Not_Implemented_yet: data, method: method };
20+
}
21+
}
22+
623
function DecoderInternalPayloadAsResponse(method: number, data: any): any {
724
action_social = 0;
825
let proto_tuple: any = Object.values(requestMessagesResponses)[method];
@@ -88,7 +105,7 @@ export const decodeProto = (method: number, data: string, dataType: string): Dec
88105
} else {
89106
parsedData = foundMethod[1].decode(b64Decode(data)).toJSON();
90107
}
91-
if (foundMethod[0] === 5012 || foundMethod[0] === 600005) {
108+
if (foundMethod[0] === 5012) {
92109
action_social = parsedData.action;
93110
Object.values(requestMessagesResponses).forEach(val => {
94111
let req: any = val;
@@ -97,6 +114,17 @@ export const decodeProto = (method: number, data: string, dataType: string): Dec
97114
}
98115
});
99116
}
117+
else if (foundMethod[0] === 600005) {
118+
action_gar_proxy = parsedData.action;
119+
switch (action_gar_proxy) {
120+
case 4:
121+
parsedData.payload = POGOProtos.Rpc.InternalGarAccountInfoProto.decode(b64Decode(parsedData.payload)).toJSON();
122+
break;
123+
default:
124+
break;
125+
}
126+
127+
}
100128
returnObject = {
101129
methodId: foundMethod[0],
102130
methodName: remasterOrCleanMethodString(foundMethodString),
@@ -136,8 +164,8 @@ export const decodeProto = (method: number, data: string, dataType: string): Dec
136164
if (foundMethod[0] === 5012 && action_social > 0 && parsedData.payload) {
137165
parsedData.payload = DecoderInternalPayloadAsResponse(action_social, parsedData.payload);
138166
}
139-
else if (foundMethod[0] === 600005 && action_social > 0 && parsedData.payload) {
140-
parsedData.payload = DecoderInternalPayloadAsResponse(action_social, parsedData.payload);
167+
else if (foundMethod[0] === 600005 && action_gar_proxy > 0 && parsedData.payload) {
168+
parsedData.payload = DecoderInternalGarPayloadAsResponse(action_gar_proxy, parsedData.payload);
141169
}
142170
returnObject = {
143171
methodId: foundMethod[0],

0 commit comments

Comments
 (0)