92 Commits

Author SHA1 Message Date
Ole André Vadla Ravnås c2145f3589 Add support for new attach options 2026-05-31 12:32:06 +02:00
Ole André Vadla Ravnås a9caf62a0c Reformat with black 26.3.1 2026-04-26 17:47:34 +02:00
Ole André Vadla Ravnås cc9a78ef19 device: Add override_option()
Expose Device.override_option() for overriding backend-specific
options on a device.

Overrides apply when establishing a host session. If one already
exists, changes take effect on the next connection.
2026-03-26 20:30:10 +01:00
Ole André Vadla Ravnås fb8fdbb231 variant: Support cast to uint64 2026-02-14 10:49:06 +01:00
Ole André Vadla Ravnås d9d53a89cc service: Fix Service.request() GVariant lifetime
The variant unmarshal helpers returned floating GVariants. When these
values were stored in containers, the floating reference was consumed.

Service.request() later unref'd the same GVariant, leading to refcount
underflow and memory corruption, or appearing to work by accident when
the memory was not yet reused.

Ensure all unmarshalled GVariants are non-floating before returning them
so that Service.request() always owns a full reference.
2026-01-29 14:59:10 +01:00
Ole André Vadla Ravnås dfb002de49 variant: Fix signedness in uint64 marshaling 2026-01-29 12:46:38 +01:00
Ole André Vadla Ravnås 0f56e44abd variant: Add support for additional GVariant types
This adds support for:
- Additional integer types: byte, int16, uint16, int32, uint32
- Tuples
- Nested variants in any context
2026-01-29 12:45:54 +01:00
Abhi 9f463fb602 Fix regressions reported by mypi and black (#269) 2026-01-07 09:14:51 +01:00
Etienne Maheux bf1245ddb0 typing: Remove generic @overload on handlers
Generic @overload definitions on signal handlers were masking
type-checking errors.
2025-12-15 21:23:57 +01:00
Etienne Maheux 0f247e9439 typing: Improve @cancellable; add flag literals
Refine @cancellable typing to better model control flow and
introduce Literal types for optional Compiler flags to
improve static checking and autocomplete.
2025-12-15 21:23:57 +01:00
Ole André Vadla Ravnås dc652faa90 package-manager: Plug leak in specs option parsing 2025-11-04 10:23:37 +01:00
Ole André Vadla Ravnås f5ba22ad36 compiler: Expose platform and externals options 2025-11-04 10:23:00 +01:00
Ole André Vadla Ravnås 4e16e5c667 package-manager: Fix the PackageRole declaration 2025-07-01 21:25:59 +02:00
Ole André Vadla Ravnås 09d6c7b044 package-manager: Update to the new API 2025-07-01 21:22:01 +02:00
Ole André Vadla Ravnås 690da0652d package-manager: Remove unused install phase 2025-06-20 11:48:08 +02:00
Ole André Vadla Ravnås dec23f9ef5 extension: Expose PackageManager.registry 2025-06-19 12:17:09 +02:00
Ole André Vadla Ravnås 906d27bcb7 extension: Add missing toplevel counter logic
We previously only bumped it when instantiating DeviceManager and
PortalService objects. We also need to do it for Compiler,
PackageManager, and FileMonitor. Otherwise signal emissions won't
work in some applications.
2025-06-19 11:51:38 +02:00
Ole André Vadla Ravnås b0018c9812 extension: Add __repr__ to PackageManager types 2025-06-19 11:51:38 +02:00
Ole André Vadla Ravnås 6fbe238c1a extension: Simplify the Compiler constructor
The DeviceManager is no longer needed.
2025-06-18 22:49:42 +02:00
Ole André Vadla Ravnås 4d750dfe58 extension: Fix the Compiler docstring 2025-06-18 22:49:42 +02:00
Ole André Vadla Ravnås fe1c61ce5d Add PackageManager bindings 2025-06-18 22:49:42 +02:00
Ole André Vadla Ravnås 51501ceacb Add support for the new Compiler options
I.e. `output_format`, `bundle_format`, and `type_check`.
2025-06-01 23:48:37 +02:00
Ole André Vadla Ravnås 3f8b122ce7 extension: Fix IOStream.read_all() EOS handling 2025-03-30 22:27:27 +02:00
Ole André Vadla Ravnås 0b7bde2fd4 Revert "Use ParamSpec for better type hints"
This reverts commit 9a3ec81843.
2024-10-10 20:13:54 +02:00
Ole André Vadla Ravnås 6a18d4c4cc Fix a stylistic inconsistency 2024-10-10 20:09:50 +02:00
Nick 9a3ec81843 Use ParamSpec for better type hints 2024-10-10 20:07:23 +02:00
Ole André Vadla Ravnås d921e98e0c extension: Eliminate usage of unstable ref-counting APIs
Fixes #244.
2024-07-15 22:54:19 +02:00
Ole André Vadla Ravnås 8935cf3651 extension: Remove unused macro 2024-07-15 18:46:01 +02:00
Ole André Vadla Ravnås 2e3b9474bf extension: Drop remaining compatibility macros
As we no longer support Python 2.
2024-07-15 18:43:50 +02:00
Ole André Vadla Ravnås 2b5f6492a2 extension: Support unmarshaling tuples to GVariant
Co-authored-by: Håvard Sørbø <havard@hsorbo.no>
2024-07-03 22:33:40 +02:00
Ole André Vadla Ravnås 316f88974d extension: Fix unmarshaling of bool to GVariant
A bool also satisfies PyLong_Check(), so we need to PyBool_Check() first.

Co-authored-by: Håvard Sørbø <havard@hsorbo.no>
2024-07-03 22:33:40 +02:00
Ole André Vadla Ravnås fee73e852b extension: Drop PyFrida_is_string()
Now that it does nothing special as we no longer support Python 2.

Co-authored-by: Håvard Sørbø <havard@hsorbo.no>
2024-07-03 22:33:40 +02:00
Ole André Vadla Ravnås 0b854499cd rpc: Fix type hints for make_rpc_call_request()
Co-authored-by: Håvard Sørbø <havard@hsorbo.no>
2024-05-31 15:40:22 +02:00
Ole André Vadla Ravnås 243cce22e6 rpc: Add support for new binary data passing
Which means:
- Pass in data to RPC method.
- Return value and data from RPC method.

Co-authored-by: Håvard Sørbø <havard@hsorbo.no>
2024-05-31 15:11:05 +02:00
Ole André Vadla Ravnås 8838d885ce _frida: Add missing type hints 2024-05-30 23:45:06 +02:00
Ole André Vadla Ravnås 8b888558c7 device: Add open_service() and Service API
Co-authored-by: Håvard Sørbø <havard@hsorbo.no>
2024-05-30 23:28:36 +02:00
Ole André Vadla Ravnås de55d964a0 extension: Support marshaling uint64 GVariant
Co-authored-by: Håvard Sørbø <havard@hsorbo.no>
2024-05-30 23:28:36 +02:00
Ole André Vadla Ravnås e920bad7f5 extension: Support marshaling double to/from GVariant
Co-authored-by: Håvard Sørbø <havard@hsorbo.no>
2024-05-30 23:28:36 +02:00
Ole André Vadla Ravnås 2b947e6d75 extension: Refactor the variant marshaling logic
Co-authored-by: Håvard Sørbø <havard@hsorbo.no>
2024-05-30 23:28:36 +02:00
Ole André Vadla Ravnås 9992e8ad7a extension: Support marshaling GVariant arrays of variant
Co-authored-by: Håvard Sørbø <havard@hsorbo.no>
2024-05-30 23:28:36 +02:00
Ole André Vadla Ravnås 3c7eb89653 extension: Support unmarshaling more types to GVariant
Co-authored-by: Håvard Sørbø <havard@hsorbo.no>
2024-05-30 23:28:36 +02:00
Ole André Vadla Ravnås 56ec6a46e7 Fix stylistic inconsistencies 2024-04-24 13:18:01 +02:00
Ole André Vadla Ravnås 9706e4be99 Move _frida package inside the frida package
So we only have one top-level package, to avoid confusing IDEs.

Also add missing files to the Meson build system.
2024-04-24 12:41:52 +02:00
Ole André Vadla Ravnås 88330bfbb9 meson: Simplify the build system
- Make full use of Meson's Python module.
- Drop python_incdir option. It's now possible to use a .pc file to
  specify the include path.
- Drop config.h, as we only needed it for HAVE_MACOS, which we can
  easily check for in the single location that we need it.
2024-03-21 21:53:50 +01:00
Ole André Vadla Ravnås 3e489dff85 device: Add unpair() 2023-10-09 13:12:04 +02:00
Yotam Nachum fb86c3aa37 Add async variant to rpc calls 2023-02-03 20:13:19 +02:00
Yotam Nachum b203e4bbca core: Add specific signals type hinting 2023-01-14 15:15:17 +02:00
Ole André Vadla Ravnås 6470583f8b core: Avoid using Python's union syntax
So we don't depend on Python >= 3.10.
2022-10-06 22:50:50 +02:00
Yotam Nachum 4f5c83fd09 Fix type hinting 2022-09-24 18:54:10 +03:00
Orip 32e3def2a1 Fix Device.get_bus
The Previous implementation called the `_Device.get_bus` method which doesn't exist
2022-09-12 20:59:52 +03:00