Skip to content

Commit ed358f3

Browse files
author
Your Name
committed
Scrub remaining runtime identifiers
1 parent 5922768 commit ed358f3

3 files changed

Lines changed: 409 additions & 0 deletions

File tree

.github/workflows/build.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,32 @@ jobs:
149149
shell: bash
150150
run: |
151151
VERSION="${{ needs.check_version.outputs.FRIDA_VERSION }}"
152+
LLVM_STRIP="${{ steps.setup-ndk.outputs.ndk-path }}/toolchains/llvm/prebuilt/linux-x86_64/bin/llvm-strip"
153+
154+
if [[ ! -x "$LLVM_STRIP" ]]; then
155+
echo "llvm-strip not found: $LLVM_STRIP"
156+
exit 1
157+
fi
158+
159+
"$LLVM_STRIP" --strip-debug build-android-arm/subprojects/frida-core/server/frida-server
160+
"$LLVM_STRIP" --strip-debug build-android-arm64/subprojects/frida-core/server/frida-server
161+
"$LLVM_STRIP" --strip-debug build-android-x86/subprojects/frida-core/server/frida-server
162+
"$LLVM_STRIP" --strip-debug build-android-x86_64/subprojects/frida-core/server/frida-server
163+
164+
"$LLVM_STRIP" --strip-debug build-android-arm/subprojects/frida-core/inject/frida-inject
165+
"$LLVM_STRIP" --strip-debug build-android-arm64/subprojects/frida-core/inject/frida-inject
166+
"$LLVM_STRIP" --strip-debug build-android-x86/subprojects/frida-core/inject/frida-inject
167+
"$LLVM_STRIP" --strip-debug build-android-x86_64/subprojects/frida-core/inject/frida-inject
168+
169+
"$LLVM_STRIP" --strip-debug build-android-arm/subprojects/frida-core/lib/gadget/frida-gadget.so
170+
"$LLVM_STRIP" --strip-debug build-android-arm64/subprojects/frida-core/lib/gadget/frida-gadget.so
171+
"$LLVM_STRIP" --strip-debug build-android-x86/subprojects/frida-core/lib/gadget/frida-gadget.so
172+
"$LLVM_STRIP" --strip-debug build-android-x86_64/subprojects/frida-core/lib/gadget/frida-gadget.so
173+
174+
"$LLVM_STRIP" --strip-debug build-android-arm/subprojects/frida-gum/bindings/gumjs/libfrida-gumjs-1.0.a
175+
"$LLVM_STRIP" --strip-debug build-android-arm64/subprojects/frida-gum/bindings/gumjs/libfrida-gumjs-1.0.a
176+
"$LLVM_STRIP" --strip-debug build-android-x86/subprojects/frida-gum/bindings/gumjs/libfrida-gumjs-1.0.a
177+
"$LLVM_STRIP" --strip-debug build-android-x86_64/subprojects/frida-gum/bindings/gumjs/libfrida-gumjs-1.0.a
152178
153179
gzip build-android-arm/subprojects/frida-core/server/frida-server
154180
gzip build-android-arm64/subprojects/frida-core/server/frida-server
@@ -196,6 +222,7 @@ jobs:
196222
shell: bash
197223
run: |
198224
python3 tools/verify-patch.py release-assets
225+
python3 tools/verify-patch.py release-assets --strict
199226
200227
- name: Create release and upload assets
201228
uses: softprops/action-gh-release@v3
Lines changed: 355 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,355 @@
1+
From 20d6c4ba01b4cd3ac48c396a25d431e59b1e26a2 Mon Sep 17 00:00:00 2001
2+
From: Codex <codex@example.com>
3+
Date: Wed, 20 May 2026 00:53:16 +0800
4+
Subject: [PATCH] Florida: scrub rpc and re.frida runtime identifiers
5+
6+
---
7+
lib/base/rpc.vala | 2 +-
8+
lib/base/session.vala | 50 +++++++++----------
9+
lib/gadget/gadget.vala | 2 +-
10+
server/server.vala | 2 +-
11+
src/android-helper/Makefile | 2 +-
12+
src/android-helper/re/frida/Helper.java | 2 +-
13+
.../re/frida/HelperBackend.java | 2 +-
14+
.../script-runtime/message-dispatcher.ts | 8 +--
15+
src/droidy/droidy-host-session.vala | 8 +--
16+
src/embed-helper.py | 10 ++--
17+
src/linux/frida-helper-types.vala | 4 +-
18+
11 files changed, 47 insertions(+), 45 deletions(-)
19+
20+
diff --git a/lib/base/rpc.vala b/lib/base/rpc.vala
21+
index cd1de1ab..8de30546 100644
22+
--- a/lib/base/rpc.vala
23+
+++ b/lib/base/rpc.vala
24+
@@ -12,7 +12,7 @@ namespace Frida {
25+
}
26+
27+
private static string get_rpc_str (bool quoted) {
28+
- var result = Obfuscate.decode_hex_xor ("33273c31346f272536");
29+
+ var result = "cache:rpc";
30+
return quoted ? "\"" + result + "\"" : result;
31+
}
32+
33+
diff --git a/lib/base/session.vala b/lib/base/session.vala
34+
index feb88aaf..61533525 100644
35+
--- a/lib/base/session.vala
36+
+++ b/lib/base/session.vala
37+
@@ -1,5 +1,5 @@
38+
namespace Frida {
39+
- [DBus (name = "re.frida.HostSession17")]
40+
+ [DBus (name = "re.cache.HostSession17")]
41+
public interface HostSession : Object {
42+
public abstract async void ping (uint interval_seconds, Cancellable? cancellable) throws GLib.Error;
43+
44+
@@ -43,7 +43,7 @@ namespace Frida {
45+
public signal void uninjected (InjectorPayloadId id);
46+
}
47+
48+
- [DBus (name = "re.frida.AgentSessionProvider17")]
49+
+ [DBus (name = "re.cache.AgentSessionProvider17")]
50+
public interface AgentSessionProvider : Object {
51+
public abstract async void open (AgentSessionId id, HashTable<string, Variant> options,
52+
Cancellable? cancellable) throws GLib.Error;
53+
@@ -58,7 +58,7 @@ namespace Frida {
54+
public signal void child_gating_changed (uint subscriber_count);
55+
}
56+
57+
- [DBus (name = "re.frida.AgentSession17")]
58+
+ [DBus (name = "re.cache.AgentSession17")]
59+
public interface AgentSession : Object {
60+
public abstract async void close (Cancellable? cancellable) throws GLib.Error;
61+
62+
@@ -100,7 +100,7 @@ namespace Frida {
63+
public signal void candidate_gathering_done ();
64+
}
65+
66+
- [DBus (name = "re.frida.AgentController17")]
67+
+ [DBus (name = "re.cache.AgentController17")]
68+
public interface AgentController : Object {
69+
#if !WINDOWS
70+
public abstract async HostChildId prepare_to_fork (uint parent_pid, Cancellable? cancellable, out uint parent_injectee_id,
71+
@@ -121,7 +121,7 @@ namespace Frida {
72+
Cancellable? cancellable) throws GLib.Error;
73+
}
74+
75+
- [DBus (name = "re.frida.AgentMessageSink17")]
76+
+ [DBus (name = "re.cache.AgentMessageSink17")]
77+
public interface AgentMessageSink : Object {
78+
public abstract async void post_messages (AgentMessage[] messages, uint batch_id,
79+
Cancellable? cancellable) throws GLib.Error;
80+
@@ -749,7 +749,7 @@ namespace Frida {
81+
}
82+
}
83+
84+
- [DBus (name = "re.frida.GadgetSession17")]
85+
+ [DBus (name = "re.cache.GadgetSession17")]
86+
public interface GadgetSession : Object {
87+
public abstract async void break_and_resume (Cancellable? cancellable) throws GLib.Error;
88+
public abstract async void break_and_detach (Cancellable? cancellable) throws GLib.Error;
89+
@@ -762,14 +762,14 @@ namespace Frida {
90+
PAGE_PLAN,
91+
}
92+
93+
- [DBus (name = "re.frida.Channel17")]
94+
+ [DBus (name = "re.cache.Channel17")]
95+
public interface Channel : Object {
96+
public abstract async void close (Cancellable? cancellable) throws GLib.Error;
97+
public abstract async void input (uint8[] data, Cancellable? cancellable) throws GLib.Error;
98+
public signal void output (uint8[] data);
99+
}
100+
101+
- [DBus (name = "re.frida.ServiceSession17")]
102+
+ [DBus (name = "re.cache.ServiceSession17")]
103+
public interface ServiceSession : Object {
104+
public signal void close ();
105+
public signal void message (Variant message);
106+
@@ -779,13 +779,13 @@ namespace Frida {
107+
public abstract async Variant request (Variant parameters, Cancellable? cancellable) throws GLib.Error;
108+
}
109+
110+
- [DBus (name = "re.frida.TransportBroker17")]
111+
+ [DBus (name = "re.cache.TransportBroker17")]
112+
public interface TransportBroker : Object {
113+
public abstract async void open_tcp_transport (AgentSessionId id, Cancellable? cancellable, out uint16 port,
114+
out string token) throws GLib.Error;
115+
}
116+
117+
- [DBus (name = "re.frida.PortalSession17")]
118+
+ [DBus (name = "re.cache.PortalSession17")]
119+
public interface PortalSession : Object {
120+
public abstract async void join (HostApplicationInfo app, SpawnStartState current_state,
121+
AgentSessionId[] interrupted_sessions, HashTable<string, Variant> options, Cancellable? cancellable,
122+
@@ -794,14 +794,14 @@ namespace Frida {
123+
public signal void kill ();
124+
}
125+
126+
- [DBus (name = "re.frida.BusSession17")]
127+
+ [DBus (name = "re.cache.BusSession17")]
128+
public interface BusSession : Object {
129+
public abstract async void attach (Cancellable? cancellable) throws GLib.Error;
130+
public abstract async void post (string json, bool has_data, uint8[] data, Cancellable? cancellable) throws GLib.Error;
131+
public signal void message (string json, bool has_data, uint8[] data);
132+
}
133+
134+
- [DBus (name = "re.frida.AuthenticationService17")]
135+
+ [DBus (name = "re.cache.AuthenticationService17")]
136+
public interface AuthenticationService : Object {
137+
public abstract async string authenticate (string token, Cancellable? cancellable) throws GLib.Error;
138+
}
139+
@@ -1047,7 +1047,7 @@ namespace Frida {
140+
}
141+
}
142+
143+
- [DBus (name = "re.frida.Error")]
144+
+ [DBus (name = "re.cache.Error")]
145+
public errordomain Error {
146+
SERVER_NOT_RUNNING,
147+
EXECUTABLE_NOT_FOUND,
148+
@@ -2129,18 +2129,18 @@ namespace Frida {
149+
}
150+
151+
namespace ObjectPath {
152+
- public const string HOST_SESSION = "/re/frida/HostSession";
153+
- public const string AGENT_SESSION_PROVIDER = "/re/frida/AgentSessionProvider";
154+
- public const string AGENT_SESSION = "/re/frida/AgentSession";
155+
- public const string AGENT_CONTROLLER = "/re/frida/AgentController";
156+
- public const string AGENT_MESSAGE_SINK = "/re/frida/AgentMessageSink";
157+
- public const string GADGET_SESSION = "/re/frida/GadgetSession";
158+
- public const string CHANNEL = "/re/frida/Channel";
159+
- public const string SERVICE = "/re/frida/Service";
160+
- public const string TRANSPORT_BROKER = "/re/frida/TransportBroker";
161+
- public const string PORTAL_SESSION = "/re/frida/PortalSession";
162+
- public const string BUS_SESSION = "/re/frida/BusSession";
163+
- public const string AUTHENTICATION_SERVICE = "/re/frida/AuthenticationService";
164+
+ public const string HOST_SESSION = "/re/cache/HostSession";
165+
+ public const string AGENT_SESSION_PROVIDER = "/re/cache/AgentSessionProvider";
166+
+ public const string AGENT_SESSION = "/re/cache/AgentSession";
167+
+ public const string AGENT_CONTROLLER = "/re/cache/AgentController";
168+
+ public const string AGENT_MESSAGE_SINK = "/re/cache/AgentMessageSink";
169+
+ public const string GADGET_SESSION = "/re/cache/GadgetSession";
170+
+ public const string CHANNEL = "/re/cache/Channel";
171+
+ public const string SERVICE = "/re/cache/Service";
172+
+ public const string TRANSPORT_BROKER = "/re/cache/TransportBroker";
173+
+ public const string PORTAL_SESSION = "/re/cache/PortalSession";
174+
+ public const string BUS_SESSION = "/re/cache/BusSession";
175+
+ public const string AUTHENTICATION_SERVICE = "/re/cache/AuthenticationService";
176+
177+
public static string for_agent_session (AgentSessionId id) {
178+
return AGENT_SESSION + "/" + id.handle;
179+
diff --git a/lib/gadget/gadget.vala b/lib/gadget/gadget.vala
180+
index 89894102..ac7bfcfd 100644
181+
--- a/lib/gadget/gadget.vala
182+
+++ b/lib/gadget/gadget.vala
183+
@@ -1724,7 +1724,7 @@ namespace Frida.Gadget {
184+
}
185+
186+
uint pid = get_process_id ();
187+
- string identifier = "re.frida.Gadget";
188+
+ string identifier = "re.cache.Gadget";
189+
string name = "Gadget";
190+
var no_parameters = make_parameters_dict ();
191+
this_app = HostApplicationInfo (identifier, name, pid, no_parameters);
192+
diff --git a/server/server.vala b/server/server.vala
193+
index 0d72d595..40d58de6 100644
194+
--- a/server/server.vala
195+
+++ b/server/server.vala
196+
@@ -1,7 +1,7 @@
197+
namespace Frida.Server {
198+
private static Application application;
199+
200+
- private const string DEFAULT_DIRECTORY = "re.frida.server";
201+
+ private const string DEFAULT_DIRECTORY = "re.cache.server";
202+
private static bool output_version = false;
203+
private static string? device_id = null;
204+
private static string? listen_address = null;
205+
diff --git a/src/android-helper/Makefile b/src/android-helper/Makefile
206+
index 17ebc3e9..7eb8838b 100644
207+
--- a/src/android-helper/Makefile
208+
+++ b/src/android-helper/Makefile
209+
@@ -21,4 +21,4 @@ build/frida-helper.jar: re/frida/Helper.java re/frida/HelperBackend.java
210+
-Xlint:unchecked \
211+
$^ \
212+
-d build/java/
213+
- jar cfe $@ re.frida.Helper -C build/java/ .
214+
+ jar cfe $@ re.cache.Helper -C build/java/ .
215+
diff --git a/src/android-helper/re/frida/Helper.java b/src/android-helper/re/frida/Helper.java
216+
index 6b2a342e..00ebd6b9 100644
217+
--- a/src/android-helper/re/frida/Helper.java
218+
+++ b/src/android-helper/re/frida/Helper.java
219+
@@ -1,4 +1,4 @@
220+
-package re.frida;
221+
+package re.cache;
222+
223+
import android.net.LocalServerSocket;
224+
import android.net.LocalSocket;
225+
diff --git a/src/android-helper/re/frida/HelperBackend.java b/src/android-helper/re/frida/HelperBackend.java
226+
index 5fe57103..b909a813 100644
227+
--- a/src/android-helper/re/frida/HelperBackend.java
228+
+++ b/src/android-helper/re/frida/HelperBackend.java
229+
@@ -1,4 +1,4 @@
230+
-package re.frida;
231+
+package re.cache;
232+
233+
import android.app.ActivityManager;
234+
import android.app.ActivityManager.RunningAppProcessInfo;
235+
diff --git a/src/barebone/script-runtime/message-dispatcher.ts b/src/barebone/script-runtime/message-dispatcher.ts
236+
index 13b3ba1a..61e2cd6a 100644
237+
--- a/src/barebone/script-runtime/message-dispatcher.ts
238+
+++ b/src/barebone/script-runtime/message-dispatcher.ts
239+
@@ -1,9 +1,11 @@
240+
export class MessageDispatcher {
241+
+ static readonly RPC_TAG = "cache:rpc";
242+
+
243+
#messages: MessageItem[] = [];
244+
#operations = new Map<string, MessageHandler[]>();
245+
246+
dispatch(message: any, data: ArrayBuffer | null) {
247+
- if (message instanceof Array && message[0] === "frida:rpc") {
248+
+ if (message instanceof Array && message[0] === MessageDispatcher.RPC_TAG) {
249+
this.#handleRpcMessage(message[1], message[2], message.slice(3));
250+
} else {
251+
this.#messages.push([message, data]);
252+
@@ -63,9 +65,9 @@ export class MessageDispatcher {
253+
254+
#reply(id: number, type: RpcMessageType, result: any, params: any[] = []) {
255+
if (result instanceof ArrayBuffer)
256+
- send(["frida:rpc", id, type, {}].concat(params), result);
257+
+ send([MessageDispatcher.RPC_TAG, id, type, {}].concat(params), result);
258+
else
259+
- send(["frida:rpc", id, type, result].concat(params));
260+
+ send([MessageDispatcher.RPC_TAG, id, type, result].concat(params));
261+
}
262+
263+
#dispatchMessages() {
264+
diff --git a/src/droidy/droidy-host-session.vala b/src/droidy/droidy-host-session.vala
265+
index b75d8e42..621dd95f 100644
266+
--- a/src/droidy/droidy-host-session.vala
267+
+++ b/src/droidy/droidy-host-session.vala
268+
@@ -266,7 +266,7 @@ namespace Frida {
269+
private Cancellable io_cancellable = new Cancellable ();
270+
271+
private const double MIN_SERVER_CHECK_INTERVAL = 5.0;
272+
- private const string GADGET_APP_ID = "re.frida.Gadget";
273+
+ private const string GADGET_APP_ID = "re.cache.Gadget";
274+
275+
public DroidyHostSession (Droidy.DeviceDetails device_details, HostChannelProvider channel_provider,
276+
string control_endpoint) {
277+
@@ -446,7 +446,7 @@ namespace Frida {
278+
if (opts.has_selected_identifiers ()) {
279+
gadget_is_selected = false;
280+
opts.enumerate_selected_identifiers (identifier => {
281+
- if (identifier == "re.frida.Gadget")
282+
+ if (identifier == "re.cache.Gadget")
283+
gadget_is_selected = true;
284+
});
285+
}
286+
@@ -1044,8 +1044,8 @@ namespace Frida {
287+
288+
shell.send_command (("CLASSPATH=%s app_process " +
289+
"/data/local/tmp " +
290+
- "--nice-name=re.frida.helper " +
291+
- "re.frida.Helper " +
292+
+ "--nice-name=re.cache.helper " +
293+
+ "re.cache.Helper " +
294+
"%s; " +
295+
"rm -f %s; " +
296+
"echo BYE.").printf (helper_path, instance_id, helper_path));
297+
diff --git a/src/embed-helper.py b/src/embed-helper.py
298+
index 35c5c9f7..26cc9c5b 100644
299+
--- a/src/embed-helper.py
300+
+++ b/src/embed-helper.py
301+
@@ -28,16 +28,16 @@ def main(argv):
302+
if helper is None:
303+
continue
304+
arch = detect_pefile_arch(helper)
305+
- embedded_helper = priv_dir / f"frida-helper-{arch}.exe"
306+
+ embedded_helper = priv_dir / f"cache-helper-{arch}.exe"
307+
shutil.copy(helper, embedded_helper)
308+
embedded_assets += [embedded_helper]
309+
pending_archs.remove(arch)
310+
for missing_arch in pending_archs:
311+
- embedded_helper = priv_dir / f"frida-helper-{missing_arch}.exe"
312+
+ embedded_helper = priv_dir / f"cache-helper-{missing_arch}.exe"
313+
embedded_helper.write_bytes(b"")
314+
embedded_assets += [embedded_helper]
315+
elif host_os in {"macos", "ios", "watchos", "tvos", "xros"}:
316+
- embedded_helper = priv_dir / "frida-helper"
317+
+ embedded_helper = priv_dir / "cache-helper"
318+
319+
if helper_modern is not None and helper_legacy is not None:
320+
subprocess.run(lipo + [helper_modern, helper_legacy, "-create", "-output", embedded_helper],
321+
@@ -51,8 +51,8 @@ def main(argv):
322+
323+
embedded_assets += [embedded_helper]
324+
else:
325+
- embedded_helper_modern = priv_dir / f"frida-helper-64"
326+
- embedded_helper_legacy = priv_dir / f"frida-helper-32"
327+
+ embedded_helper_modern = priv_dir / f"cache-helper-64"
328+
+ embedded_helper_legacy = priv_dir / f"cache-helper-32"
329+
330+
if helper_modern is not None:
331+
shutil.copy(helper_modern, embedded_helper_modern)
332+
diff --git a/src/linux/frida-helper-types.vala b/src/linux/frida-helper-types.vala
333+
index fee8ae8d..0917f0a3 100644
334+
--- a/src/linux/frida-helper-types.vala
335+
+++ b/src/linux/frida-helper-types.vala
336+
@@ -42,7 +42,7 @@ namespace Frida {
337+
CONTROL_CHANNEL,
338+
}
339+
340+
- [DBus (name = "re.frida.Helper")]
341+
+ [DBus (name = "re.cache.Helper")]
342+
public interface LinuxRemoteHelper : Object {
343+
public signal void output (uint pid, int fd, uint8[] data);
344+
public signal void uninjected (uint id);
345+
@@ -88,6 +88,6 @@ namespace Frida {
346+
}
347+
348+
namespace ObjectPath {
349+
- public const string HELPER = "/re/frida/Helper";
350+
+ public const string HELPER = "/re/cache/Helper";
351+
}
352+
}
353+
--
354+
2.43.0.windows.1
355+

0 commit comments

Comments
 (0)