diff --git a/README.md b/README.md index cb620d6..92d70e6 100644 --- a/README.md +++ b/README.md @@ -50,6 +50,8 @@ Optional arguments: -h, --help Show this help message and exit ``` +Additionally, AppleID user and password can be set via the environment variables `APPLE_ID_USER` and `APPLE_ID_PWD`. + Table of Contents ================= diff --git a/frontends/cli/source/cli_frontend.d b/frontends/cli/source/cli_frontend.d index 5ee2779..24045e9 100644 --- a/frontends/cli/source/cli_frontend.d +++ b/frontends/cli/source/cli_frontend.d @@ -109,24 +109,29 @@ DeveloperSession login(Device device, ADI adi, bool interactive) { // ... if (account) return null; - if (!interactive) { + string appleId = environment.get("APPLE_ID_USER"); + string password = environment.get("APPLE_ID_PWD"); + if(interactive && (appleId is null || password is null)) { + log.info("Please enter your account informations. They will only be sent to Apple servers."); + log.info("See it for yourself at https://github.com/Dadoum/Sideloader/"); + + write("Apple ID: "); + appleId = readln().chomp(); + password = readPasswordLine("Password: "); + } + + if (appleId is null || password is null) { log.error("You are not logged in. (use `sidestore login` to log-in, or add `-i` to make us ask you the account)"); return null; } - log.info("Please enter your account informations. They will only be sent to Apple servers."); - log.info("See it for yourself at https://github.com/Dadoum/Sideloader/"); - - write("Apple ID: "); - string appleId = readln().chomp(); - string password = readPasswordLine("Password: "); - return DeveloperSession.login( device, adi, appleId, password, (sendCode, submitCode) { + if(!interactive) return; sendCode(); string code; do { diff --git a/source/usbmuxd/c.d b/source/usbmuxd/c.d index 69cc8f5..12b2a2d 100644 --- a/source/usbmuxd/c.d +++ b/source/usbmuxd/c.d @@ -32,7 +32,7 @@ version (Windows) { } else version (OSX) { enum libusbmuxd = LibImport("libusbmuxd-2.0.6.dylib"); } else { - enum libusbmuxd = LibImport("libusbmuxd-2.0.so.6", "libusbmuxd.so.2"); + enum libusbmuxd = LibImport("libusbmuxd-2.0.so.6", "libusbmuxd.so.2", "libusbmuxd-2.0.so"); } mixin makeBindings;