Commit graph

178 commits

Author SHA1 Message Date
PalmDevs
b1d65fbda2
feat(plugins/recovery): detect freezes much earlier + show stack traces 2026-08-14 01:48:31 +07:00
PalmDevs
3ac922a817
fix(lib/modules/metro/utils): detect proxies better in isModuleExportBad 2026-08-12 23:15:10 +07:00
PalmDevs
d3fb84b76d
feat(lib/modules/finders): new withDependencies builders
- `skip` and `last`: Skips the first N/to the end of dependencies before doing comparisons.
- `atLeast` and `atMost`: Length check before doing comparisons.
- `includes`: Simply checks if the depedencies exist. This is performance intensive though.
2026-08-12 15:21:22 +07:00
PalmDevs
07291f6c20
fix(lib/modules/metro/runtime): use module ID from closure
mInitializingId will never match the actual ID outside of the factory call.
2026-08-12 01:33:39 +07:00
PalmDevs
9258695ec7
feat(lib/modules/finders)!: initialized boolean for filter predicates + remove FilterFlag and weird assumptions + fix partial matches causing modules skip in lookup 2026-08-12 01:12:48 +07:00
PalmDevs
54f5d94205
feat: warn user to update loader if native cache format is outdated 2026-08-02 17:10:53 +07:00
PalmDevs
c096b80225
fix(lib/modules/finders): don't let one bad filter take down the whole process 2026-08-02 16:57:23 +07:00
PalmDevs
9a10e9d509
fix(lib/modules): don't make assumptions about what consumers are filtering 2026-08-02 16:57:18 +07:00
PalmDevs
215cd487b9
fix(lib/modules/metro/patches): don't blacklist objects with no enumerable keys 2026-08-02 16:19:34 +07:00
PalmDevs
e2dcc294e9
fix(lib/modules/metro): handle all subscription tasks in runtime 2026-08-02 16:18:36 +07:00
PalmDevs
ff410cbb25
chore(lib/modules/finders/lookup): move LookupModulesOptions.initialize clarification comment 2026-08-01 15:32:11 +07:00
PalmDevs
944dbb6838
feat: improve recovery mode + small lib additions
Improved Recovery Mode features generally:
- Ability to view and modify saved states while not actually running any additional plugins
- Better Recovery Mode banner display
- Enter Recovery Mode option in Revenge Settings UI
- Fixed freeze detection false positives

New APIs:
- lib/discord: `disabled` in `DiscordModules.Components.FloatingActionButtonProps`
- lib/modules/native/app: new submodule with `reloadApp()` method

Fixes:
- Use `reloadApp()` instead of `BundleUpdaterManager.reload()`
2026-08-01 01:51:34 +07:00
PalmDevs
6d7e017c0b
fix(lib/modules/metro): move all error handling to metroRequire 2026-08-01 00:18:32 +07:00
PalmDevs
1c58b7a5a1
chore: use AnyFunction from lib everywhere 2026-07-31 02:38:45 +07:00
PalmDevs
2e944b0f25
fix: support 341202+
First Android Static Hermes version incoming, with Metro issues.

- scripts/plugins/hermesc: use hermes-compiler
- plugins/settings: get React Native version correctly
- lib/modules/finders/filters: support null ID in DependencyMap for `withDependencies`
- lib/discord: update filters for 341202+
2026-07-29 21:48:18 +07:00
PalmDevs
a06bf73d06
fix(lib/modules/native/fs): rmSync not actually deleting anything 2026-07-25 23:59:06 +07:00
PalmDevs
eed74947c3
chore: format and fix potential type errors 2026-07-25 23:58:01 +07:00
PalmDevs
3f60b4dfb7
feat!: more plugin system improvements + API changes + other fixes
BREAKING CHANGES:

