NyaMisty / AltServer-Linux

AltServer for AltStore, but on-device
GNU Affero General Public License v3.0
946 stars 73 forks source link

AltServer cant find device WiFi #67

Closed PandaPootchy closed 1 year ago

PandaPootchy commented 1 year ago

image this is installed on ubuntu server on a raspberry pi and i get this error when trying to refresh and on my phone it refreshes and then when it completes it says it cant connect to altserver. Also this is when refreshing apps over WiFi.

PandaPootchy commented 1 year ago

So idk how this now works right but I basically started usbmuxd then started netmuxd without any arguments then just ran alt server and now it works just fine. So if anyone else is having this issue this is how to fix it.

Staubgeborener commented 1 year ago

@PandaPootchy did you stopped usbmuxd at a specific step or do you run usbmuxd together with netmuxd? Do you run netmuxd with screen or just in a different terminal/tab?

Running netmuxd without any arguments leads me to this error:

Starting netmuxd
Starting mDNS discovery
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: Os { code: 98, kind: AddrInUse, message: "Address already in use" }', src/main.rs:151:75
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

So step by step what i did so far without success:

  1. Connect iPhone to Linux-Environment with USB-Cable

  2. Run idevicepair pair and confirm this on the iPhone screen, after that idevice_id detected the iPhone over USB-Cable (no wifi)

  3. unplug USB-cable from iPhone and start netmuxd in his own terminal tab without argument (see error above), so i started it like netmuxd --disable-unix --host 127.0.0.1 (see this)

  4. Get this message from netmuxd

    Starting netmuxd
    Starting mDNS discovery
    Listening on 127.0.0.1:27015
    WARNING: Running in host mode will not work unless you are running a daemon in unix mode as well
    Adding device 00008020-00011DA40A50003A
    thread 'tokio-runtime-worker' panicked at 'range end index 508 out of range for slice of length 16', src/raw_packet.rs:62:22

    Sometimes also with this endless error message:

    [2022-07-31T07:23:46Z ERROR netmuxd::heartbeat] Failed to create heartbeat client for udid UDID-FROM-DEVICE-UNDER-VAR/LIB/LOCKDOWN/: UnknownError

    where UDID-FROM-DEVICE-UNDER-VAR/LIB/LOCKDOWN/ seems to be the UUID of my iPhone

  5. open a new tab in terminal and enter export USBMUXD_SOCKET_ADDRESS=127.0.0.1:27015

  6. start Altserver ./AltServer and get this message

    No argument supplied, if you want for help, please use -h or --help
    Not supplying ipa, running in server mode!
    Running python3 command to advertise AltServer: from ctypes import *; dll = CDLL('libdns_sd.so'); sdRef = c_int(); flags = 0; interfaceIndex = 0; name = None; regtype = br'_altserver._tcp'; domain = None; host = None; port = 28585; txtLen = 17; txtRecord = b'\x10\x73\x65\x72\x76\x65\x72\x49\x44\x3D\x31\x32\x33\x34\x35\x36\x37'; ret = dll.DNSServiceRegister(byref(sdRef), flags, interfaceIndex, name, regtype, domain, host, port, txtLen, txtRecord, None, None); print('DNSServiceRegister result: %d' % ret); from threading import Event; Event().wait(); 
    *** WARNING *** The program 'python3.9' uses the Apple Bonjour compatibility layer of Avahi.
    *** WARNING *** Please fix your application to use the native API of Avahi!
    *** WARNING *** For more information see <http://0pointer.de/blog/projects/avahi-compat.html>
    DNSServiceRegister result: 0

After pressing "Refresh All" in AltStore App on my iPhone (wifi, no cable!) something happens in terminal:

Represented Value: 596
Sent Bytes Count: 4 (4)
Sent Data: 4 Bytes
Sent Bytes Count: 596 (596)
Sent Data: 596 Bytes
Finished handling request!
Other Socket:7. Port: 52135. Error: 0
Receiving request size...
Checking socket: 7
Received bytes: 4(of 4)
Receiving 33783 bytes...
Checking socket: 7
Received bytes: 1448(of 33783)
Checking socket: 7
Received bytes: 4344(of 33783)
Checking socket: 7
Received bytes: 8440(of 33783)
Checking socket: 7
Received bytes: 10136(of 33783)
Checking socket: 7
Received bytes: 11584(of 33783)
Checking socket: 7
Received bytes: 14480(of 33783)
Checking socket: 7
Received bytes: 18576(of 33783)
Checking socket: 7
Received bytes: 22672(of 33783)
Checking socket: 7
Received bytes: 26768(of 33783)
Checking socket: 7
Received bytes: 30864(of 33783)
Checking socket: 7
Received bytes: 31856(of 33783)
Checking socket: 7
Received bytes: 33304(of 33783)
Checking socket: 7
Received bytes: 33783(of 33783)
Represented Value: 86
Sent Bytes Count: 4 (4)
Sent Data: 4 BytesFailed 
to handle request:AltServSent Bytes Count: 86 (86)er could not find the device.

