NyaMisty / AltServer-Linux

AltServer for AltStore, but on-device

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

error for load so file on openwrt

zanjie1999 opened this issue · comments

j4125 with x64 openwrt

i dont know what need to opkg install

./AltServer-x86_64 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 = 5518; 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 "<string>", line 1, in <module> File "/usr/lib/python3.9/ctypes/__init__.py", line 374, in __init__ OSError: Error loading shared library: No such libdns_sd.sofile or directory

and i try to install libavahi-compat-libdnssd

with:

Configuring libexpat. Configuring libdbus. Configuring dbus. Configuring libavahi-dbus-support. Configuring libdaemon. Configuring avahi-dbus-daemon. Configuring libavahi-client. Configuring libavahi-compat-libdnssd.

then i get

. /AltServer-x86_64 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 = 13269; 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: -65537

Getting the same error trying to package this for NixOS:

No argument supplied, if you want for help, please use -h or --help
Not supplying ipa, running in server mode!
Running /nix/store/rpri9nb8xpwwqakyrqbg8zdslkjs2hd3-python3-3.10.11/bin/python command to advertise AltServer: from ctypes import *; dll = CDLL('/nix/store/m4qax5fxdfsgwn73k792zrdljfr61lsk-avahi-compat-0.8/lib/libdns_sd.so'); sdRef = c_int(); flags = 0; interfaceIndex = 0; name = None; regtype = br'_altserver._tcp'; domain = None; host = None; port = 59336; 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.10' 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

Error -65537 is kDNSServiceErr_Unknown, which is returned in this function when the sdref_new call here fails. sdref_new has multiple failure points but it's all avahi calls. I'm not familiar with the library and strace doesn't really tell me anything so I might need to debug it. Maybe it's also worth trying to rewrite this part against the native avahi API.

After hours of debugging, I found out that you need to set this in the avahi-daemon config.

[publish]
disable-publishing=no
disable-user-service-publishing=no

Hi @2xsaiko, I am also under NixOS, was wondering how you build the project?

I am getting this error:

AppleAPI+Authentication.cpp:9:10: fatal error: 'corecrypto/ccsrp.h' file not found
#include <corecrypto/ccsrp.h>
         ^~~~~~~~~~~~~~~~~~~~

Not sure how to include this header file. It seems to be in the darwin.Security package, but I can't build it on a Linux system, I think. Do you cross-compile it somehow?

I have it packaged (including dependencies) in my flake here: https://git.dblsaiko.net/systems/tree/packages/misc/altserver/default.nix

corecrypto is available from https://developer.apple.com/security/

nix build git+https://git.dblsaiko.net/systems#altserver

Very cool, thanks a lot!

@jul1u5 I just moved all packages and standalone modules to sourcehut:~dblsaiko/nix-extras, so if you're using the package/overlay, make sure to switch to that flake. There's also a NixOS module for AltServer in there if it's useful to you.

(If you want to reply something, please do via email instead of here, I don't want to spam this issue any more haha)