jmshrv / finamp

A Jellyfin music client for mobile
Mozilla Public License 2.0
2k stars 130 forks source link

[Redesign] Switch Android client ID source. #878

Closed Komodo5197 closed 2 months ago

Komodo5197 commented 2 months ago

It seems like the id in the androidDeviceInfo.id is actually a build ID. I've switched to an ID provided by the app_set_id plugin, which I believe should be unique.

Chaphasilor commented 2 months ago

Hmm, thanks for attempting to fix this. I'll give it a try later, but my guess is this won't solve the issue. The ID seems to rely on Play Store metadata (which is bad for F-Droid releases), and will be the same for all apps published by the same dev, on Android at least.
On iOS at least the value seems to be unique per-device, but that would still prevent installing different versions on one device.

I believe a random but stable ID should work. We could generate it and store it to the DB on first start.

Chaphasilor commented 2 months ago

Okay, just tested it and it has the same issue, at least when using two versions of the app on the same device. Should we just use a random string, like finamp-xyzabc?
see correction below

Chaphasilor commented 2 months ago

I just noticed I didn't check out the correct branch. Let me take another look 😅

Komodo5197 commented 2 months ago

Generating and storing a random ID would be my next thought too. I'll switch to that if this take doesn't work out.

Chaphasilor commented 2 months ago

Okay, it seems like it actually worked. Same device, different package ID. It could be that a different device but the same package ID won't work, but I can't test that since my other phone died. So I'll merge it for now, and we'll see if anyone complains.

I think the IDs/names should stay the same in Jellyfin too, since the access token is already generated. So there shouldn't be any issues with users getting logged out.
Thanks for the fix!