mas icon indicating copy to clipboard operation
mas copied to clipboard

🚏πŸ“₯πŸ™…β€β™€οΈ Signin command disabled on macOS 10.13+

Open phatblat opened this issue 5 years ago β€’ 62 comments

As of version 1.4.2 the signin command has been disabled on newer versions of macOS. This is an interim workaround to the crasher first identified in #107.

mas 1.4.2 was never released through Homebrew, so it must besownloaded and installed manually from the 1.4.2 release or built from source using Xcode.

😞 Situation

In macOS High Sierra (10.13) Apple removed the -[ISAccountService signInWithContext:replyBlock:] method from the StoreFoundation private Apple framework which this app relies on to authenticate users through the signin command. I have done a lot of digging and debugging but have not found another API that works to authenticate a user with the Mac App Store.

Users running older macOS versions (10.9-10.12) are unaffected.

πŸ‘‰πŸ»βŒ¨οΈ Workaround

Sign into the Mac App Store GUI app manually. Once signed in MAS app, the mas command should work fine.

I know this is not an ideal scenario, especially for script automation. Hopefully, I'll find a real solution to this soon.

Please πŸ‘ this issue if you are affected by it.

Related: #107, #129, #147, #155, #159, #160, #162

phatblat avatar Aug 12 '18 20:08 phatblat

This impacts me quite a bit as I rely on mas to automate updates on my Mac labs. I'm happy to help look for solutions as I am able. Does anyone have a list of Apple API resources as a start?

b3cramer avatar Aug 23 '18 18:08 b3cramer

Can we open the App Store GUI on 10.13+?

SConaway avatar Sep 05 '18 01:09 SConaway

@SConaway the --dialog option to the signin command wasn't effective to open the MAS GUI because it would crash before causing the app to launch.

phatblat avatar Sep 05 '18 01:09 phatblat

@b3cramer docs for all of Apple's public frameworks is available online, but no docs or developer support is available for private frameworks. If you are interested in perusing these private frameworks, you can use the aging class-dump command to generate headers from the binaries on your mac. I've done this for some versions of macOS in my macOSPrivateFrameworks repo.

phatblat avatar Sep 05 '18 01:09 phatblat

I'll prolly do that tomorrow of 10.14. I'll make a PR to you with them.

SConaway avatar Sep 05 '18 02:09 SConaway

Well, the signin command isn’t disabled on Mojave and it’s still crashing the same for me.

jpartain89 avatar Sep 24 '18 22:09 jpartain89

