majd / ipatool

Command-line tool that allows searching and downloading app packages (known as ipa files) from the iOS App Store
MIT License
5.33k stars 465 forks source link

Every command will get keychain error on Ubuntu 22.04 #270

Open MisakaMikoto-35c5 opened 2 months ago

MisakaMikoto-35c5 commented 2 months ago

What happened?

Last month I has installed ipatool-2.1.4-linux-amd64 on my Linux server and tested it is ok. But every command will get keychain error now. Also I has tested on macOS 14.4.1 and it's works fine.

Version

ipatool-2.1.4-linux-amd64

Relevant log output

$ ./ipatool search whatever
9:54AM ERR error="failed to get account: failed to get item: The specified item could not be found in the keyring" success=false

$ ./ipatool auth info
9:55AM ERR error="failed to get account: failed to get item: The specified item could not be found in the keyring" success=false

$ rm -rf ~/.ipatool/ && ./ipatool auth login --email <hidden>
9:51AM INF enter password:
9:51AM ERR error="failed to save account in keychain: failed to set item: Object does not exist at path “/”" success=false
edx-sayed-salem commented 2 months ago

Did you use --keychain-passphrase ? For me (not on mac), I always need to pass this flag and the passphrase to unlock the keyring. (In my usecase, I have no GUI, just terminal).

MisakaMikoto-35c5 commented 2 months ago

Did you use --keychain-passphrase ? For me (not on mac), I always need to pass this flag and the passphrase to unlock the keyring. (In my usecase, I have no GUI, just terminal).

Well, still get keychain error even if use non interactive session:

$ ./ipatool auth login --email <hidden> --keychain-passphrase 1
8:06PM INF enter password:
8:06PM ERR error="failed to save account in keychain: failed to set item: Object does not exist at path “/”" success=false
$ ./ipatool auth login --email <hidden> --keychain-passphrase 1 --password <hidden> --non-interactive
8:06PM ERR error="failed to save account in keychain: failed to set item: Object does not exist at path “/”" success=false

Also I found a strange behavior, if I type a incorrect password program will prompt me enter 2FA code. But correct password will get keychain error and no 2FA code required. My Apple ID is 2FA enabled.

edx-sayed-salem commented 2 months ago

I'm not really sure, I see that there are multiple keyring backends. In my case, I use an alpine container, without really anything installed. I'm confident that it defaults to the file-backend in my case.

https://github.com/majd/ipatool/blob/5b547457f15983cdf3293bfe9072a5dde4d2af8f/cmd/common.go#L63-L69

https://github.com/majd/ipatool/blob/5b547457f15983cdf3293bfe9072a5dde4d2af8f/CHANGELOG.md?plain=1#L8-L10

Perhaps in your environment, you've got multiple keyring backends already installed which may behave differently.