Skip to content

Commit d62e6f7

Browse files
committed
Merge remote-tracking branch 'nonint/main'
Implement the environment credential code (again) from Dadoum#40 Remove old fix 570a3a6 from steilerDev/Sideloader to allow merge
2 parents 912bb15 + 5ba18dc commit d62e6f7

File tree

2 files changed

+15
-8
lines changed

2 files changed

+15
-8
lines changed

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,8 @@ Optional arguments:
5555
-h, --help Show this help message and exit
5656
```
5757

58+
Additionally, AppleID user and password can be set via the environment variables `APPLE_ID_USER` and `APPLE_ID_PWD`.
59+
5860
Table of Contents
5961
=================
6062

frontends/cli/source/cli_frontend.d

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -110,24 +110,29 @@ DeveloperSession login(Device device, ADI adi, bool interactive) {
110110
// ...
111111

112112
if (account) return null;
113-
if (!interactive) {
113+
string appleId = environment.get("APPLE_ID_USER");
114+
string password = environment.get("APPLE_ID_PWD");
115+
if(interactive && (appleId is null || password is null)) {
116+
log.info("Please enter your account informations. They will only be sent to Apple servers.");
117+
log.info("See it for yourself at https://github.com/Dadoum/Sideloader/");
118+
119+
write("Apple ID: ");
120+
appleId = readln().chomp();
121+
password = readPasswordLine("Password: ");
122+
}
123+
124+
if (appleId is null || password is null) {
114125
log.error("You are not logged in. (use `sidestore login` to log-in, or add `-i` to make us ask you the account)");
115126
return null;
116127
}
117128

118-
log.info("Please enter your account informations. They will only be sent to Apple servers.");
119-
log.info("See it for yourself at https://github.com/Dadoum/Sideloader/");
120-
121-
write("Apple ID: ");
122-
string appleId = readln().chomp();
123-
string password = readPasswordLine("Password: ");
124-
125129
return DeveloperSession.login(
126130
device,
127131
adi,
128132
appleId,
129133
password,
130134
(sendCode, submitCode) {
135+
if(!interactive) return;
131136
sendCode();
132137
string code;
133138
do {

0 commit comments

Comments
 (0)