Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions pkg/messagix/bloks/bloks.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import (
"reflect"
)

// Messenger iOS 535.0.0.0.0 of 1763582309
const BloksVersion = "330b36fe786d9b82dd834eb55748d52712a0d09cf6fb7c60931d40204d086306"
// Messenger iOS 544.0.0.20.406 of 1768247148
const BloksVersion = "7f577336851f32ef4842b8eb2394aaf9d036c1dda7c1064b3f3090b6212b63e5"

type ExtraStringification[T any] struct {
Body T
Expand Down
2 changes: 1 addition & 1 deletion pkg/messagix/bloks/interp.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ func NewInterpreter(ctx context.Context, b *BloksBundle, br *InterpBridge, old *
br.FamilyDeviceID = strings.ToUpper(uuid.New().String())
}
if br.MachineID == "" {
br.MachineID = string(random.StringBytes(25))
br.MachineID = string(random.StringBytes(24))
}
if br.EncryptPassword == nil {
br.EncryptPassword = func(pw string) (string, error) {
Expand Down
2 changes: 1 addition & 1 deletion pkg/messagix/bloks/selenium.go
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ func NewBrowser(ctx context.Context, cfg *BrowserConfig) *Browser {
b.Bridge = &InterpBridge{
DeviceID: strings.ToUpper(uuid.New().String()),
FamilyDeviceID: strings.ToUpper(uuid.New().String()),
MachineID: string(random.StringBytes(25)),
MachineID: string(random.StringBytes(24)),
EncryptPassword: cfg.EncryptPassword,
DoRPC: func(name string, params map[string]string, isPage bool, callback func(result *BloksScriptLiteral) error) error {
log.Debug().Str("state", string(b.State)).Str("rpc", name).Msg("Invoking RPC from Bloks")
Expand Down
6 changes: 6 additions & 0 deletions pkg/messagix/graphql.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import (
"strings"

"github.com/google/go-querystring/query"
"github.com/google/uuid"
"go.mau.fi/util/exslices"

"go.mau.fi/mautrix-meta/pkg/messagix/bloks"
Expand Down Expand Up @@ -65,6 +66,11 @@ func (c *Client) makeBloksRequest(ctx context.Context, doc *bloks.BloksDoc, vari
headers.Set("x-root-field-name", doc.RootField)
headers.Set("x-graphql-request-purpose", "fetch")
headers.Set("x-graphql-client-library", "pando")
headers.Set("x-fb-client-ip", "True")
headers.Set("x-fb-server-cluster", "True")
headers.Set("x-fb-conn-uuid-client", strings.Replace(uuid.New().String(), "-", "", -1))
headers.Set("x-fb-http-engine", "Tigon/MNS/TCP")
headers.Set("x-fb-rmd", "fail=Server:INVALID_MAP,Default:INVALID_MAP;v=;ip=;tkn=;reqTime=0;recvTime=0")

headers.Set("Authorization", "OAuth "+useragent.MessengerLiteAccessToken)

Expand Down
2 changes: 1 addition & 1 deletion pkg/messagix/useragent/useragent.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@ const AndroidUserAgent = "Instagram 404.0.0.48.76 Android (35/15; 420dpi; 1080x2

const MessengerLiteAppId = "437626316973788"
const MessengerLiteAccessToken = MessengerLiteAppId + "|3e1a7033ae7883bfb31f35375bad9c7a"
const MessengerLiteUserAgent = "LightSpeed [FBAN/MessengerLiteForiOS;FBAV/515.0.0.33.107;FBBV/759681175;FBDV/iPhone13,2;FBMD/iPhone;FBSN/iOS;FBSV/16.1.2;FBSS/3;FBCR/;FBID/phone;FBLC/en_US;FBOP/0]"
const MessengerLiteUserAgent = "LightSpeed [FBAN/MessengerLiteForiOS;FBAV/545.0.0.12.108;FBBV/865730320;FBDV/iPhone10,3;FBMD/iPhone;FBSN/iOS;FBSV/16.7.2;FBSS/3;FBCR/;FBID/phone;FBLC/en_US;FBOP/0]"