National security law most certainly apply to foreigners, since its chiefly foreigners who are most active in endangering Chinese national security. Chinese nationals working for hostile foreign powers are just expendable useful idiots who will also get caught by the law, but the chief targets are the foreign agents who are the real ringleaders and masterminds.
It would make no sense for national security laws to have no powers against foreign nationals operating on Chinese soil. Indeed, that was why the likes of America were protesting the law, they couldn’t give two shits about the local useful idiots, as evidenced by they booting said idiots out when they went to the American embassy to beg for their masters to save them. But as soon as the new law came into effect and their own people’s arses were on the line, all the riots magically stopped.
On the specific case of Jimmy, well I think China has a clause established especially for traitors like him. Just because you got a foreign passport does not shield you from being treated like any other Chinese National. If ever there is a case where that should apply, Jimmy’s is the one.
That means that he can and should he tried as the traitor that he is.