Skip to content

Commit

Permalink
fix: FileShareExtHook: check for duplicate before add item
Browse files Browse the repository at this point in the history
  • Loading branch information
cinit committed Jul 24, 2023
1 parent bf01681 commit ffbbe8f
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions app/src/main/java/cc/ioctl/hook/msg/FileShareExtHook.java
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,15 @@ protected boolean initOnce() throws Exception {
return;
}
ArrayList<Object> row2 = results[1];
// check if already added
if (!row2.isEmpty()) {
Object lastItem = row2.get(row2.size() - 1);
int id = Reflex.getInstanceObject(lastItem, "id", int.class);
if (id == R.id.ShareActionSheet_shareFileWithExtApp) {
// already added
return;
}
}
Object item = ctorActionSheetItem.newInstance();
Context ctx = Reflex.getFirstByType(param.thisObject, Activity.class);
Parasitics.injectModuleResources(ctx.getResources());
Expand Down

0 comments on commit ffbbe8f

Please sign in to comment.