NyaMisty / AltServer-Linux

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

App is killed. #51

Closed maxduke closed 2 years ago

maxduke commented 2 years ago

Hello,

I tried to run the latest X64 binary with the command AltServer -u [MYUUID] -a [MYAPPLEID] -p [MYPASSWD] ./AltStore.ipa I got the following output: Installing app... Killed

I tried to specify "-d", but it did not give additional information.

maxduke commented 2 years ago

If I run "./AltServer -d", then

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 = 39377; 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.8' 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: -65537

NyaMisty commented 2 years ago

Use strace ./AltServer 2>strace.log, then post the strace.log in attachment

maxduke commented 2 years ago

strace.log

maxduke commented 2 years ago

strace ./AltServer -u 00001111-000111D11A11111E -a test_acc@gmail.com -p test_pwd ./AltStore.ipa 2> strace_ipa.log strace_ipa.log

maxduke commented 2 years ago

strace ./AltServer -u 00001111-000111D11A11111E -a test_acc@gmail.com -p test_pwd ./AltStore.ipa 2> strace_ipa.log strace_ipa.log

From this "IPA" log file, it seems the issue is related to the kernel. ( The production environment is a Ubuntu Docker container and the host is a Synology NAS with kernel 3.10.105 )

maxduke commented 2 years ago

getrandom(0x7ffdf2cac798, 16, GRND_NONBLOCK) = -1 ENOSYS (Function not implemented) The kernel does not support the getrandom kernel call.

maxduke commented 2 years ago

I found a similar issue in https://community.suitecrm.com/t/suitecrm-on-synology-docker/75582. I tried to compile the binary in my local Synology NAS by following the GitHub action, but I got the same binary file with no luck. That means the output binary is still getrandom based even if I compile that in a non-getrandom supporting kernel.

I'm wondering if we can influence this during compiling.

NyaMisty commented 2 years ago

Added a polyfill getrandom in new commit: try this artifact: https://github.com/NyaMisty/AltServer-Linux/actions/runs/2197763813

maxduke commented 2 years ago

Great! The issue with getrandom is resolved! But the issue with running server mode is still there. Regarding the alt-anisette-server issue, I opened a separate one https://github.com/NyaMisty/alt-anisette-server/issues/1

NyaMisty commented 2 years ago

You didn't read the README carefully. You have to install the libdnssd package. See release readme for detail

maxduke commented 2 years ago

I did install libavahi-compat-libdnssd-dev before I run AltServer... libavahi-compat-libdnssd-dev is already the newest version (0.7-4ubuntu7.1).

If didn't install that package, then the error message is different:

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 = 21211; 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(); Traceback (most recent call last): File "", line 1, in File "/opt/lib/python3.10/ctypes/init.py", line 374, in init OSError: libdns_sd.so: cannot open shared object file: No such file or directory

NyaMisty commented 2 years ago

You have to run server together with avahi-daemon You have two choices:

  1. You can run avahi together in docker and bind physical network to the docker: use https://hub.docker.com/r/flungo/avahi
  2. You can run AltServer and avahi both directly on Synology NAS
maxduke commented 2 years ago

You have to run server together with avahi-daemon You have two choices:

  1. You can run avahi together in docker and bind physical network to the docker: use https://hub.docker.com/r/flungo/avahi
  2. You can run AltServer and avahi both directly on Synology NAS

Thank you. I've successfully run netmuxd and that can discover my device through WIFI. avahi-daemon is already there. I got DNSServiceRegister result: -65537 if I stop avahi-daemon , then DNSServiceRegister result: 0

I'm not sure what the correct result should be since I cannot get alt-anisette-server running yet (I've tried that hundreds of times...)

maxduke commented 2 years ago

DNSServiceRegister result: 0 is correct. Altstore is able to find the server. Now the only remaining issue is the alt-anisette-server.

NyaMisty commented 2 years ago

Don't be too demanding lol, simple find another VPS running higher kernel (at least 5.X)