set GIT_VERSION to core

This commit is contained in:
wwqgtxx 2024-10-05 11:02:26 +08:00
parent aea7edd2f8
commit d79fbf2519
3 changed files with 8 additions and 5 deletions

View File

@ -19,8 +19,9 @@ Java_com_github_kr328_clash_core_bridge_Bridge_nativeInit(JNIEnv *env, jobject t
scoped_string _home = get_string(home);
scoped_string _version_name = get_string(version_name);
char* _git_version = make_String(GIT_VERSION);
coreInit(_home, _version_name, sdk_version);
coreInit(_home, _version_name, _git_version, sdk_version);
}
JNIEXPORT void JNICALL

View File

@ -16,9 +16,10 @@ import (
var errBlocked = errors.New("blocked")
func Init(home, versionName string, platformVersion int) {
log.Infoln("Init core, home: %s, versionName: %s, platformVersion: %d", home, versionName, platformVersion)
func Init(home, versionName, gitVersion string, platformVersion int) {
log.Infoln("Init core, home: %s, versionName: %s, gitVersion: %s, platformVersion: %d", home, versionName, gitVersion, platformVersion)
constant.SetHomeDir(home)
constant.Version = gitVersion
app.ApplyVersionName(versionName)
app.ApplyPlatformVersion(platformVersion)

View File

@ -23,12 +23,13 @@ func main() {
}
//export coreInit
func coreInit(home, versionName C.c_string, sdkVersion C.int) {
func coreInit(home, versionName, gitVersion C.c_string, sdkVersion C.int) {
h := C.GoString(home)
v := C.GoString(versionName)
g := C.GoString(gitVersion)
s := int(sdkVersion)
delegate.Init(h, v, s)
delegate.Init(h, v, g, s)
reset()
}