With Mojave mas seems to just no-op on commands like outdated or upgrade (I can see pending updates in the App Store but mas doesn't report them). The account command reports that I am not signed in (I have signed in to App Store), the signin command produces a large error stack.

robfletcher avatar Sep 25 '18 00:09 robfletcher

Workaround described does not work in Mojave...

franklouwers avatar Sep 25 '18 11:09 franklouwers

@jpartain89 @robfletcher @franklouwers What version of mas were you using? Note that this change was introduced in 1.4.2 which has not been released through Homebrew.

phatblat avatar Oct 02 '18 01:10 phatblat

I just tried 1.4.2 and it works.

$ ./mas-1.4.1 signin [email protected]
==> Signing in to Apple ID: [email protected]
Password:
2018-10-02 13:43:20.542 mas-1.4.1[87389:4605362] -[__NSXPCInterfaceProxy_ISAccountService signInWithContext:replyBlock:]: unrecognized selector sent to instance 0x7f849640d210
2018-10-02 13:43:20.543 mas-1.4.1[87389:4605362] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[__NSXPCInterfaceProxy_ISAccountService signInWithContext:replyBlock:]: unrecognized selector sent to instance 0x7f849640d210'
*** First throw call stack:
(
	0   CoreFoundation                      0x00007fff3bb1d43d __exceptionPreprocess + 256
	1   libobjc.A.dylib                     0x00007fff67a2e720 objc_exception_throw + 48
	2   CoreFoundation                      0x00007fff3bb9a255 -[NSObject(NSObject) __retain_OA] + 0
	3   CoreFoundation                      0x00007fff3babcad0 ___forwarding___ + 1486
	4   CoreFoundation                      0x00007fff3babc478 _CF_forwarding_prep_0 + 120
	5   mas-1.4.1                           0x000000010d76d452 mas-1.4.1 + 201810
	6   mas-1.4.1                           0x000000010d78ab70 mas-1.4.1 + 322416
	7   mas-1.4.1                           0x000000010d7561e4 mas-1.4.1 + 106980
	8   mas-1.4.1                           0x000000010d7426fd mas-1.4.1 + 26365
	9   mas-1.4.1                           0x000000010d742590 mas-1.4.1 + 26000
	10  mas-1.4.1                           0x000000010d754276 mas-1.4.1 + 98934
	11  mas-1.4.1                           0x000000010d73f7ef mas-1.4.1 + 14319
	12  libdyld.dylib                       0x00007fff68afc085 start + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException
Abort trap: 6
$ ./mas-1.4.2 signin [email protected]
Error: The 'signin' command has been disabled on this macOS version. Please sign into the Mac App Store app manually.
For more info see: https://github.com/mas-cli/mas/issues/164

There is another problem with 1.4.1 (don't think it was mentioned before) which makes 1.4.1 completely broken on Mojave

$ ./mas-1.4.1 account
Not signed in
Error: Not signed in
./mas-1.4.2 account
[email protected]

shpoont avatar Oct 02 '18 10:10 shpoont

@phatblat I'm using 1.4.1 from Homebrew

Is 1.4.2 coming to homebrew or is there a reason it's being held back? Happy to install it another way if so. I use mas mainly via https://github.com/DanielThomas/oh-your-dotfiles (I added the mas support to that).

robfletcher avatar Oct 03 '18 21:10 robfletcher

@robfletcher the PR for mas version 1.4.2 was declined. See #174.

ThomasKoppensteiner avatar Oct 04 '18 05:10 ThomasKoppensteiner

Hey, first of all thanks for this project, I really like it.

Regarding the not working install via mas on the command line I came up with a workaround until another solution can be found.

I maintain a github project which aims at automating install, customization and updates of macos. You can find it here: https://github.com/tiiiecherle/osx_install_config

As part of homebrew install scrips I added a bash script that installs mas, opens the appstore via applescript and enters apple-id and password before closing the appstore to automate the complete process. The script prompts you for your credentials to use it later in the appstore. If you want to autmate it completely just export your credentials before running the script. The script can be found here.

~~https://github.com/tiiiecherle/osx_install_config/blob/master/05_homebrew_and_casks/5b_homebrew_cask/6_mas_appstore.sh~~

Link Update due to project restructuring... https://github.com/tiiiecherle/osx_install_config/blob/master/03_homebrew_casks_and_mas/3b_homebrew_casks_and_mas_install/6_mas_appstore.sh

Be sure to download the complete folder 05_homebrew_and_casks and run the script from there without deleting the other scripts as it uses other scripts in the directory to check and define variables and components of the script to avoid redundant code in the other scripts in the same directory.

Hope it helps anyone ;)

tiiiecherle avatar Oct 04 '18 15:10 tiiiecherle

any news for 1.4.3?

hypery2k avatar Oct 24 '18 02:10 hypery2k

@hypery2k Yes! It’s out now on Homebrew. Just landed today

phatblat avatar Oct 24 '18 02:10 phatblat

very awesome, seems to work for me. thanks

hypery2k avatar Oct 25 '18 14:10 hypery2k

@phatblat Thanks for the update ;)

@hypery2k What do you mean by working for you? Signin is still disabled on the command line, isn`t it?

tiiiecherle avatar Oct 25 '18 14:10 tiiiecherle

screenshot 2018-10-29 22 07 13

Still disabled.

jem-swu avatar Oct 30 '18 05:10 jem-swu

@jem-swu yep. Signin will stay disabled to avoid the crash until there is a fix for this issue

phatblat avatar Oct 30 '18 05:10 phatblat

@phatblat ok, thanks for the heads-up. I updated the automatic login by applescript around two weeks ago. Worked fine while testing...

see https://github.com/mas-cli/mas/issues/164#issuecomment-427061409

tiiiecherle avatar Oct 30 '18 09:10 tiiiecherle

Not sure why, but even running

  • mas signout
  • Sign in using App Store.app
  • mas search Xcode

returns empty results

qkdreyer avatar Oct 30 '18 09:10 qkdreyer

mas install seems to work well now, while mas search and mas lucky didn’t work yet.

在 2018εΉ΄10月30ζ—₯οΌŒδΈ‹εˆ5:05,Quentin Dreyer [email protected] ε†™ι“οΌš

Not sure why, but even running

mas signout Sign in using App Store.app mas search Xcode returns empty results

β€” You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or mute the thread.

CourierKyn avatar Oct 30 '18 09:10 CourierKyn

Hey, first of all thanks for this project, I really like it.

Regarding the not working install via mas on the command line I came up with a workaround until another solution can be found.

I maintain a github project which aims at automating install, customization and updates of macos. You can find it here: https://github.com/tiiiecherle/osx_install_config

As part of homebrew install scrips I added a bash script that installs mas, opens the appstore via applescript and enters apple-id and password before closing the appstore to automate the complete process. The script prompts you for your credentials to use it later in the appstore. If you want to autmate it completely just export your credentials before running the script. The script can be found here.

https://github.com/tiiiecherle/osx_install_config/blob/master/05_homebrew_and_casks/5b_homebrew_cask/6_mas_appstore.sh

Be sure to download the complete folder 05_homebrew_and_casks and run the script from there without deleting the other scripts as it uses other scripts in the directory to check and define variables and components of the script to avoid redundant code in the other scripts in the same directory.

Hope it helps anyone ;)

How do I integrate the automated App Store login into an already existing script? I'm working on scripting deployments to help make my job a little easier. A specific department requires Xcode and other plugins via brew, so I wrote a basic script to install the plugins and (hopefully) Xcode.

bigdaddybesbris avatar May 09 '19 14:05 bigdaddybesbris

Hey, first of all thanks for this project, I really like it. Regarding the not working install via mas on the command line I came up with a workaround until another solution can be found. I maintain a github project which aims at automating install, customization and updates of macos. You can find it here: https://github.com/tiiiecherle/osx_install_config As part of homebrew install scrips I added a bash script that installs mas, opens the appstore via applescript and enters apple-id and password before closing the appstore to automate the complete process. The script prompts you for your credentials to use it later in the appstore. If you want to autmate it completely just export your credentials before running the script. The script can be found here. https://github.com/tiiiecherle/osx_install_config/blob/master/05_homebrew_and_casks/5b_homebrew_cask/6_mas_appstore.sh Be sure to download the complete folder 05_homebrew_and_casks and run the script from there without deleting the other scripts as it uses other scripts in the directory to check and define variables and components of the script to avoid redundant code in the other scripts in the same directory. Hope it helps anyone ;)

How do I integrate the automated App Store login into an already existing script? I'm working on scripting deployments to help make my job a little easier. A specific department requires Xcode and other plugins via brew, so I wrote a basic script to install the plugins and (hopefully) Xcode.

Just copy the respective variables, functions and parts of ~~https://github.com/tiiiecherle/osx_install_config/blob/master/05_homebrew_and_casks/5b_homebrew_cask/6_mas_appstore.sh~~ to your script and it should work.

Link Update due to project restructuring... https://github.com/tiiiecherle/osx_install_config/blob/master/03_homebrew_casks_and_mas/3b_homebrew_casks_and_mas_install/6_mas_appstore.sh

tiiiecherle avatar May 09 '19 16:05 tiiiecherle

For anyone looking for the login workaround in my script. I restructured my project. In the process the script folder was renamed and the script moved to a new location:

https://github.com/tiiiecherle/osx_install_config/blob/master/03_homebrew_casks_and_mas/3b_homebrew_casks_and_mas_install/6_mas_appstore.sh

tiiiecherle avatar May 12 '19 15:05 tiiiecherle

Has anyone looked at this? https://github.com/w0lfschild/macOS_headers/blob/master/macOS/PrivateFrameworks/StoreFoundation/8/ISAccountService-Protocol.h

Jarli01 avatar Sep 04 '19 15:09 Jarli01

@Jarli01 yes, this project uses class-dump as well to generate headers for the private frameworks. See ISAccountService.h

phatblat avatar Sep 07 '19 01:09 phatblat

has anyone found a way to do a signin without being able to actually launch the appstore? Its blocked by JamF... mas was working great for me, but i got signed out due to a password change. Now I can't sign back in because my company has decided to block access to the app store.

andysousa avatar Oct 28 '19 13:10 andysousa

has anyone found a way to do a signin without being able to actually launch the appstore? Its blocked by JamF... mas was working great for me, but i got signed out due to a password change. Now I can't sign back in because my company has decided to block access to the app store.

+1 here. If you have an option... :(

YannBrrd avatar Oct 28 '19 13:10 YannBrrd

Ha. sudo jamf removeMDMProfile removes all restrictions

sudo jamf manage brings back all restrictions and profiles More here and much more here

StevenACoffman avatar Oct 28 '19 13:10 StevenACoffman