powenn/AltServer-Linux-ShellScript

Can't make this work on RPI 3b

Closed this issue · 39 comments

Hey.
Maybe someone here can help me, becasue I'm becoming quite frustrated with this AltServer under Linux :)

I've got 2 spare Raspberry PI 3b and I'd like to us e one of them for an AltServer instance to install and refresh my AltStore.
No matter what I've tried, it simply never is working.

Running your Script it pulls the wrong AltServer and netmuxd - the RPI seems to run the armv71 architechture. I suppose armv7 is compatible, but I'm not sure about that.
So I manually download both - AltServer and netmuxd for armv7.
In addition I'm running an anisette server on my QNAP NAS.

So I've used export ALTSERVER_ANISETTE_SERVER="http://192.168.1.2:6969" (replaced with my IP).
But whenever I'm trying to install AltStore I get the 36607 error.
However when I curl this IP/Port I do receive the expected response.

So I've been searching around the internet and some said, that you might have to build the AltServer yourself.
I've tried that manually, but it's always throwing errors when trying to do so.
I've also tried to use altserverd (https://github.com/hkfuertes/altserverd), which once worked (three weeks ago), but I can't make it work again... It's simply not thowring the altserver file into the bin.

I've tried Raspberry Pi OS as well as dietpi.

Does anyone have any idea what I am doing wrong? :(

Thank you
André

-edit-
I FINALLY managed to build altserver using the docker container (not sure why it did work, but it did after I started it the second or third time...
And now I was also able to install AltStore + uyou+ to my phone.
However: next problem is, that I can't refresh either :D uyou+ doesn't show up in AltStore (it's installed though) and AltStore itself can't refresh because I get the 36607 error again. Also it looks like netmuxd (wifirefresh) isn't running.
I've figured out that this is due to the arch-check. So I've commented out line 6, 22-24, 113, 114 and 116.
I've downloaded the armv7 netmuxd from the new 0.1.3 release.
It looks like the script has tried to start netmuxd, but it's spamming Creating plist number so far :D
Right now AltStore on my phone tells me that it can't connect to AltServer.

Any idea regarding my new status? :) Is that plist spam normal and will this ever stop? It's running vor about an hour now.

Hey. Maybe someone here can help me, becasue I'm becoming quite frustrated with this AltServer under Linux :)

I've got 2 spare Raspberry PI 3b and I'd like to us e one of them for an AltServer instance to install and refresh my AltStore. No matter what I've tried, it simply never is working.

Running your Script it pulls the wrong AltServer and netmuxd - the RPI seems to run the armv71 architechture. I suppose armv7 is compatible, but I'm not sure about that. So I manually download both - AltServer and netmuxd for armv7. In addition I'm running an anisette server on my QNAP NAS.

So I've used export ALTSERVER_ANISETTE_SERVER="http://192.168.1.2:6969" (replaced with my IP). But whenever I'm trying to install AltStore I get the 36607 error. However when I curl this IP/Port I do receive the expected response.

So I've been searching around the internet and some said, that you might have to build the AltServer yourself. I've tried that manually, but it's always throwing errors when trying to do so. I've also tried to use altserverd (https://github.com/hkfuertes/altserverd), which once worked (three weeks ago), but I can't make it work again... It's simply not thowring the altserver file into the bin.

I've tried Raspberry Pi OS as well as dietpi.

Does anyone have any idea what I am doing wrong? :(

Thank you André

-edit- I FINALLY managed to build altserver using the docker container (not sure why it did work, but it did after I started it the second or third time... And now I was also able to install AltStore + uyou+ to my phone. However: next problem is, that I can't refresh either :D uyou+ doesn't show up in AltStore (it's installed though) and AltStore itself can't refresh because I get the 36607 error again. Also it looks like netmuxd (wifirefresh) isn't running. I've figured out that this is due to the arch-check. So I've commented out line 6, 22-24, 113, 114 and 116. I've downloaded the armv7 netmuxd from the new 0.1.3 release. It looks like the script has tried to start netmuxd, but it's spamming Creating plist number so far :D Right now AltStore on my phone tells me that it can't connect to AltServer.

Any idea regarding my new status? :) Is that plist spam normal and will this ever stop? It's running vor about an hour now.

hey fam, can ya try with the latest pre-release as of writing? it should almost work out of the box aside of having using jitterbug to create a file, which you then have to replace a 0000xxxetc.plist file in /var/lib/lockdown/ (not the system one)

Hey.
I'll be on vacation for the next week. Might be able to give it a shot the week after.
Do you maybe have some guidance for me on how to use jitterbug? I've checked that yesterday and it looks like I'd have to build it myself - however that didn't work.

Thanks
André

See: #43 (comment)

  1. Download the architecture of your choice here: https://github.com/powenn/AltServer-Linux-ShellScript/releases/tag/0.4.1
  2. unzip it
  3. Very important! only have to do this ONCE
    3a. Get: this: https://github.com/osy/Jitterbug/releases/tag/v1.3.1
    3b. Just download the one for your OS. (no need for the ipa)
    3c. plug with a cable into your computer, use c
    3d. unzip the jitterbug
    3e. now open cmd/powershell/bash etc
    3f. navigate to the directory where the exe is (tip! if you type CMD in the file explorer path, it'll open it in the right directory!)
    3g. just type in jitter (and hit tab)
    3h. it might not be able to pair, just open ya phone and trust the computer
    3i. try again and it should make the xxxxx01E.mobiledevicepairing file
    3j. now copy this file to computer running linus (just place it in the home dir, we'll get back to this later)
  4. I removed the certificate on my idevice, and first plugged it into my main pc, installed altstore on it.
  5. I also signed in, refreshed once more with cable
  6. then refresh but withoud cable (still works)
  7. refresh again but now i closed altserver on my win (fails, can't find the server)
  8. back to the linux machine, run the file with: sudo bash run.sh
    8a. At this point it might fail, or spam etc. you can type in e to exit out of the script.
  9. now copy again the mobiledevicepairing file to the location of: /var/lib/lockdown/xxxx01E.plist
    9a. you must only replace the simalair named file! not the system one, do this once and you should never have to replace that file again + wifi refresh should be fixed.
  10. run the script, it shouldn't spam (no need to choose anything either)
  11. refresh on your device withoud cable to anything, while pc is off/altserver on main pc is off. This should now work.
  12. Install cercube with: https://routinehub.co/shortcut/13064/ (yes shameless self-advert)
  13. Enjoy!

Oh nice. Didn’t know I can pair my phone on my PC and just copy the pairing file over.
i will give it a try once I’m back!

Cheers mate!

See: #43 (comment)

  1. Download the architecture of your choice here: https://github.com/powenn/AltServer-Linux-ShellScript/releases/tag/0.4.1
  2. unzip it
  3. Very important! only have to do this ONCE
    3a. Get: this: https://github.com/osy/Jitterbug/releases/tag/v1.3.1
    3b. Just download the one for your OS. (no need for the ipa)
    3c. plug with a cable into your computer, use c
    3d. unzip the jitterbug
    3e. now open cmd/powershell/bash etc
    3f. navigate to the directory where the exe is (tip! if you type CMD in the file explorer path, it'll open it in the right directory!)
    3g. just type in jitter (and hit tab)
    3h. it might not be able to pair, just open ya phone and trust the computer
    3i. try again and it should make the xxxxx01E.mobiledevicepairing file
    3j. now copy this file to computer running linus (just place it in the home dir, we'll get back to this later)
  4. I removed the certificate on my idevice, and first plugged it into my main pc, installed altstore on it.
  5. I also signed in, refreshed once more with cable
  6. then refresh but withoud cable (still works)
  7. refresh again but now i closed altserver on my win (fails, can't find the server)
  8. back to the linux machine, run the file with: sudo bash run.sh
    8a. At this point it might fail, or spam etc. you can type in e to exit out of the script.
  9. now copy again the mobiledevicepairing file to the location of: /var/lib/lockdown/xxxx01E.plist
    9a. you must only replace the simalair named file! not the system one, do this once and you should never have to replace that file again + wifi refresh should be fixed.
  10. run the script, it shouldn't spam (no need to choose anything either)
  11. refresh on your device withoud cable to anything, while pc is off/altserver on main pc is off. This should now work.
  12. Install cercube with: https://routinehub.co/shortcut/13064/ (yes shameless self-advert)
  13. Enjoy!

I have just given it another try (before we actually head off to our holidays).
it seems like the altserver is found. But I can’t refresh because I’m having the 36607 error again. The anisette server is running and also seems to be working.

Refreshing did. work over my pc. Without the script running and AltServer turned off on my PC I get the couldn’t find altserver error.
So I assume the wireless connection seems to be working. Now I’m running into the authentication issue again :(

ps: I had to adjust the script and added the armv7l otherwise netmuxd didn’t start.
The AltServer is also still the self build one.

it seems like the altserver is found. But I can’t refresh because I’m having the 36607 error again. The anisette server is running and also seems to be working.

interesting, so you also have the same issue...
i wonder if this is a problem in usbmuxd (not netmuxd!)

Are you using the pre-release btw? That version has armv7 in it and i do believe that's the one your using.

Can you give me the output of uname -m?

Yes I'm running the pre-release.
I've also just noticed that it's "spamming" this text again:
Listening on /var/run/usbmuxd
Adding device xxxx-xxxx01E
Removing xxxx-xxxx01E
Adding device xxxx-xxxx01E
Removing xxxx-xxxx01E

the uname output is "armv7l"
https://i.imgur.com/SCaJjt5.png

anisette

question, you used the armv7 i assume from netmuxd?

Given altstore is now installed and logged in. Can you turn off altserver on your pc, and run only the run.sh with: sudo bash run.sh (this is how i do it, i know it's not technically best practise). No need to interract with it, it starts in wifi mode by default.

Then ya should be able to refresh on your phone

anisette

question, you used the armv7 i assume from netmuxd?

Given altstore is now installed and logged in. Can you turn off altserver on your pc, and run only the run.sh with: sudo bash run.sh (this is how i do it, i know it's not technically best practise). No need to interract with it, it starts in wifi mode by default.

Then ya should be able to refresh on your phone

And need pair file with jitterbug

anisette

question, you used the armv7 i assume from netmuxd?

Given altstore is now installed and logged in. Can you turn off altserver on your pc, and run only the run.sh with: sudo bash run.sh (this is how i do it, i know it's not technically best practise). No need to interract with it, it starts in wifi mode by default.

Then ya should be able to refresh on your phone

That’s exactly what I’ve done, except that I’ve added the armv7l arch to the run.sh because otherwise netmuxd won’t start.

Before that I’ve created the pairing file using my win10 pc. I’ve renamed it to my myudid.plist and replaced the file in /bar/lib/lockdown (the one which was mentioned in the instructions above.

And I’ve set the environment variable to my anisetteserver running at 192.168.178.3:6969

-edit-
Oh and yes I’ve used the armv7 of netmuxd.

I might try the installation within docker on my NAS when I’m back.

the anisetteserver is completely new to me, i though altserver would have one of it's own.?
thx for the conformation on the arm one :) then my new pr should fix it in the right way.

strange that it isn't working for you however, i would say you've done it correctly and all

oh i'm curious about the docker one :D if that works i would love to switch over to that one!
then i can easily set it up for later use + make it more accessable for novice users!

I mean as you probably can tell, I’m really no expert :)
But what I’ve found is, that the anisette server is needed since Apple did some changes on their end. The 36607 error should be solved by hosting your own server.
https://github.com/NyaMisty/AltServer-Linux/releases

There it is mentioned as well.

I’m really not sure if I can make it work on my NAS, but I will give it a shot.

I mean as you probably can tell, I’m really no expert :) But what I’ve found is, that the anisette server is needed since Apple did some changes on their end. The 36607 error should be solved by hosting your own server. https://github.com/NyaMisty/AltServer-Linux/releases

There it is mentioned as well.

I’m really not sure if I can make it work on my NAS, but I will give it a shot.

interesting, didn't knew that was needed!

well i wouldn't call you new either :P haha thanks for sharing that anisette server, i think i'll play with that aswell

I think I finally got it working :)
Currently trying to install uYou+ using AltStore on my iPhone.

I think my issue 4 days ago was, that I didn't change the IP when I've set the environment variable... So completely my fault :(
Today I've tried it again and I was able to refresh the AltStore. Hopefully the installation works now as well :)
After that I only need to find a way to have it autostart on boot :)

Thanks a lot for your support!
Very appreciated!

I think I finally got it working :) Currently trying to install uYou+ using AltStore on my iPhone.

I think my issue 4 days ago was, that I didn't change the IP when I've set the environment variable... So completely my fault :( Today I've tried it again and I was able to refresh the AltStore. Hopefully the installation works now as well :) After that I only need to find a way to have it autostart on boot :)

Thanks a lot for your support! Very appreciated!

You can make it work on boot by using the systemd files I gave ya in the other issue

congrats on getting it to work!

Sorry for bringing this up again.
Is it normal that I get that "Adding device UDID" and "Removing device UDID" spam?
It's not nearly as often as the plist issue I had in the past. But it's coming up like every minute. (I don't care to much about it though, the installation of uyou+ was successful and refreshing also still working :))

Regarding those systemd files, can you maybe link me to where you've posted them? I was unable to find those :(

Sorry for bringing this up again. Is it normal that I get that "Adding device UDID" and "Removing device UDID" spam? It's not nearly as often as the plist issue I had in the past. But it's coming up like every minute. (I don't care to much about it though, the installation of uyou+ was successful and refreshing also still working :))

Regarding those systemd files, can you maybe link me to where you've posted them? I was unable to find those :(

That’s normal :) I forgot why but it’s ok!

you do have to edit these files yaself, so use google to understand how they work and all if needed!

#47 (comment)

Thank you.
I don't know why, but I can't make the autostart to work :)
I've tried services, I've tried rc.local and I've tried to run it from the .profile
The applications start running, I can see them in ps -aux
But AltStore on my phone keeps saying it can't find the server.

If I start the run.sh, it's working without any issues :)
Any idea? :(

Yes, that's working. I have to run netmuxd first though :)
I've also tried running the run.sh from rc.local. Again it's showing me the AltServer and netmuxd processes, but when trying to refresh, it's not working and I get the "couldn't find server" error.

Small steps ;)
If both are able to be run in terminal, let’s start netmuxd in terminal and start altserver with systemd, observe results and repeat but swap the two methodes.

it might be that one of the two isn’t working for some reason. Don’t restart the system but just stay and do it in terminal :).

I admit that I haven’t restarted yet with the systemd methode, but that’s because I didn’t specify when altserver may start, same for netmuxd (bc network should be up, then netmuxd, then altserver).

Yes, that's working. I have to run netmuxd first though :) I've also tried running the run.sh from rc.local. Again it's showing me the AltServer and netmuxd processes, but when trying to refresh, it's not working and I get the "couldn't find server" error.

actually...
what happens if you just restart both services after a reboot with systemd? (first netmuxd, then altserver)?
i wonder if it has more to do when what is started during boot with systemd services

So here's my findings:

  • using systemd services, netmuxd is actually not starting amongst altserver on reboot (ps -aux). Only altserver is starting up.
  • running netmuxd with systemd and AltServer manually, it's working
  • running netmuxd with systemd and starting AltServer as service, the server is found, but it runs into 36037 (or whatever it was) in Altstore, just like it can't find the anisette server again

It looks like it's somewhat both: an issue of the autostart order, as well as running altserver as service :)

-edit-
Actually, netmuxd doesn't start on boot at all. I have to run it manually as well (systemctl start netmuxd)

Yes, anisette is selfhosted.
You mean, run netmuxd (systemd)
Run altserver (systemd) -> get the 36067 error
Stop netmuxd (systemd)
Run netmuxd (systemd)

I still get the same 36067 error.

I guess I've made some progress now...
I'm trying to run it with a script now:

#!/bin/bash

sudo -b -S /home/dietpi/AltServer/netmuxd && /home/dietpi/AltServer/AltServer

The script is linked in the netmuxd.service:

[Unit]
Description=Run netmuxd in the background for wifi-refresh

[Service]
ExecStart=/bin/bash /home/dietpi/AltServer/altserver_service.sh

[Install]
WantedBy=multi-user.target

Running this manually (systemctl start netmuxd) does work.
However, when running it on boot (by the system) netmuxd again won't start. AltServer however is shown at ps -aux

-edit-
I was wrong.. I've rebooted and tried it again (running manually). Now I get the 36067 error again :)

Ok, last update for tonight ;o
I've done a complete reinstall based on raspbian rather than dietpi.
I still had to download AltServer and netmuxd manually, but apart from that everything was working like in your guide.

The service-part is kind of working. It doesn't work on boot. netmuxd won't start and I have no idea why. Not with seperate services, neither with my script.
However I've managed to get it reliably working when I start the service manually.
All I had to do is add the Environment to the service file.
So my servicefile looks like this now:

[Unit]
Description=Run netmuxd in the background for wifi-refresh

[Service]
Environment="ALTSERVER_ANISETTE_SERVER=http://192.168.178.3:6969"
ExecStart=/bin/bash /home/pi/AltServer/service.sh

[Install]
WantedBy=multi-user.target

My script looks like this:

#!/bin/bash

sudo -b /home/pi/AltServer/netmuxd && /home/pi/AltServer/AltServer

I've also tried a workaround by using the rc.local by starting the service from there - but again the same issue that netmuxd won't come up.
I feel like the permissions are different when services are start at boot and I have no idea how to get around this.
I actually give 777 chmod on AltServer and netmuxd. But still no luck :)

Maybe you got some further ideas.

-edit-
4 o'clock in the morning..
I FINALLY MADE IT!

The problem was, that the netmuxd service was coming up to fast. I've figured that one out, when I've had netmuxd fail again and checked the systemctl status "report".

pi@altserver:~ $ sudo systemctl status netmuxd.service
● netmuxd.service - Run netmuxd in the background for wifi-refresh
     Loaded: loaded (/etc/systemd/system/netmuxd.service; enabled; vendor preset: enabled)
     Active: failed (Result: exit-code) since Sat 2022-10-29 02:53:55 BST; 1min 0s ago
    Process: 333 ExecStart=/home/pi/AltServer/netmuxd (code=exited, status=1/FAILURE)
   Main PID: 333 (code=exited, status=1/FAILURE)
        CPU: 27ms

Oct 29 02:53:55 altserver systemd[1]: Started Run netmuxd in the background for wifi-refresh.
Oct 29 02:53:55 altserver netmuxd[333]: Starting netmuxd
Oct 29 02:53:55 altserver netmuxd[333]: Starting mDNS discovery for _apple-mobdev2._tcp.local with mdns
Oct 29 02:53:55 altserver netmuxd[333]: Listening on /var/run/usbmuxd
Oct 29 02:53:55 altserver netmuxd[333]: thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: Io(Os { code: 19, kind: Uncategorized, message: "No such device" })', src/mdns.rs:73:10

My thought was, that this mdns.rs file probably hasn't been generated yet.
So I've added a ExecStartPre=-/bin/sleep 10 to the service-file. et voilá, netmuxd came up on boot.

To make things cleaner for myself I've used the altserver.service and added a sleep to my script. So in total my setup looks like this now:
altserver.service:

[Unit]
Description=Run netmuxd in the background for wifi-refresh

[Service]
Environment="ALTSERVER_ANISETTE_SERVER=http://192.168.178.3:6969"
ExecStart=/bin/bash /home/pi/AltServer/service.sh

[Install]
WantedBy=multi-user.target

service.sh (at /home/pi/AltServer/service.sh)

#!/bin/bash

sleep 10 && sudo -b /home/pi/AltServer/netmuxd && /home/pi/AltServer/AltServer

Finally going to bed - good night :D

Looks like you are answering your mails :)
I've edited my post. I've finally figured out what I was doing wrong.
I'm using my script now and added a sleep. Now it's working great.

I'm still playing around with this though. I'd like to find a way to install/update apps from the raspberry pi rather than opening AltStore and install it from there (because big installations like uyou+ take ages and I'd rather not have AltStore running in the foreground all the time). This didn't work yet though.

Installing or updating doesn’t work through WiFi
And I’m not sure if it would work, I have a shortcut that installs an ipa. But it can’t run/open a app if the device is locked.

and yea saw it later, congrats however with making it work!

Maybe I'm wrong, but for the installation it still needs to open AltStore, right? Might have to check your shortcut again, because I actually have one that does download the ipa and then opens it in AltStore. But AltStore needs to stay open, otherwise most installations will fail on my end :(

true, hence i don't think you can fully automate it like so.
if altstore allowed 3rd party sources (custom) then you would get a notification when a new version is out and install that new version with ease :P
Think it's best to wait or pay for that

I sadly can't really work on this project anymore as i dont have an apple account that works with this sadly
I think best i/we can do is to add this service file instead of mines and use systemd instead of pid to manage the process (and having it work in the background)

nvm realised i could use someone else's heh

I think these two are a bit better ;)

root@kliko:/etc/systemd/system # cat altserver.service
[Unit]
Description=Run netmuxd and Altserver in the background for wifi-refresh
After=netmuxd.service

[Service]
Environment="ALTSERVER_ANISETTE_SERVER=http://192.168.178.3:6969"
ExecStart=/home/macley/AltServer-aarch64/AltServer

[Install]
WantedBy=multi-user.target
root@kliko:/etc/systemd/system # cat netmuxd.service
[Unit]
Description=Run netmuxd in the background for wifi-refresh

[Service]
Type=simple
Environment="ALTSERVER_ANISETTE_SERVER=http://192.168.178.3:6969"
ExecStartPre=/usr/bin/sleep 10
ExecStart=/home/macley/AltServer-aarch64/netmuxd

[Install]
WantedBy=multi-user.target

Also the 10 seconds really are needed :D thx!

Yeah that’s probably cleaner :)
Well done :)

ps: Environment="ALTSERVER_ANISETTE_SERVER=http://192.168.178.3:6969" is needed in the altserver.service

Yeah that’s probably cleaner :) Well done :)

ps: Environment="ALTSERVER_ANISETTE_SERVER=http://192.168.178.3:6969" is needed in the altserver.service

oh, strange it somehow is working for me on a reboot, i'll just add it in to be sure thx!

I've been playing around with this again :)
Since I've cleared up some resources on my rpi 4, I've tried it there, running ubuntu 22 64bit.
It's working out of the box.

I've tried playing around with provision (https://github.com/Dadoum/Provision) which provides an anisette-server.
Unfortunately I'm running into a very strange error when trying to refresh: "not an object"
I've reported this to the provision dev, however he thinks the error is within AltStore. So yeah, for the moment it looks like I can't make this work on the RPI alone :(

-edit-
Got provision working as well now!
So the entire AltStore process is running on one RPI now :) I'm happy!