MetaCubeX / mihomo

A simple Python Pydantic model for Honkai: Star Rail parsed data from the Mihomo API.
https://wiki.metacubex.one
MIT License
16.52k stars 2.65k forks source link

[Feature] 为 Clash Meta for Android 配置依赖与内核自动更新 #799

Closed stevejohnson7 closed 1 year ago

stevejohnson7 commented 1 year ago

Verify steps

Description

尝试在缺乏维护者的情况下暂时维持meta for android运转。计划写github actions 自动更新golang依赖和内核版本,根据内核升级自动推送新版。

Possible Solution

No response

cnxianyi commented 1 year ago

同问,再问问如果自己编译的话第一步 git submodule update --init --recursive 出现:

git submodule update --init --recursive                                        (main✱)
fatal: remote error: upload-pack: not our ref f91418967ebda8aab1c5952ee93c26acee5956be
fatal: Fetched in submodule path 'core/src/foss/golang/clash', but it did not contain f91418967ebda8aab1c5952ee93c26acee5956be. Direct fetching of that commit failed.

错误该怎么办/(ㄒoㄒ)/~~

qist commented 1 year ago

@cnxianyi 你要修改一下代码才可以默认使用的是android-open 分支的。git submodule update --force --recursive --init --remote

cnxianyi commented 1 year ago

@qist 又有新问题:最终构建时./gradlew app:assembleMeta-AlphaRelease 提示:

% ./gradlew app:assembleMeta-AlphaRelease                                                                         1 ↵ ✹

> Configure project :core
Checking the license for package SDK Patch Applier v4 in /opt/android-sdk/licenses
Warning: License for package SDK Patch Applier v4 not accepted.
Checking the license for package NDK (Side by side) 23.0.7599858 in /opt/android-sdk/licenses
Warning: License for package NDK (Side by side) 23.0.7599858 not accepted.

FAILURE: Build failed with an exception.

* What went wrong:
A problem occurred configuring project ':core'.
> com.android.builder.sdk.LicenceNotAcceptedException: Failed to install the following Android SDK packages as some licences have not been accepted.
     ndk;23.0.7599858 NDK (Side by side) 23.0.7599858
     patcher;v4 SDK Patch Applier v4
  To build this project, accept the SDK license agreements and install the missing components using the Android Studio SDK Manager.
  Alternatively, to transfer the license agreements from one workstation to another, see http://d.android.com/r/studio-ui/export-licenses.html

  Using Android SDK: /opt/android-sdk

* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 731ms

现在jdk是安装的 jdk17

% java --version                                                                                                  1 ↵ ✹
openjdk 17.0.8 2023-07-18
OpenJDK Runtime Environment (build 17.0.8+7-Debian-1deb12u1)
OpenJDK 64-Bit Server VM (build 17.0.8+7-Debian-1deb12u1, mixed mode, sharing)

安装openjdk 11 构建会提示jdk版本过低 就装了jdk17

许可证 sdkmanager --licenses 也都选y了 版本是官网最新的:

sdkmanager --version                                                                                                ✹
11.0

构建不出来了又

对了我是用的wsl2 debian12 会有影响吗

stevejohnson7 commented 1 year ago

@cnxianyi 构建的话github actions已经写好了,可以commit之后直接从actions拿,不需要本地编译。

cnxianyi commented 1 year ago

@stevejohnson7 fork完 直接在actions build_release Run workflow吗 需要修改默认分支android-open吗

stevejohnson7 commented 1 year ago

我这边试着在core/src/foss/golang下面go mod download会提示

@stevejohnson7 fork完 直接在actions build_release Run workflow吗 需要修改默认分支android-open吗

好像不需要,直接run就行。

话说core/src/foss/golang/里面那些依赖怎么更新,直接go mod download / go get -u报错 是需要core目录那个gradle子项目先构建完吗

cnxianyi commented 1 year ago

@stevejohnson7 构建了两次都是

Gradle build failed: see console output for details
stevejohnson7 commented 1 year ago

@cnxianyi go那边有依赖有问题。我看看

cnxianyi commented 1 year ago

@stevejohnson7 我这改了分支重新构建

