3D printers turns materials i,e, thermoplastic) into a shape. But you still need the base materials. We are far from CHON food syntetizers. They must have some input, and better to be nutrient complete (and not what they think is nutrient complete, but what our body effectively needs). What it will use? Insects?, Soylent green ?
Anyway, just giving shape to something that you already have don't seem so big breakthrough. Just making a smoothie with them should be pretty similar.
Need to have a gun, the very mentality that everyone should have a gun, is the first mistake. But if you really want to have one, either for kill or to avoid being killed, why have one that could decide to not fire because misidentified you somewhat? holding it wrong was already pretty bad for iphones, but at least your life wouldn't depended on that, and a blue screen will be of death with those guns too.
And maybe more important, adding intelligence to refuse to fire because one input is opening the door to refusing to fire because other kind of inputs. Would be bad that criminals owning guns fire at police or soldiers, after all, so maybe would be nice to add a provision to avoid all people shooting at them. But for a lot, one of the reasons of having guns is to protect themselves from the tyranny of the government, and that excuse would be nullified by this. And maybe more important, if police/soldiers can identify themselves somewhat to avoid this happens (i.e. with a radio signal or whatever simple but powerful enough approach) it could be used by criminals too.
So, after you got your gun, that you won't be able to use it against a tyrannic government, nor against criminals, against who you will use it?
ANY signal that can be picked by the phone could be used by running malware to activate itself. It could trigger literally by holding it wrong, or being in the wrong place at the wrong time, is not something to particulary worry about, you have it running already, so the max damage they can do is not tied specifically to a random trigger.
Now, if we are talking about triggering the malware when it detects an open wifi, gets an internet connection, connect with a banking site, take a picture, or when you send a SMS, then the potential for doing something harmful is big.
Anyway, there are simpler approachs to carry your payload, i.e. doing a ripoff of a popular app, maybe offering it for free, having more or less the same functionality, but it also sends your personal or account information, or other apps private data, cookies and so on, qualifies as trojan, and the trigger will be the owner of the device, no sensors required.