frida 16.3.1 → 16.3.3
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/dist/device.js +1 -4
- package/lib/device.ts +1 -4
- package/package.json +1 -1
- package/src/device.cc +11 -3
- package/src/runtime.cc +18 -4
- package/subprojects/frida-core.wrap +1 -1
package/dist/device.js
CHANGED
|
@@ -97,11 +97,8 @@ class Device {
|
|
|
97
97
|
return this.impl.spawn(program, argv, envp, env, cwd, stdio, aux, cancellable);
|
|
98
98
|
function consumeOption(name) {
|
|
99
99
|
const value = pendingOptions[name];
|
|
100
|
-
if (value === undefined) {
|
|
101
|
-
return null;
|
|
102
|
-
}
|
|
103
100
|
delete pendingOptions[name];
|
|
104
|
-
return value;
|
|
101
|
+
return value !== null && value !== void 0 ? value : null;
|
|
105
102
|
}
|
|
106
103
|
}
|
|
107
104
|
async input(target, data, cancellable) {
|
package/lib/device.ts
CHANGED
|
@@ -141,11 +141,8 @@ export class Device {
|
|
|
141
141
|
|
|
142
142
|
function consumeOption(name) {
|
|
143
143
|
const value = pendingOptions[name];
|
|
144
|
-
if (value === undefined) {
|
|
145
|
-
return null;
|
|
146
|
-
}
|
|
147
144
|
delete pendingOptions[name];
|
|
148
|
-
return value;
|
|
145
|
+
return value ?? null;
|
|
149
146
|
}
|
|
150
147
|
}
|
|
151
148
|
|
package/package.json
CHANGED
package/src/device.cc
CHANGED
|
@@ -759,11 +759,19 @@ NAN_METHOD(Device::Spawn) {
|
|
|
759
759
|
for (uint32_t i = 0; i != n; i++) {
|
|
760
760
|
auto key = Nan::Get(keys, i).ToLocalChecked();
|
|
761
761
|
auto value = Nan::Get(object, key).ToLocalChecked();
|
|
762
|
+
if (value->IsUndefined()) {
|
|
763
|
+
continue;
|
|
764
|
+
}
|
|
762
765
|
|
|
763
|
-
Nan::Utf8String
|
|
766
|
+
Nan::Utf8String k(key);
|
|
764
767
|
|
|
765
|
-
|
|
766
|
-
|
|
768
|
+
auto v = Runtime::ValueToVariant(value);
|
|
769
|
+
if (v == NULL) {
|
|
770
|
+
valid = false;
|
|
771
|
+
break;
|
|
772
|
+
}
|
|
773
|
+
|
|
774
|
+
g_hash_table_insert(aux, g_strdup(*k), g_variant_ref_sink(v));
|
|
767
775
|
}
|
|
768
776
|
} else {
|
|
769
777
|
Nan::ThrowTypeError("Bad argument, 'aux' must be an object");
|
package/src/runtime.cc
CHANGED
|
@@ -280,8 +280,12 @@ GVariant* Runtime::ValueToVariant(Local<Value> value) {
|
|
|
280
280
|
auto array = Local<Array>::Cast(value);
|
|
281
281
|
uint32_t n = array->Length();
|
|
282
282
|
for (uint32_t i = 0; i != n; i++) {
|
|
283
|
-
auto
|
|
284
|
-
|
|
283
|
+
auto v = ValueToVariant(Nan::Get(array, i).ToLocalChecked());
|
|
284
|
+
if (v == NULL) {
|
|
285
|
+
g_variant_builder_clear(&builder);
|
|
286
|
+
return NULL;
|
|
287
|
+
}
|
|
288
|
+
g_variant_builder_add(&builder, "v", v);
|
|
285
289
|
}
|
|
286
290
|
|
|
287
291
|
return g_variant_builder_end(&builder);
|
|
@@ -302,9 +306,19 @@ GVariant* Runtime::ValueToVariant(Local<Value> value) {
|
|
|
302
306
|
for (uint32_t i = 0; i != n; i++) {
|
|
303
307
|
auto key = Nan::Get(names, i).ToLocalChecked();
|
|
304
308
|
auto val = Nan::Get(object, key).ToLocalChecked();
|
|
309
|
+
if (val->IsUndefined()) {
|
|
310
|
+
continue;
|
|
311
|
+
}
|
|
312
|
+
|
|
313
|
+
Nan::Utf8String k(key);
|
|
314
|
+
|
|
315
|
+
auto v = ValueToVariant(val);
|
|
316
|
+
if (v == NULL) {
|
|
317
|
+
g_variant_builder_clear(&builder);
|
|
318
|
+
return NULL;
|
|
319
|
+
}
|
|
305
320
|
|
|
306
|
-
|
|
307
|
-
g_variant_builder_add(&builder, "{sv}", *key_str, ValueToVariant(val));
|
|
321
|
+
g_variant_builder_add(&builder, "{sv}", *k, v);
|
|
308
322
|
}
|
|
309
323
|
|
|
310
324
|
return g_variant_builder_end(&builder);
|