[submodule "clash-foss"]
    path = core/src/foss/golang/clash
    url = https://github.com/MetaCubeX/Clash.Meta
    branch = Alpha # android-open

什么的都没用,一点进度没有

stevejohnson7 commented 1 year ago

有点麻烦了。。这android-open分支是单独维护的啊。。 那光这边GUI编译起来恐怕不够,那边内核也得有人维护更新才行

stevejohnson7 commented 1 year ago

alpha和android-open两个分支的区别是啥,为啥要分开维护emm 问问@stitchrs

stevejohnson7 commented 1 year ago

现在两个分支的内核在./core/src/foss/golang/go mod tidy都报错 已经拉取过对应的最新submodule,本地装的go 1.20 actions里面是怎么过的。。奇怪。。。

已经搞定

arkxfly commented 1 year ago

我也需要最新版的 meta 内核,不过尝试自己编译,报错🥲,搞不定

cnxianyi commented 1 year ago

怎么样能编译出新版了不

stevejohnson7 commented 1 year ago

怎么样能编译出新版了不

依赖更新搞定了,等会试试编译。 不过我这里把内核切到Alpha分支了,有一些安卓的patch要单独补一下。我后面再问问维护者

stevejohnson7 commented 1 year ago

Help wanted: 最近较忙,没太多时间深入读源码,切到Alpha之后编译有一些问题,欢迎大佬帮忙。 原来用安卓分支有一些安卓独有patch,换分支之后要适配。最新Alpha和android-open分支都试过了,编译均会报错,待后续有空改代码。 https://github.com/stevejohnson7/ClashMetaForAndroid/actions/runs/6583035264/job/17885437919?pr=7

主要修改:其实就写了一些actions。源码只是换了一下submodule目标分支。 https://github.com/MetaCubeX/ClashMetaForAndroid/compare/main...stevejohnson7:ClashMetaForAndroid:add-actions

Larvan2 commented 1 year ago

android-open 同步到 alpha了,可以尝试测试

stevejohnson7 commented 1 year ago

android-open 同步到 alpha了,可以尝试测试

巧了,正好刚刚也在本地把android rebase了之后在测编译。不过还是有些小问题 image https://github.com/stevejohnson7/ClashMetaForAndroid/actions/runs/6597682870/job/17924909457?pr=7

看起来像是android-open分支的patch未打完全的结果。 Kr238当时在cfa同样给自用的内核打了patch(https://github.com/Kr328/clash/commit/8e209eb9f7eb43046cab2429766b61fb6a1c1341 ),meta与之相比有遗漏,导致编译出错。

stevejohnson7 commented 1 year ago

编译已通过 https://github.com/stevejohnson7/ClashMetaForAndroid/actions/runs/6601370255

希望可以尽快合并此PR #812

stevejohnson7 commented 1 year ago

https://github.com/MetaCubeX/ClashMetaForAndroid/pull/147 已OK

arkxfly commented 1 year ago

大佬,今天能打包一个版本出来么?

stevejohnson7 commented 1 year ago

大佬,今天能打包一个版本出来么?

稍等,应该可以

cnxianyi commented 1 year ago

厉害啊666666

stevejohnson7 commented 1 year ago

大佬,今天能打包一个版本出来么?

wwqgtxx说先修修bug再发新版,再等等吧。目前直接去github release下最新的pre-release就行,昨天晚上更新过了

arkxfly commented 1 year ago

wwqgtxx说先修修bug再发新版,再等等吧。目前直接去github release下最新的pre-release就行,昨天晚上更新过了

这个能修吗? https://github.com/MetaCubeX/ClashMetaForAndroid/issues/154

CMFA 用着用着会无法上网,不知道是不是这个的原因?手机移动网都是有 IPv6 的,如果解析到 IPv6,tun 设备接收不了,就无法上网。

stevejohnson7 commented 1 year ago

wwqgtxx说先修修bug再发新版,再等等吧。目前直接去github release下最新的pre-release就行,昨天晚上更新过了

这个能修吗? MetaCubeX/ClashMetaForAndroid#154

CMFA 用着用着会无法上网,不知道是不是这个的原因?手机移动网都是有 IPv6 的,如果解析到 IPv6,tun 设备接收不了,就无法上网。

@wwqgtxx