diff --git a/app/src/main/java/cc/ioctl/hook/msg/FileShareExtHook.java b/app/src/main/java/cc/ioctl/hook/msg/FileShareExtHook.java index eec08b9cdd..29a3fd5760 100644 --- a/app/src/main/java/cc/ioctl/hook/msg/FileShareExtHook.java +++ b/app/src/main/java/cc/ioctl/hook/msg/FileShareExtHook.java @@ -161,6 +161,15 @@ protected boolean initOnce() throws Exception { return; } ArrayList 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());