8000 android: Omit user when uid has no passwd entry by kkuehl · Pull Request #1298 · frida/frida-core · GitHub
[go: up one dir, main page]

Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified src/android-helper/helper.dex
Binary file not shown.
10 changes: 8 additions & 2 deletions src/android-helper/re/frida/HelperBackend.java
Original file line number Diff line number Diff line change
Expand Up @@ -1103,7 +1103,11 @@ private void addProcessMetadata(JSONObject parameters, int pid) throws IOExcepti
Date started = new Date(mSystemBootTime + startTimeDeltaInMilliseconds);

try {
parameters.put("user", resolveUserIdToName(uid));
parameters.put("uid", uid);
String user = resolveUserIdToName(uid);
if (user != null) {
parameters.put("user", user);
}
parameters.put("ppid", ppid);
parameters.put("started", mIso8601.format(started));
} catch (JSONException e) {
Expand Down Expand Up @@ -1160,7 +1164,9 @@ private String readlink(String path) throws Exception {
private String resolveUserIdToName(int uid) {
try {
return (String) mPwnameField.get(mGetpwuid.invoke(mGetpwuidReceiver, uid));
} catch (IllegalArgumentException | IllegalAccessException | InvocationTargetException e) {
} catch (InvocationTargetException e) {
return null;
} catch (IllegalArgumentException | IllegalAccessException e) {
throw new RuntimeException(e);
}
}
Expand Down
2BEC
0