فهرست منبع

Update app version identifiers

Tulir Asokan 2 سال پیش
والد
کامیت
6c3fca78ff
4فایلهای تغییر یافته به همراه40 افزوده شده و 25 حذف شده
  1. 2 0
      mauigpapi/http/base.py
  2. 22 11
      mauigpapi/mqtt/conn.py
  3. 12 5
      mauigpapi/mqtt/subscription.py
  4. 4 9
      mauigpapi/state/application.py

+ 2 - 0
mauigpapi/http/base.py

@@ -101,6 +101,8 @@ class BaseAndroidAPI:
             "x-ig-www-claim": self.state.session.ig_www_claim or "0",
             "x-bloks-is-layout-rtl": str(self.state.device.is_layout_rtl).lower(),
             "x-bloks-is-panorama-enabled": "true",
+            "x-ig-timezone-offset": self.state.device.timezone_offset,
+            # "x-messenger": "1",
             "x-ig-device-id": self.state.device.uuid,
             "x-ig-android-id": self.state.device.id,
             "x-ig-connection-type": self.state.device.connection_type,

+ 22 - 11
mauigpapi/mqtt/conn.py

@@ -175,17 +175,22 @@ class AndroidMQTT:
 
     def _form_client_id(self) -> bytes:
         subscribe_topics = [
-            RealtimeTopic.PUBSUB,
-            RealtimeTopic.SUB_IRIS_RESPONSE,
-            RealtimeTopic.REALTIME_SUB,
-            RealtimeTopic.REGION_HINT,
-            RealtimeTopic.SEND_MESSAGE_RESPONSE,
-            RealtimeTopic.MESSAGE_SYNC,
-            RealtimeTopic.UNKNOWN_179,
-            RealtimeTopic.UNKNOWN_PP,
+            RealtimeTopic.PUBSUB,  # 88
+            RealtimeTopic.SUB_IRIS_RESPONSE,  # 135
+            RealtimeTopic.RS_REQ,  # 244
+            RealtimeTopic.REALTIME_SUB,  # 149
+            RealtimeTopic.REGION_HINT,  # 150
+            RealtimeTopic.RS_RESP,  # 245
+            RealtimeTopic.T_RTC_LOG,  # 274
+            RealtimeTopic.SEND_MESSAGE_RESPONSE,  # 133
+            RealtimeTopic.MESSAGE_SYNC,  # 146
+            RealtimeTopic.LIGHTSPEED_RESPONSE,  # 179
+            RealtimeTopic.UNKNOWN_PP,  # 34
         ]
         subscribe_topic_ids = [int(topic.encoded) for topic in subscribe_topics]
-        password = f"sessionid={self.state.cookies['sessionid']}"
+        password = f"authorization={self.state.session.authorization}"
+        # if not self.state.session.authorization:
+        #     password = f"sessionid={self.state.cookies['sessionid']}"
         cfg = RealtimeConfig(
             client_identifier=self.state.device.phone_id[:20],
             client_info=RealtimeClientInfo(
@@ -218,7 +223,7 @@ class AndroidMQTT:
                 "platform": "android",
                 "ig_mqtt_route": "django",
                 "pubsub_msg_type_blacklist": "direct, typing_type",
-                "auth_cache_enabled": "0",
+                "auth_cache_enabled": "1",
             },
         )
         return zlib.compress(cfg.to_thrift(), level=9)
@@ -619,7 +624,13 @@ class AndroidMQTT:
         resp = await self.request(
             RealtimeTopic.SUB_IRIS,
             RealtimeTopic.SUB_IRIS_RESPONSE,
-            {"seq_id": seq_id, "snapshot_at_ms": snapshot_at_ms},
+            {
+                "seq_id": seq_id,
+                "snapshot_at_ms": snapshot_at_ms,
+                "snapshot_app_version": self.state.application.APP_VERSION,
+                "timezone_offset": int(self.state.device.timezone_offset),
+                "subscription_type": "message",
+            },
             timeout=20,
         )
         self.log.debug("Iris subscribe response: %s", resp.payload.decode("utf-8"))

+ 12 - 5
mauigpapi/mqtt/subscription.py

