signalstickers / signalstickers-client

⚙️🐍 A Python client for the Signal stickers API
https://pypi.org/project/signalstickers-client/
GNU Lesser General Public License v3.0
54 stars 9 forks source link

Unable to get uuid, password #15

Closed laggykiller closed 1 year ago

laggykiller commented 1 year ago

Followed the guide: https://github.com/signalstickers/signalstickers-client#uploading-a-pack

Broken recently after update

window.reduxStore.getState().items.uuid_id
VM594:1 Uncaught TypeError: Cannot read properties of undefined (reading 'getState')
    at <anonymous>:1:19
(anonymous) @ VM594:1
window.reduxStore.getState().items.password
VM598:1 Uncaught TypeError: Cannot read properties of undefined (reading 'getState')
    at <anonymous>:1:19
(anonymous) @ VM598:1
laggykiller commented 1 year ago

See https://github.com/signalapp/Signal-Desktop/blob/main/ts/windows/main/start.ts

if (!isProduction(window.SignalContext.getVersion())) {
  const SignalDebug = {
    Data: window.Signal.Data,
    getConversation: (id: string) => window.ConversationController.get(id),
    getMessageById: (id: string) => window.MessageController.getById(id),
    getReduxState: () => window.reduxStore.getState(),
    getSfuUrl: () => window.Signal.Services.calling._sfuUrl,
    getStorageItem: (name: keyof StorageAccessType) => window.storage.get(name),
    putStorageItem: <K extends keyof StorageAccessType>(
      name: K,
      value: StorageAccessType[K]
    ) => window.storage.put(name, value),
    setFlag: (name: keyof FeatureFlagType, value: boolean) => {
      if (!has(window.Flags, name)) {
        return;
      }
      window.Flags[name] = value;
    },
    setSfuUrl: (url: string) => {
      window.Signal.Services.calling._sfuUrl = url;
    },
  };

Hence, the alternative method is to download Signal Beta version (https://support.signal.org/hc/en-us/articles/360007318471-Signal-Beta) and use: window.SignalDebug.getReduxState().items.uuid_id

window.SignalDebug.getReduxState().items.password

Note: For beta version, no need to launch with --enable-dev-tools

However, would there be any way to get uuid_id and password from production version?

With my limited javascript knowledge, I think it is related to these commits:

laggykiller commented 1 year ago

I have created a PR with updated instruction: https://github.com/signalstickers/signalstickers-client/pull/16

sweetgiorni commented 1 year ago

@laggykiller

https://user-images.githubusercontent.com/12527888/226097829-21bc3d01-c587-4c16-a823-740c89ce9d7d.mp4

laggykiller commented 1 year ago

@sweetgiorni Have you read what I wrote?

To quote what I have wrote:

The alternative method is to download Signal Beta version (https://support.signal.org/hc/en-us/articles/360007318471-Signal-Beta) and use: window.SignalDebug.getReduxState().items.uuid_id window.SignalDebug.getReduxState().items.password

Edit: I see what you mean now, your solution is better

lorisleitner commented 1 year ago

Hi, thanks for the library!

Does anybody know how long these credentials are valid and can be used without refreshing?

Thanks

romainricard commented 1 year ago

Thanks a lot @sweetgiorni ! I've added your video to the README and clarified the instructions.

@lorisleitner Does anybody know how long these credentials are valid and can be used without refreshing?

No idea, sorry.