- lib/modules!: Renamed `callBridgeMethod*` to `callNativeMethod*` and interface `Methods` to `NativeMethods`. This is to achieve naming consistency with the native API and be more clear.
- lib/storage!: Renamed to `@revenge-mod/json-storage`. A storage can be in any arbitrary format. While there's little potential for non-JSON storage formats, but the naming should allow for it regardless. This is not a drop-in replacements. There are breaking changes in export names and new APIs.
- plugins/revenge.api.storage!: Renamed to `revenge.api.jsonStorage`. Plugin options are renamed and its structure has changed as well.
- Native now holds the path for official storage APIs. This update uses new paths without any migration!
- lib/plugins!: `Plugin.errors` is now read-only. Use `Plugin.reportError(e)` instead.
- lib/plugins!: `Plugin.flags` has been completely removed in favor of these methods: `Plugin.requireReload()`, `Plugin.disable()`.

OTHER CHANGES:

- Fixed sorting for 'Enabled first'
- Updated native method names to be more consistent
- Cleand up dead code
- Make methods more 'safe' by removing non-null assertion casts
2026-07-09 23:47:53 +07:00
PalmDevs
27c445e196
fix(lib/modules/native): await callable method properly 2026-07-07 21:50:36 +07:00
PalmDevs
00047da9b3
feat(lib/modules): support native to JS bridge 2026-07-06 23:48:27 +07:00
PalmDevs
df01515823
feat(lib/modules/metro): module segments support 2026-05-13 01:22:42 +07:00
PalmDevs
76a6072582
fix(lib/modules/metro): run initialized subscriptions after modifying flags 2026-04-07 22:35:27 +07:00
PalmDevs
bf967de902
fix(lib/modules/finders/get): only lookup initialized modules 2026-04-01 14:00:18 +07:00
PalmDevs
2c0203d42e
fix(lib/modules/finders/lookup): in cached results, respect filter scopes and yield uninitialized if specified instead of skipping 2026-04-01 14:00:08 +07:00
PalmDevs
fc79e9353b
fix: syntax error during compilation 2026-02-25 22:16:44 +07:00
PalmDevs
3da647154f
fix(lib/modules): warn bad withDependencies filters during construction time 2026-02-25 22:05:38 +07:00
PalmDevs
8839d43a47
fix(lib/modules/finders/filters): skip already warned bad withDependencies filters 2026-01-24 18:14:56 +07:00
PalmDevs
4f120ea159
chore(lib/modules/metro): alert module init errors in dev builds 2026-01-24 18:14:18 +07:00
PalmDevs
9cdf5710d8
fix(lib/modules/finders/filters): correct relative and relative.withDependencies param names 2026-01-17 20:55:12 +07:00
PalmDevs
a87d4ced5c
fix(lib/modules)!: decouple discord-specific helpers to lib/discord 2026-01-17 20:41:14 +07:00
PalmDevs
47084f4f52
chore: update dependencies 2025-12-13 22:43:21 +07:00
PalmDevs
8e2abb9e6f
fix(lib/modules/finders/filters): use runFilter for nested withDependencies filters 2025-10-29 19:33:24 +07:00
PalmDevs
300d506125
feat(lib/modules/finders/filters): allow nested filters in withDependencies 2025-10-28 01:18:12 +07:00
PalmDevs
b6d1cff9f5
feat(lib/modules)!: filter scopes + fixes and improvements
# Features

- Filters now control what types of modules they see.
- Filters can be reinstantiated via `.new()`
- Added the `Not` type in @revenge-mod/utils/types

# Fixes

