Skip to content

Commit

Permalink
Update script.js
Browse files Browse the repository at this point in the history
Added support for fuzzing universal links being handled by AppDelegate.
  • Loading branch information
In3tinct committed Jan 24, 2024
1 parent f96bd93 commit 765c81b
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions script/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,17 @@ rpc.exports = {
ctx = UIOpenURLContext.alloc().init();
ctxOpts = UISceneOpenURLOptions.alloc().init();
break;
case "delegate_activity":
NSUserActivityTypeBrowsingWeb = ObjC.Object(Memory.readPointer(Module.findExportByName(null, "NSUserActivityTypeBrowsingWeb")));
activity = NSUserActivity.alloc().initWithActivityType_(NSUserActivityTypeBrowsingWeb);
delegate = ObjC.Object(ObjC.chooseSync(ObjC.classes[delegateName])[0]);
shared = ObjC.Object(UIApplication.sharedApplication());
if (!appName) {
app = ObjC.Object(ObjC.chooseSync(UIApplication)[0]);
} else {
app = ObjC.Object(ObjC.chooseSync(ObjC.classes[appName])[0]);
}
break;
default:
return "method not implemented";
}
Expand Down Expand Up @@ -100,6 +111,13 @@ rpc.exports = {
sceneDelegate.scene_openURLContexts_(scene, setCtx);
});
break;
case "delegate_activity":
activity.setWebPageURL_(ur);

ObjC.schedule(ObjC.mainQueue, () => {
delegate.application_continueUserActivity_restorationHandler_(app,activity,activity);
})
break;
default:
return "method not implemented";
}
Expand Down

0 comments on commit 765c81b

Please sign in to comment.