Also, the "turn on your device" thing they sometimes do offers some mitigation against this. Obviously, you can think of ways that may defeat this too, but to defeat all of the security, accurately, in one small package that doesn't look sketchy, is not easy. Fortunately, most terrorists are not the brightest people in the world.
https://en.wikipedia.org/wiki/Puffer_machine
> The machine operates by releasing multiple puffs of air at a passenger who is standing upright within the machine. This will flush out any particles on the person inside the machine then analyze and identify them in seconds.[6] According to an article in the 16 June, 2005, New York Times, it is capable of screening up to 180 passengers an hour.[7] This sample is then analyzed using IMS or MS technology to search for specific explosive or narcotic compounds. If a substance of concern is detected, the security personnel are notified by a visible and/or audible alarm.
From the article: "since lithium batteries are completely opaque to x-rays"
Everyone can go around with battery-less laptops so they can't use them in the few planes that get retrofit, and no other place without plugs.