- Pitfall with `lookupModules` and `withDependencies` without `uninitialize: true` fixed.
- Filter type-metadata is now stored in a single object instead of multiple parameters.
- Incorrect caching behavior for `lookupModules` where cache always reports not found if you finish the iterator.
- Also attempt to report not found when using `lookupModule`.
2025-10-28 01:01:17 +07:00
PalmDevs
dde81af9f6
chore(lib/modules/finders/lookup): warn for bad filters without uninitalized modules 2025-10-27 00:35:40 +07:00
PalmDevs
2bc2a9fd08
fix(lib/plugins): expose internal metadata via function instead 2025-10-22 22:19:42 +07:00
PalmDevs
e9f611e325
feat(lib/modules/native/fs): add additional methods 2025-10-14 21:49:55 +07:00
PalmDevs
53ba8a2975
feat(lib/modules/native/fs): rename deleteFile to rm 2025-09-16 01:02:27 +07:00
PalmDevs
4d93159632
chore(lib/modules/native): remove useless String() call on error 2025-09-16 01:02:25 +07:00
PalmDevs
97534c9d04
feat(lib/modules/native): add fs 2025-09-16 01:02:18 +07:00
PalmDevs
d8d85cfab1
fix(lib/modules/metro/runtime): add flag once importedAll or importedDefault exports cached 2025-09-16 01:02:16 +07:00
PalmDevs
dba76a9f81
feat(lib): proper caching for assets and modules lib 2025-09-16 01:02:13 +07:00
PalmDevs
67345aa82e
feat(lib/modules/native): types for calls 2025-09-16 01:02:11 +07:00
PalmDevs
fc5e776121
chore: format 2025-09-10 00:56:53 +07:00
PalmDevs
bd214823d4
fix(lib/modules/finders/get): correct types for getModules with options 2025-09-10 00:52:58 +07:00
PalmDevs
790c30a6d5
fix: debug build flags 2025-09-04 01:29:18 +07:00
PalmDevs
54c6a2ffdd
fix(lib/modules/finders/filters): correctly generate key for relative.withDependencies 2025-09-04 01:29:18 +07:00
PalmDevs
d5a7ab6d7b
fix(lib/modules/finders): early return if non-dynamic filter used on uninitialized module 2025-09-04 01:29:17 +07:00
Palm
5f5fc6f2b2
feat!: module finders refactor (#6)
- Renamed `byX` filters to `withX`.
  It is more correct. For example: You don't lookup, wait for, or get modules **BY** props. You lookup, wait for, and get modules **WITH** props.
- Renamed `*byImportedPath` to `*withImportedPath`
  For consistency with the above change.
- Renamed `getModule` to `getModules`.
  The API allows getting multiple modules and not just a single one. Types are renamed as well.
  `getModuleByImportedPath` remains the same as it only gets one single module with a unique imported path.
- `withX` filter **helpers** removed.
  They can now be replaced with the new capability-based `and` filter.
- `preferExports` and `moduleStateAware` filters removed.
  They can now be replaced with the new capability-based `and` filter.
- Composite finders renamed.
  `some` -> `or`, `every` -> `and`
- Composite finders takes a capability-based approach.
- Filter generators now need to attach runtime flag to let the system know whether the generated filter can be used to filter modules without proper exports or not.

## Misc.

- Removed useless unsub call in Profile Badges
- Use `queueMicrotask` with `asap`

# Features

## Capability-based approach to composite filters

```js
// Old
byProps(...).withDependencies(...)
// Old, same as: preferExports(byProps(...), byDependencies(...))
every(byDependencies(...), byProps(...))
// Old, ordering matters, this would fail unexpectedly!
every(byProps(...), byDependencies(...))

// New
withProps(...).and(withDependencies(...))
// New (as well), ordering doesn't matter, this has the same result as above
withDependencies(...).and(withProps(...))
```
2025-08-30 09:19:57 +07:00
Palm
2d9a791249
feat: fluent interface for finder filters (#5)
* feat(lib/modules/finders/filters): DSL-style filters implementation

* fix(lib/modules/finders/filters): extend helpers with `Function` proto

To not break compatibility with weird usages of existing filters. Allows using `apply`, `call`, etc.

* chore(lib/modules/finders/filters): add examples with helpers
2025-08-25 21:45:42 +07:00