They will not shoot you for smoking a joint. They most likely will think its a hand rolled cig.
The cops have much more important things to do than bust a foreigner for smoking a joint. I don't smoke but I think you should have no problem finding it in Beijing, just as in any other large world city.
China is not going to shoot you in the head for anything like that, those who tell you otherwise haven't lived in China or been to China very often.