mirror of
https://ghfast.top/https://github.com/StarCitizenToolBox/app.git
synced 2025-06-28 10:14:45 +08:00
feat: RSILauncherEnhance
This commit is contained in:
@ -3,6 +3,7 @@
|
||||
|
||||
// ignore_for_file: unused_import, unused_element, unnecessary_import, duplicate_ignore, invalid_use_of_internal_member, annotate_overrides, non_constant_identifier_names, curly_braces_in_flow_control_structures, prefer_const_literals_to_create_immutables, unused_field
|
||||
|
||||
import 'api/asar_api.dart';
|
||||
import 'api/http_api.dart';
|
||||
import 'api/rs_process.dart';
|
||||
import 'api/win32_api.dart';
|
||||
@ -37,6 +38,10 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl<RustLibWire> {
|
||||
@protected
|
||||
bool dco_decode_bool(dynamic raw);
|
||||
|
||||
@protected
|
||||
RsiLauncherAsarData dco_decode_box_autoadd_rsi_launcher_asar_data(
|
||||
dynamic raw);
|
||||
|
||||
@protected
|
||||
int dco_decode_box_autoadd_u_64(dynamic raw);
|
||||
|
||||
@ -46,6 +51,9 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl<RustLibWire> {
|
||||
@protected
|
||||
List<String> dco_decode_list_String(dynamic raw);
|
||||
|
||||
@protected
|
||||
List<int> dco_decode_list_prim_u_8_loose(dynamic raw);
|
||||
|
||||
@protected
|
||||
Uint8List dco_decode_list_prim_u_8_strict(dynamic raw);
|
||||
|
||||
@ -79,6 +87,9 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl<RustLibWire> {
|
||||
@protected
|
||||
RsProcessStreamDataType dco_decode_rs_process_stream_data_type(dynamic raw);
|
||||
|
||||
@protected
|
||||
RsiLauncherAsarData dco_decode_rsi_launcher_asar_data(dynamic raw);
|
||||
|
||||
@protected
|
||||
RustHttpResponse dco_decode_rust_http_response(dynamic raw);
|
||||
|
||||
@ -115,6 +126,10 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl<RustLibWire> {
|
||||
@protected
|
||||
bool sse_decode_bool(SseDeserializer deserializer);
|
||||
|
||||
@protected
|
||||
RsiLauncherAsarData sse_decode_box_autoadd_rsi_launcher_asar_data(
|
||||
SseDeserializer deserializer);
|
||||
|
||||
@protected
|
||||
int sse_decode_box_autoadd_u_64(SseDeserializer deserializer);
|
||||
|
||||
@ -124,6 +139,9 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl<RustLibWire> {
|
||||
@protected
|
||||
List<String> sse_decode_list_String(SseDeserializer deserializer);
|
||||
|
||||
@protected
|
||||
List<int> sse_decode_list_prim_u_8_loose(SseDeserializer deserializer);
|
||||
|
||||
@protected
|
||||
Uint8List sse_decode_list_prim_u_8_strict(SseDeserializer deserializer);
|
||||
|
||||
@ -162,6 +180,10 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl<RustLibWire> {
|
||||
RsProcessStreamDataType sse_decode_rs_process_stream_data_type(
|
||||
SseDeserializer deserializer);
|
||||
|
||||
@protected
|
||||
RsiLauncherAsarData sse_decode_rsi_launcher_asar_data(
|
||||
SseDeserializer deserializer);
|
||||
|
||||
@protected
|
||||
RustHttpResponse sse_decode_rust_http_response(SseDeserializer deserializer);
|
||||
|
||||
@ -212,6 +234,15 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl<RustLibWire> {
|
||||
return cst_encode_list_prim_u_8_strict(utf8.encoder.convert(raw));
|
||||
}
|
||||
|
||||
@protected
|
||||
ffi.Pointer<wire_cst_rsi_launcher_asar_data>
|
||||
cst_encode_box_autoadd_rsi_launcher_asar_data(RsiLauncherAsarData raw) {
|
||||
// Codec=Cst (C-struct based), see doc to use other codecs
|
||||
final ptr = wire.cst_new_box_autoadd_rsi_launcher_asar_data();
|
||||
cst_api_fill_to_wire_rsi_launcher_asar_data(raw, ptr.ref);
|
||||
return ptr;
|
||||
}
|
||||
|
||||
@protected
|
||||
ffi.Pointer<ffi.Uint64> cst_encode_box_autoadd_u_64(int raw) {
|
||||
// Codec=Cst (C-struct based), see doc to use other codecs
|
||||
@ -228,6 +259,15 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl<RustLibWire> {
|
||||
return ans;
|
||||
}
|
||||
|
||||
@protected
|
||||
ffi.Pointer<wire_cst_list_prim_u_8_loose> cst_encode_list_prim_u_8_loose(
|
||||
List<int> raw) {
|
||||
// Codec=Cst (C-struct based), see doc to use other codecs
|
||||
final ans = wire.cst_new_list_prim_u_8_loose(raw.length);
|
||||
ans.ref.ptr.asTypedList(raw.length).setAll(0, raw);
|
||||
return ans;
|
||||
}
|
||||
|
||||
@protected
|
||||
ffi.Pointer<wire_cst_list_prim_u_8_strict> cst_encode_list_prim_u_8_strict(
|
||||
Uint8List raw) {
|
||||
@ -281,6 +321,13 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl<RustLibWire> {
|
||||
return raw.toInt();
|
||||
}
|
||||
|
||||
@protected
|
||||
void cst_api_fill_to_wire_box_autoadd_rsi_launcher_asar_data(
|
||||
RsiLauncherAsarData apiObj,
|
||||
ffi.Pointer<wire_cst_rsi_launcher_asar_data> wireObj) {
|
||||
cst_api_fill_to_wire_rsi_launcher_asar_data(apiObj, wireObj.ref);
|
||||
}
|
||||
|
||||
@protected
|
||||
void cst_api_fill_to_wire_record_string_string(
|
||||
(String, String) apiObj, wire_cst_record_string_string wireObj) {
|
||||
@ -296,6 +343,15 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl<RustLibWire> {
|
||||
wireObj.rs_pid = cst_encode_u_32(apiObj.rsPid);
|
||||
}
|
||||
|
||||
@protected
|
||||
void cst_api_fill_to_wire_rsi_launcher_asar_data(
|
||||
RsiLauncherAsarData apiObj, wire_cst_rsi_launcher_asar_data wireObj) {
|
||||
wireObj.asar_path = cst_encode_String(apiObj.asarPath);
|
||||
wireObj.main_js_path = cst_encode_String(apiObj.mainJsPath);
|
||||
wireObj.main_js_content =
|
||||
cst_encode_list_prim_u_8_strict(apiObj.mainJsContent);
|
||||
}
|
||||
|
||||
@protected
|
||||
void cst_api_fill_to_wire_rust_http_response(
|
||||
RustHttpResponse apiObj, wire_cst_rust_http_response wireObj) {
|
||||
@ -354,6 +410,10 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl<RustLibWire> {
|
||||
@protected
|
||||
void sse_encode_bool(bool self, SseSerializer serializer);
|
||||
|
||||
@protected
|
||||
void sse_encode_box_autoadd_rsi_launcher_asar_data(
|
||||
RsiLauncherAsarData self, SseSerializer serializer);
|
||||
|
||||
@protected
|
||||
void sse_encode_box_autoadd_u_64(int self, SseSerializer serializer);
|
||||
|
||||
@ -363,6 +423,9 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl<RustLibWire> {
|
||||
@protected
|
||||
void sse_encode_list_String(List<String> self, SseSerializer serializer);
|
||||
|
||||
@protected
|
||||
void sse_encode_list_prim_u_8_loose(List<int> self, SseSerializer serializer);
|
||||
|
||||
@protected
|
||||
void sse_encode_list_prim_u_8_strict(
|
||||
Uint8List self, SseSerializer serializer);
|
||||
@ -403,6 +466,10 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl<RustLibWire> {
|
||||
void sse_encode_rs_process_stream_data_type(
|
||||
RsProcessStreamDataType self, SseSerializer serializer);
|
||||
|
||||
@protected
|
||||
void sse_encode_rsi_launcher_asar_data(
|
||||
RsiLauncherAsarData self, SseSerializer serializer);
|
||||
|
||||
@protected
|
||||
void sse_encode_rust_http_response(
|
||||
RustHttpResponse self, SseSerializer serializer);
|
||||
@ -464,6 +531,49 @@ class RustLibWire implements BaseWire {
|
||||
late final _store_dart_post_cobject = _store_dart_post_cobjectPtr
|
||||
.asFunction<void Function(DartPostCObjectFnType)>();
|
||||
|
||||
void wire_get_rsi_launcher_asar_data(
|
||||
int port_,
|
||||
ffi.Pointer<wire_cst_list_prim_u_8_strict> asar_path,
|
||||
) {
|
||||
return _wire_get_rsi_launcher_asar_data(
|
||||
port_,
|
||||
asar_path,
|
||||
);
|
||||
}
|
||||
|
||||
late final _wire_get_rsi_launcher_asar_dataPtr = _lookup<
|
||||
ffi.NativeFunction<
|
||||
ffi.Void Function(
|
||||
ffi.Int64, ffi.Pointer<wire_cst_list_prim_u_8_strict>)>>(
|
||||
'frbgen_starcitizen_doctor_wire_get_rsi_launcher_asar_data');
|
||||
late final _wire_get_rsi_launcher_asar_data =
|
||||
_wire_get_rsi_launcher_asar_dataPtr.asFunction<
|
||||
void Function(int, ffi.Pointer<wire_cst_list_prim_u_8_strict>)>();
|
||||
|
||||
void wire_rsi_launcher_asar_data_write_main_js(
|
||||
int port_,
|
||||
ffi.Pointer<wire_cst_rsi_launcher_asar_data> that,
|
||||
ffi.Pointer<wire_cst_list_prim_u_8_loose> content,
|
||||
) {
|
||||
return _wire_rsi_launcher_asar_data_write_main_js(
|
||||
port_,
|
||||
that,
|
||||
content,
|
||||
);
|
||||
}
|
||||
|
||||
late final _wire_rsi_launcher_asar_data_write_main_jsPtr = _lookup<
|
||||
ffi.NativeFunction<
|
||||
ffi.Void Function(
|
||||
ffi.Int64,
|
||||
ffi.Pointer<wire_cst_rsi_launcher_asar_data>,
|
||||
ffi.Pointer<wire_cst_list_prim_u_8_loose>)>>(
|
||||
'frbgen_starcitizen_doctor_wire_rsi_launcher_asar_data_write_main_js');
|
||||
late final _wire_rsi_launcher_asar_data_write_main_js =
|
||||
_wire_rsi_launcher_asar_data_write_main_jsPtr.asFunction<
|
||||
void Function(int, ffi.Pointer<wire_cst_rsi_launcher_asar_data>,
|
||||
ffi.Pointer<wire_cst_list_prim_u_8_loose>)>();
|
||||
|
||||
void wire_dns_lookup_ips(
|
||||
int port_,
|
||||
ffi.Pointer<wire_cst_list_prim_u_8_strict> host,
|
||||
@ -660,6 +770,19 @@ class RustLibWire implements BaseWire {
|
||||
_wire_set_foreground_windowPtr.asFunction<
|
||||
void Function(int, ffi.Pointer<wire_cst_list_prim_u_8_strict>)>();
|
||||
|
||||
ffi.Pointer<wire_cst_rsi_launcher_asar_data>
|
||||
cst_new_box_autoadd_rsi_launcher_asar_data() {
|
||||
return _cst_new_box_autoadd_rsi_launcher_asar_data();
|
||||
}
|
||||
|
||||
late final _cst_new_box_autoadd_rsi_launcher_asar_dataPtr = _lookup<
|
||||
ffi.NativeFunction<
|
||||
ffi.Pointer<wire_cst_rsi_launcher_asar_data> Function()>>(
|
||||
'frbgen_starcitizen_doctor_cst_new_box_autoadd_rsi_launcher_asar_data');
|
||||
late final _cst_new_box_autoadd_rsi_launcher_asar_data =
|
||||
_cst_new_box_autoadd_rsi_launcher_asar_dataPtr.asFunction<
|
||||
ffi.Pointer<wire_cst_rsi_launcher_asar_data> Function()>();
|
||||
|
||||
ffi.Pointer<ffi.Uint64> cst_new_box_autoadd_u_64(
|
||||
int value,
|
||||
) {
|
||||
@ -689,6 +812,21 @@ class RustLibWire implements BaseWire {
|
||||
late final _cst_new_list_String = _cst_new_list_StringPtr
|
||||
.asFunction<ffi.Pointer<wire_cst_list_String> Function(int)>();
|
||||
|
||||
ffi.Pointer<wire_cst_list_prim_u_8_loose> cst_new_list_prim_u_8_loose(
|
||||
int len,
|
||||
) {
|
||||
return _cst_new_list_prim_u_8_loose(
|
||||
len,
|
||||
);
|
||||
}
|
||||
|
||||
late final _cst_new_list_prim_u_8_loosePtr = _lookup<
|
||||
ffi.NativeFunction<
|
||||
ffi.Pointer<wire_cst_list_prim_u_8_loose> Function(ffi.Int32)>>(
|
||||
'frbgen_starcitizen_doctor_cst_new_list_prim_u_8_loose');
|
||||
late final _cst_new_list_prim_u_8_loose = _cst_new_list_prim_u_8_loosePtr
|
||||
.asFunction<ffi.Pointer<wire_cst_list_prim_u_8_loose> Function(int)>();
|
||||
|
||||
ffi.Pointer<wire_cst_list_prim_u_8_strict> cst_new_list_prim_u_8_strict(
|
||||
int len,
|
||||
) {
|
||||
@ -749,6 +887,21 @@ final class wire_cst_list_prim_u_8_strict extends ffi.Struct {
|
||||
external int len;
|
||||
}
|
||||
|
||||
final class wire_cst_rsi_launcher_asar_data extends ffi.Struct {
|
||||
external ffi.Pointer<wire_cst_list_prim_u_8_strict> asar_path;
|
||||
|
||||
external ffi.Pointer<wire_cst_list_prim_u_8_strict> main_js_path;
|
||||
|
||||
external ffi.Pointer<wire_cst_list_prim_u_8_strict> main_js_content;
|
||||
}
|
||||
|
||||
final class wire_cst_list_prim_u_8_loose extends ffi.Struct {
|
||||
external ffi.Pointer<ffi.Uint8> ptr;
|
||||
|
||||
@ffi.Int32()
|
||||
external int len;
|
||||
}
|
||||
|
||||
final class wire_cst_record_string_string extends ffi.Struct {
|
||||
external ffi.Pointer<wire_cst_list_prim_u_8_strict> field0;
|
||||
|
||||
|
Reference in New Issue
Block a user