Sent Data: 86 Bytes
^CTraceback (most recent call last):
  File "<string>", line 1, in <module>

[user@nuc AltServer-Linux-ShellScript]$ ./AltServer
No argument supplied, if you want for help, please use -h or --help
Not supplying ipa, running in server mode!
Running python3 command to advertise AltServer: from ctypes import *; dll = CDLL('libdns_sd.so'); sdRef = c_int(); flags = 0; interfaceIndex = 0; name = None; regtype = br'_altserver._tcp'; domain = None; host = None; port = 28585; txtLen = 17; txtRecord = b'\x10\x73\x65\x72\x76\x65\x72\x49\x44\x3D\x31\x32\x33\x34\x35\x36\x37'; ret = dll.DNSServiceRegister(byref(sdRef), flags, interfaceIndex, name, regtype, domain, host, port, txtLen, txtRecord, None, None); print('DNSServiceRegister result: %d' % ret); from threading import Event; Event().wait(); 
*** WARNING *** The program 'python3.9' uses the Apple Bonjour compatibility layer of Avahi.
*** WARNING *** Please fix your application to use the native API of Avahi!
*** WARNING *** For more information see <http://0pointer.de/blog/projects/avahi-compat.html>
DNSServiceRegister result: 0
Other Socket:7. Port: 52136. Error: 0
Receiving request size...
Checking socket: 7
Received bytes: 4(of 4)
Receiving 48 bytes...
Checking socket: 7
Received bytes: 48(of 48)
Received response status code: 200
parse anisette data ret
Got anisetteData json: {"X-Apple-I-Client-Time":"2022-07-31T07:25:53Z","X-Apple-
[...]
Device Description: <iMac11,3> <Mac OS X;10.15.6;19G2021> <com.apple.AuthKit/1 (com.apple.dt.Xcode/3594.4.19)>
Date: 2022-07-31T06:25:53Z
Represented Value: 596
Sent Bytes Count: 4 (4)
Sent Data: 4 Bytes
Sent Bytes Count: 596 (596)
Sent Data: 596 Bytes
Finished handling request!
Other Socket:7. Port: 52140. Error: 0
Receiving request size...
Checking socket: 7
Received bytes: 4(of 4)
Receiving 33776 bytes...
Checking socket: 7
Received bytes: 1448(of 33776)
Checking socket: 7
Received bytes: 4344(of 33776)
Checking socket: 7
Received bytes: 8440(of 33776)
Checking socket: 7
Received bytes: 10136(of 33776)
Checking socket: 7
Received bytes: 11584(of 33776)
Checking socket: 7
Received bytes: 14480(of 33776)
Checking socket: 7
Received bytes: 18576(of 33776)
Checking socket: 7
Received bytes: 22672(of 33776)
Checking socket: 7
Received bytes: 26768(of 33776)
Checking socket: 7
Received bytes: 30864(of 33776)
Checking socket: 7
Received bytes: 31856(of 33776)
Checking socket: 7
Received bytes: 33776(of 33776)
Represented Value: 86
Sent Bytes Count: 4 (4)
Sent Data: 4 Bytes
Failed to handle request:AltServer could not find the device.
Sent Bytes Count: 86 (86)
Sent Data: 86 Bytes

Again we can see Failed to handle request:AltServer could not find the device., also my iPhone displays AltServer could not find this device. Make sure you have trusted this device with your computer and WiFi sync is enabled. Like i said, i trusted the computer with idevicepair pair and also WiFi sync is enabled with iTunes.

PandaPootchy commented 1 year ago

i think it worked by starting usbmuxd then netmuxd then altserver

PandaPootchy commented 1 year ago

@Staubgeborener yea was doing some testing today and set it up like u did and I got the heartbeat error. What I did is I got a script that runs usbmuxd then does sudo netmuxd on screen and also starts the altserver on a screen as well.

Staubgeborener commented 1 year ago

@Staubgeborener yea was doing some testing today and set it up like u did and I got the heartbeat error. What I did is I got a script that runs usbmuxd then does sudo netmuxd on screen and also starts the altserver on a screen as well.

Yeah so I created a symlink for altserver so I can just run it via AltServer, netmuxd is a systemd. With that I created the following cronjob which is working fine @reboot sleep 10 sudo systemctl restart netmuxddeamon && AltServer

I don't know why but I need this sleep encounter.