|
|
|
@ -20,17 +20,7 @@ static void argon2_ffi_plugin_handle_method_call(
|
|
|
|
|
FlMethodCall* method_call) { |
|
|
|
|
g_autoptr(FlMethodResponse) response = nullptr; |
|
|
|
|
|
|
|
|
|
const gchar* method = fl_method_call_get_name(method_call); |
|
|
|
|
|
|
|
|
|
if (strcmp(method, "getPlatformVersion") == 0) { |
|
|
|
|
struct utsname uname_data = {}; |
|
|
|
|
uname(&uname_data); |
|
|
|
|
g_autofree gchar *version = g_strdup_printf("Linux %s", uname_data.version); |
|
|
|
|
g_autoptr(FlValue) result = fl_value_new_string(version); |
|
|
|
|
response = FL_METHOD_RESPONSE(fl_method_success_response_new(result)); |
|
|
|
|
} else { |
|
|
|
|
response = FL_METHOD_RESPONSE(fl_method_not_implemented_response_new()); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
fl_method_call_respond(method_call, response, nullptr); |
|
|
|
|
} |
|
|
|
|