buttplugio / buttplug

Rust Implementation of the Buttplug Sex Toy Control Protocol
https://buttplug.io
Other
882 stars 64 forks source link

feat: Add support for Galaku one-engine devices #629

Closed Ljzd-PRO closed 5 months ago

Ljzd-PRO commented 5 months ago

Due to changes in the branch, the original pull request #621 has been closed.

qdot commented 5 months ago

There's no need to make new PRs for branch changes, you can just rebase in. I'll hopefully be bringing this in soon.

qdot commented 5 months ago

@blackspherefollower Can you check this out soon so we can bring it in?

blackspherefollower commented 5 months ago

Yeah, I've got some time free tomorrow.

blackspherefollower commented 5 months ago

My first thought is that this protocol should just be galaku: my suspicious is that the dual actuator models use the same encryption, so naming the protocol such that it implies it will only apply to single actuator devices is probably going to be misleading in the future.

Ljzd-PRO commented 5 months ago

The Galaku WeChat app (source code) categorizes products into electric shock, one-engine, and two-engine products. Each type of product generates communication data differently, but shared some functions and constants.

blackspherefollower commented 5 months ago

I'd love to know more about how you got here: there's quite a list of devices here but none are individually named.

I have to assume you either picked through the APK or the WeChat applet: what did you learn? A companion issue over on https://github.com/buttplugio/docs.buttplug.io/issues to document this would be good.

So far this implementation has worked for about half of the Galaku I've collected

blackspherefollower commented 5 months ago

The Galaku WeChat app (source code) categorizes products into electric shock, one-engine, and two-engine products. Each type of product generates communication data differently, but shared some functions and constants.

Well that answers a couple of questions already.

Buttplug's device config should provide the context as to whether a device is 1 or 2 motor (and it would extend to shock capability if we supported that) - the protocol logic can then choose between the actual messages sent based on the device's capabilities.

blackspherefollower commented 5 months ago

Each type of product generates communication data differently, but shared some functions and constants.

Is the battery reading logic the same? Is the encryption the same?

blackspherefollower commented 5 months ago

Tested:

Ljzd-PRO commented 5 months ago

Each type of product generates communication data differently, but shared some functions and constants.

Is the battery reading logic the same? Is the encryption the same?

It should be the same because only one command function for reading battery level was found.

blackspherefollower commented 5 months ago

Cool, so lets not worry about multi-actuator devices right now, but given that there's going to be enough overlap to be worth it, lets rename the protocol to just galaku and maybe run cargo fmt -- --emit=files for reformatting.

If you could document what you found in the WeChat applet (ideally for all 3 device classes) in a new issue at https://github.com/buttplugio/docs.buttplug.io/issues that'd be awesome.

blackspherefollower commented 5 months ago

@qdot I think we're good to go