revenge-tweak/Makefile

35 lines
1.4 KiB
Makefile
Raw Normal View History

2024-11-14 11:15:18 +01:00
TARGET := iphone:clang:latest:14.0
ARCHS = arm64
INSTALL_TARGET_PROCESSES = Discord
2023-03-12 04:19:51 -04:00
include $(THEOS)/makefiles/common.mk
2024-11-15 11:17:44 +01:00
TWEAK_NAME = Revenge
BUNDLE_NAME = RevengeResources
2023-03-12 04:19:51 -04:00
fix: replace speculative Bridgeless hook with RainTweak's verified approach The RCTInstance/-_loadScriptFromSource: + fake-RCTSource hook from the previous commit was a plausible guess from RN's public source, but codeberg.org/raincord/RainTweak - an actively-shipping loader for a sibling Revenge/Bunny fork - proves both the Bridgeless diagnosis correct (its %ctor refuses to run below Discord v332, i.e. pre-Bridgeless) and shows a cleaner, verified mechanism: hook RCTHost/-instance:didInitializeRuntime:, let Discord's own bundle load untouched via %orig, then evaluate Revenge's scripts directly against the live JSI runtime instead of faking another bundle load. - Add Headers/JSI.h + Sources/JSI.mm (ported from RainTweak's JSI.mm): evaluates NSData as JS or Hermes bytecode directly against a facebook::jsi::Runtime. - Add Headers/RCTHost.h declaring the hook target's signature (RN ships no public header for this internal class). - Vendor Headers/jsi/{jsi.h,jsi-inl.h,instrumentation.h} - Meta's MIT-licensed JSI headers, which Theos doesn't provide; RainTweak vendors the same files. - Rewrite Tweak.x -> Tweak.xm (needs C++ for jsi::Runtime&): runRevengeInjection now takes a plain data/async execute callback, driven by either the new RCTHost+JSI hook or the legacy RCTCxxBridge hook (kept as a no-cost fallback), guarded by a didInject flag so only one path actually injects. - Makefile: build .xm/.mm sources, add -std=c++17 CCFLAGS matching RainTweak. Still unverified against a real device, but the mechanism itself is no longer a guess - it's the one running in a comparable, currently-shipping mod.
2026-08-03 10:10:32 -04:00
Revenge_FILES = $(wildcard Sources/*.x Sources/*.xm Sources/*.m Sources/*.mm Sources/**/*.x Sources/**/*.xm Sources/**/*.m Sources/**/*.mm)
2024-11-15 11:45:12 +01:00
Revenge_CFLAGS = -fobjc-arc -DPACKAGE_VERSION='@"$(THEOS_PACKAGE_BASE_VERSION)"' -I$(THEOS_PROJECT_DIR)/Headers
fix: replace speculative Bridgeless hook with RainTweak's verified approach The RCTInstance/-_loadScriptFromSource: + fake-RCTSource hook from the previous commit was a plausible guess from RN's public source, but codeberg.org/raincord/RainTweak - an actively-shipping loader for a sibling Revenge/Bunny fork - proves both the Bridgeless diagnosis correct (its %ctor refuses to run below Discord v332, i.e. pre-Bridgeless) and shows a cleaner, verified mechanism: hook RCTHost/-instance:didInitializeRuntime:, let Discord's own bundle load untouched via %orig, then evaluate Revenge's scripts directly against the live JSI runtime instead of faking another bundle load. - Add Headers/JSI.h + Sources/JSI.mm (ported from RainTweak's JSI.mm): evaluates NSData as JS or Hermes bytecode directly against a facebook::jsi::Runtime. - Add Headers/RCTHost.h declaring the hook target's signature (RN ships no public header for this internal class). - Vendor Headers/jsi/{jsi.h,jsi-inl.h,instrumentation.h} - Meta's MIT-licensed JSI headers, which Theos doesn't provide; RainTweak vendors the same files. - Rewrite Tweak.x -> Tweak.xm (needs C++ for jsi::Runtime&): runRevengeInjection now takes a plain data/async execute callback, driven by either the new RCTHost+JSI hook or the legacy RCTCxxBridge hook (kept as a no-cost fallback), guarded by a didInject flag so only one path actually injects. - Makefile: build .xm/.mm sources, add -std=c++17 CCFLAGS matching RainTweak. Still unverified against a real device, but the mechanism itself is no longer a guess - it's the one running in a comparable, currently-shipping mod.
2026-08-03 10:10:32 -04:00
Revenge_CCFLAGS = -std=c++17 -Wno-c++11-narrowing -I$(THEOS_PROJECT_DIR)/Headers
2024-11-15 11:45:12 +01:00
Revenge_FRAMEWORKS = Foundation UIKit CoreGraphics CoreText CoreFoundation
# JSI types (e.g. jsi::JSError's typeinfo) only exist in the host process's own compiled-in
# Hermes/JSI runtime, not anywhere we can statically link against - resolve at load time instead.
Revenge_LDFLAGS = -undefined dynamic_lookup
2023-03-12 04:19:51 -04:00
2024-11-15 11:45:12 +01:00
RevengeResources_INSTALL_PATH = "/Library/Application\ Support/"
RevengeResources_RESOURCE_DIRS = Resources
2023-03-12 21:23:45 -04:00
2023-03-12 04:19:51 -04:00
include $(THEOS_MAKE_PATH)/tweak.mk
2024-11-14 11:15:18 +01:00
include $(THEOS_MAKE_PATH)/bundle.mk
before-all::
$(ECHO_NOTHING)mkdir -p Resources$(ECHO_END)
$(ECHO_NOTHING)sed -e 's/@PACKAGE_VERSION@/$(THEOS_PACKAGE_BASE_VERSION)/g' \
-e 's/@TWEAK_NAME@/$(TWEAK_NAME)/g' \
Sources/payload-base.template.js > Resources/payload-base.js$(ECHO_END)
after-stage::
$(ECHO_NOTHING)find $(THEOS_STAGING_DIR) -name ".DS_Store" -delete$(ECHO_END)
after-package::
$(ECHO_NOTHING)rm -rf Resources$(ECHO_END)