keengo99 / kangle

GNU General Public License v3.0
83 stars 24 forks source link

有人会用源码做一个安卓版app吗? #24

Open 1265578519 opened 2 years ago

1265578519 commented 2 years ago

有人会用源码做一个安卓版app吗?

做成apk安装包安装到手机上用,app运行后,进程打开监听端口,浏览器就可以管理kangle

然后放在Android/data/com.kangle.web/ 里面的bin etc文件夹等。

jcleng commented 1 year ago

可以参考这个jcleng/nix-kangle-3.5.13.2 配合 安卓软件 nix-on-droid 可以实现; 实际是利用nixpkg包管理器在arm上编译.

file ./bin/kangle 
# ./bin/kangle: ELF executable, 64-bit LSB arm64, dynamic (/nix/store/4x5rki118lkplnznf5qayl9wndv9xiia-glibc-2.34-210/lib/ld-linux-aarch64.so.1), not stripped
ldd ./bin/kangle 
        # /nix/store/4x5rki118lkplnznf5qayl9wndv9xiia-glibc-2.34-210/lib/ld-linux-aarch64.so.1 (0x3000000000)
        # libpthread.so.0 => /nix/store/4x5rki118lkplnznf5qayl9wndv9xiia-glibc-2.34-210/lib/ld-linux-aarch64.so.1 (0x3000000000)
        # libpcre.so.1 => /nix/store/xvwr47hpwzhkcqpzs1vmfkvhkdzky9qn-pcre-8.45/lib/libpcre.so.1 (0x73a71e3000)
        # libz.so.1 => /nix/store/4wjpvb2h0f817jkgkh7wcniw8fya8k9l-zlib-1.2.12/lib/libz.so.1 (0x73a71b8000)
        # libdl.so.2 => /nix/store/4x5rki118lkplnznf5qayl9wndv9xiia-glibc-2.34-210/lib/ld-linux-aarch64.so.1 (0x3000000000)
        # libaio.so.1 => /nix/store/gvkhica52k2vg69siwg9yqkikfyl8fg6-libaio-0.3.112/lib/libaio.so.1 (0x73a71a5000)
        # libstdc++.so.6 => /nix/store/zgplzyj5qgpg5pcqy2qgbilzr47jvbl2-gcc-9.3.0-lib/lib/libstdc++.so.6 (0x73a6fc2000)
        # libm.so.6 => /nix/store/4x5rki118lkplnznf5qayl9wndv9xiia-glibc-2.34-210/lib/ld-linux-aarch64.so.1 (0x3000000000)
        # libgcc_s.so.1 => /nix/store/4x5rki118lkplnznf5qayl9wndv9xiia-glibc-2.34-210/lib/libgcc_s.so.1 (0x73a6f9d000)
        # libc.so.6 => /nix/store/4x5rki118lkplnznf5qayl9wndv9xiia-glibc-2.34-210/lib/ld-linux-aarch64.so.1 (0x3000000000)
        # ld-linux-aarch64.so.1 => /nix/store/4x5rki118lkplnznf5qayl9wndv9xiia-glibc-2.34-210/lib/ld-linux-aarch64.so.1 (0x73a6f65000)
# nix-on-droid @ 💻  localhost in 📁  9rx3jbzkb88hjn0wcjlggp3bqhi2rrwi-kangle-3.5.13.2
neofetch 
#          -o          o-            nix-on-droid@localhost 
#           +hydNNNNdyh+             ---------------------- 
#         +mMMMMMMMMMMMMm+           OS: Android aarch64 
#       `dMMm:NMMMMMMN:mMMd`         Kernel: 4.14.186-g346ba8a51dd2 
#       hMMMMMMMMMMMMMMMMMMh         Uptime: 19579 days, 9 hours 
#   ..  yyyyyyyyyyyyyyyyyyyy  ..     Packages: 560 (nix-user) 
# .mMMm`MMMMMMMMMMMMMMMMMMMM`mMMm.   Shell: bash 5.1.16 
# :MMMM-MMMMMMMMMMMMMMMMMMMM-MMMM:   Terminal: vscode 
# :MMMM-MMMMMMMMMMMMMMMMMMMM-MMMM:   CPU: MT6877V/TZA (8) @ 2.000GHz 
# :MMMM-MMMMMMMMMMMMMMMMMMMM-MMMM:   Memory: 5009MiB / 7489MiB 
# :MMMM-MMMMMMMMMMMMMMMMMMMM-MMMM:
# -MMMM-MMMMMMMMMMMMMMMMMMMM-MMMM-                           
#  +yy+ MMMMMMMMMMMMMMMMMMMM +yy+                            
#       mMMMMMMMMMMMMMMMMMMm
#       `/++MMMMh++hMMMM++/`
#           MMMMo  oMMMM
#           MMMMo  oMMMM
#           oNMm-  -mMNs

./bin/kangle -d 3
# run as debug model(level=3).
# Thu Aug 10 09:01:06|cann't open pid file[/nix/store/9rx3jbzkb88hjn0wcjlggp3bqhi2rrwi-kangle-3.5.13.2//var/kangle.pid] fd=[-1]
# Thu Aug 10 09:01:06|kgl_aio_align_size=[512]
# Thu Aug 10 09:01:06|listen [0.0.0.0:8077] success
# Thu Aug 10 09:01:06|listen [0.0.0.0:3311] success

curl http://localhost:3311/
# <html><body>Please set the admin user and password in the file: <font color='red'>kangle_installed_path/etc/config.xml</font> like this:<font color=red><pre>&lt;admin user='admin' password='kangle' admin_ips='127.0.0.1|*'/&gt;</pre></font>
# The default admin user is admin, password is kangle</body></html>

如果不使用nix-on-droid而是使用普通的termux软件环境可以安装xmake, 根据这个项目jcleng/kangle进行xmake编译