@@ -55,12 +55,13 @@ class GraphQLQueryID(Enum):
 
 
 everclear_subscriptions = {
-    "async_ads_subscribe": GraphQLQueryID.ASYNC_AD_SUB.value,
-    "inapp_notification_subscribe_default": GraphQLQueryID.INAPP_NOTIFICATION.value,
     "inapp_notification_subscribe_comment": GraphQLQueryID.INAPP_NOTIFICATION.value,
     "inapp_notification_subscribe_comment_mention_and_reply": GraphQLQueryID.INAPP_NOTIFICATION.value,
-    "business_import_page_media_delivery_subscribe": GraphQLQueryID.BUSINESS_DELIVERY.value,
     "video_call_participant_state_delivery": GraphQLQueryID.VIDEO_CALL_PARTICIPANT_DELIVERY.value,
+    "inapp_notification_subscribe_story_emoji_reaction": GraphQLQueryID.INAPP_NOTIFICATION.value,
+    "inapp_notification_subscribe_prompt_sticker_reply": GraphQLQueryID.INAPP_NOTIFICATION.value,
+    "inapp_notification_subscribe_fundraiser_cohost_invited": GraphQLQueryID.INAPP_NOTIFICATION.value,
+    "inapp_notification_subscribe_watch_receipt": GraphQLQueryID.INAPP_NOTIFICATION.value,
 }
 
 
@@ -339,7 +340,10 @@ _topic_map: dict[str, str] = {
     "/graphql": "9",
     "/t_region_hint": "150",
     "/mqtt_health_stats": "/mqtt_health_stats",
-    "179": "179",  # also unknown
+    "/ls_resp": "179",
+    "/rs_req": "244",
+    "/rs_resp": "245",
+    "/t_rtc_log": "274",
 }
 
 _reverse_topic_map: dict[str, str] = {value: key for key, value in _topic_map.items()}
@@ -358,7 +362,10 @@ class RealtimeTopic(Enum):
     REGION_HINT = "/t_region_hint"
     MQTT_HEALTH_STATS = "/mqtt_health_stats"
     UNKNOWN_PP = "/pp"
-    UNKNOWN_179 = "179"
+    LIGHTSPEED_RESPONSE = "/ls_resp"
+    RS_REQ = "/rs_req"
+    RS_RESP = "/rs_resp"
+    T_RTC_LOG = "/t_rtc_log"
 
     @property
     def encoded(self) -> str:

+ 4 - 9
mauigpapi/state/application.py

@@ -27,13 +27,8 @@ default_capabilities = json.loads(
 
 @dataclass
 class AndroidApplication(SerializableAttrs):
-    # TODO these newer versions make the iris subscribe stop working for some reason
-    # APP_VERSION: str = "168.0.0.40.355"
-    # APP_VERSION_CODE: str = "261079771"
-    # APP_VERSION: str = "167.1.0.25.120"
-    # APP_VERSION_CODE: str = "259829117"
-    APP_VERSION: str = "159.0.0.29.122"
-    APP_VERSION_CODE: str = "244390482"
+    APP_VERSION: str = "256.0.0.18.105"
+    APP_VERSION_CODE: str = "407842973"
     BREADCRUMB_KEY: str = "iN4$aGr0m"
     FACEBOOK_ANALYTICS_APPLICATION_ID: str = "567067343352427"
     FACEBOOK_OTA_FIELDS: str = (
@@ -44,8 +39,8 @@ class AndroidApplication(SerializableAttrs):
     )
     FACEBOOK_ORCA_APPLICATION_ID: str = "124024574287414"
 
-    BLOKS_VERSION_ID: str = "0e00f30ed0184b9c914a8baad3fe538aa36a9f0faad173486e76af5ee9310d0b"
-    CAPABILITIES: str = "3brTvx8="
+    BLOKS_VERSION_ID: str = "0928297a84f74885ff39fc1628f8a40da3ef1c467555d555bfd9f8fe1aaacafe"
+    CAPABILITIES: str = "3brTv10="
     SUPPORTED_CAPABILITIES: str = default_capabilities
 
     EXPERIMENTS: str = ",".join(