frida 17.2.3 → 17.2.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/src/frida.js +1 -5
- package/build/src/frida_binding.d.ts +0 -1
- package/package.json +1 -1
- package/src/frida_bindgen/__pycache__/__init__.cpython-312.pyc +0 -0
- package/src/frida_bindgen/__pycache__/__main__.cpython-312.pyc +0 -0
- package/src/frida_bindgen/__pycache__/cli.cpython-312.pyc +0 -0
- package/src/frida_bindgen/__pycache__/codegen.cpython-312.pyc +0 -0
- package/src/frida_bindgen/__pycache__/customization.cpython-312.pyc +0 -0
- package/src/frida_bindgen/__pycache__/loader.cpython-312.pyc +0 -0
- package/src/frida_bindgen/__pycache__/model.cpython-312.pyc +0 -0
- package/src/frida_bindgen/assets/customization_facade.ts +1 -6
- package/src/frida_bindgen/codegen.py +7 -22
- package/subprojects/frida-core.wrap +1 -1
package/build/src/frida.js
CHANGED
|
@@ -976,9 +976,5 @@ async function getMatchingDevice(predicate, options = {}, cancellable = null) {
|
|
|
976
976
|
async function findMatchingDevice(predicate, cancellable) {
|
|
977
977
|
const deviceManager = getDeviceManager();
|
|
978
978
|
const devices = await deviceManager.enumerateDevices(cancellable);
|
|
979
|
-
|
|
980
|
-
if (matching.length === 0) {
|
|
981
|
-
return null;
|
|
982
|
-
}
|
|
983
|
-
return matching[0];
|
|
979
|
+
return devices.find(predicate) ?? null;
|
|
984
980
|
}
|
|
@@ -656,7 +656,6 @@ export enum PackageInstallPhase {
|
|
|
656
656
|
DownloadingPackage = "downloading-package",
|
|
657
657
|
PackageInstalled = "package-installed",
|
|
658
658
|
ResolvingAndInstallingAll = "resolving-and-installing-all",
|
|
659
|
-
AwaitingCompletion = "awaiting-completion",
|
|
660
659
|
DependenciesProcessed = "dependencies-processed",
|
|
661
660
|
FinalizingManifests = "finalizing-manifests",
|
|
662
661
|
Complete = "complete"
|
package/package.json
CHANGED
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -146,12 +146,7 @@ async function findMatchingDevice(predicate: DevicePredicate, cancellable?: Canc
|
|
|
146
146
|
|
|
147
147
|
const devices = await deviceManager.enumerateDevices(cancellable);
|
|
148
148
|
|
|
149
|
-
|
|
150
|
-
if (matching.length === 0) {
|
|
151
|
-
return null;
|
|
152
|
-
}
|
|
153
|
-
|
|
154
|
-
return matching[0];
|
|
149
|
+
return devices.find(predicate) ?? null;
|
|
155
150
|
}
|
|
156
151
|
|
|
157
152
|
type DevicePredicate = (device: Device) => boolean;
|
|
@@ -586,6 +586,7 @@ def generate_operation_structs(object_types: List[ObjectType]) -> str:
|
|
|
586
586
|
f"""\
|
|
587
587
|
typedef struct {{
|
|
588
588
|
napi_deferred deferred;
|
|
589
|
+
napi_threadsafe_function tsfn;
|
|
589
590
|
{otype.c_type} * handle;{decls}
|
|
590
591
|
}} {method.operation_type_name};
|
|
591
592
|
"""
|
|
@@ -751,14 +752,6 @@ def generate_tsfn_declarations(object_types: List[ObjectType]) -> str:
|
|
|
751
752
|
declarations = []
|
|
752
753
|
|
|
753
754
|
for otype in object_types:
|
|
754
|
-
async_methods = [method for method in otype.methods if method.is_async]
|
|
755
|
-
if async_methods:
|
|
756
|
-
declarations.append("")
|
|
757
|
-
for method in async_methods:
|
|
758
|
-
declarations.append(
|
|
759
|
-
f"static napi_threadsafe_function {otype.c_symbol_prefix}_{method.name}_tsfn;"
|
|
760
|
-
)
|
|
761
|
-
|
|
762
755
|
if isinstance(otype, InterfaceObjectType) and otype.has_abstract_base:
|
|
763
756
|
declarations.append(
|
|
764
757
|
f"static napi_threadsafe_function {otype.abstract_base_c_symbol_prefix}_release_js_resources_tsfn;"
|
|
@@ -908,18 +901,11 @@ def generate_object_type_registration_code(otype: ObjectType, model: Model) -> s
|
|
|
908
901
|
else f"\n napi_create_reference (env, constructor, 1, &{otype_cprefix}_constructor);"
|
|
909
902
|
)
|
|
910
903
|
jsprop_registrations = []
|
|
911
|
-
tsfn_initializations = []
|
|
912
904
|
|
|
913
905
|
for method in otype.methods:
|
|
914
906
|
if method.is_property_accessor:
|
|
915
907
|
continue
|
|
916
908
|
jsprop_registrations.append(generate_method_registration_entry(method))
|
|
917
|
-
if method.is_async:
|
|
918
|
-
tsfn_initializations.append(
|
|
919
|
-
f"""\
|
|
920
|
-
napi_create_threadsafe_function (env, NULL, NULL, fdn_utf8_to_value (env, "{method.prefixed_js_name}"), 0, 1, NULL, NULL, NULL, {otype_cprefix}_{method.name}_deliver, &{otype_cprefix}_{method.name}_tsfn);
|
|
921
|
-
napi_unref_threadsafe_function (env, {otype_cprefix}_{method.name}_tsfn);"""
|
|
922
|
-
)
|
|
923
909
|
|
|
924
910
|
for prop in otype.properties:
|
|
925
911
|
jsprop_registrations.append(generate_property_registration_entry(prop))
|
|
@@ -941,7 +927,6 @@ napi_unref_threadsafe_function (env, {otype_cprefix}_{method.name}_tsfn);"""
|
|
|
941
927
|
jsprop_registrations.append(generate_signal_registration_entry(signal))
|
|
942
928
|
|
|
943
929
|
jsprop_registrations_str = "\n ".join(jsprop_registrations)
|
|
944
|
-
tsfn_initializations_code = "\n\n".join(tsfn_initializations)
|
|
945
930
|
|
|
946
931
|
def calculate_indent(suffix: str) -> str:
|
|
947
932
|
return " " * (len(otype_cprefix) + len(suffix) + 2)
|
|
@@ -961,7 +946,7 @@ static void
|
|
|
961
946
|
|
|
962
947
|
napi_define_class (env, "{otype.prefixed_js_name}", NAPI_AUTO_LENGTH, {otype_cprefix}_construct, NULL, G_N_ELEMENTS (properties), properties, &constructor);{ctor_ref_creation}
|
|
963
948
|
|
|
964
|
-
napi_set_named_property (env, exports, "{otype.prefixed_js_name}", constructor);
|
|
949
|
+
napi_set_named_property (env, exports, "{otype.prefixed_js_name}", constructor);
|
|
965
950
|
}}
|
|
966
951
|
"""
|
|
967
952
|
|
|
@@ -1279,6 +1264,8 @@ static napi_value
|
|
|
1279
1264
|
|
|
1280
1265
|
operation = g_slice_new0 ({operation_type_name});
|
|
1281
1266
|
operation->deferred = deferred;
|
|
1267
|
+
napi_create_threadsafe_function (env, NULL, NULL, fdn_utf8_to_value (env, "{method.prefixed_js_name}"), 0, 1, NULL, NULL, NULL,
|
|
1268
|
+
{otype_cprefix}_{method.name}_deliver, &operation->tsfn);
|
|
1282
1269
|
operation->handle = handle;
|
|
1283
1270
|
operation->error = NULL;{indent_c_code(param_conversions, 1, prologue=two_newlines)}
|
|
1284
1271
|
|
|
@@ -1288,8 +1275,6 @@ static napi_value
|
|
|
1288
1275
|
g_source_attach (source, frida_get_main_context ());
|
|
1289
1276
|
g_source_unref (source);
|
|
1290
1277
|
|
|
1291
|
-
napi_ref_threadsafe_function (env, {otype_cprefix}_{method.name}_tsfn);
|
|
1292
|
-
|
|
1293
1278
|
return promise;
|
|
1294
1279
|
|
|
1295
1280
|
invalid_argument:
|
|
@@ -1321,7 +1306,7 @@ static void
|
|
|
1321
1306
|
|
|
1322
1307
|
{return_assignment}{method.finish_c_identifier} (operation->handle, res, &operation->error);
|
|
1323
1308
|
|
|
1324
|
-
napi_call_threadsafe_function (
|
|
1309
|
+
napi_call_threadsafe_function (operation->tsfn, operation, napi_tsfn_blocking);
|
|
1325
1310
|
}}
|
|
1326
1311
|
|
|
1327
1312
|
static void
|
|
@@ -1345,9 +1330,9 @@ static void
|
|
|
1345
1330
|
napi_resolve_deferred (env, operation->deferred, js_retval);{indent_c_code(keep_alive_code, 2)}
|
|
1346
1331
|
}}
|
|
1347
1332
|
|
|
1348
|
-
|
|
1333
|
+
napi_release_threadsafe_function (operation->tsfn, napi_tsfn_release);
|
|
1349
1334
|
|
|
1350
|
-
|
|
1335
|
+
{otype_cprefix}_{method.name}_operation_free (operation);
|
|
1351
1336
|
}}
|
|
1352
1337
|
|
|
1353
1338
|
{operation_free_function}
|