JSN, the smell of marijuana alone isn't probable cause to enter a home without a warrant. See Johnson v US (1948) and Taylor v US (1932).

Twista, it seems that the janitor holds the key to your future, not only that night with the actual key but what he knew and said to the police officer. Your friend's rights as a leaser of an apartment vary from state to state and I believe in some states maintainance or other workers or management are not allowed to unlock the door for police offices without a warrant.

Depending on your state laws, here's why he holds the key. Did he know that although the apartment was empty for some time it just finally got rented out and a lease had been signed? Did he tell the police officer this or did he think it was still unleased and told the officer it was unleased? What did the officer do to find out if it should have been empty or occupied? Although it is just a misdemeanor and the prosecutor may not put that much effort into it you should, well your lawyer should. Maybe the janitor told him someone just signed the lease 2 days before and the cop told him to open it anyway. Maybe he really thought it was empty and told the cop this and the cop was acting on good faith. Things you need to find out.

The fact you were in a back bedroom with the door closed really doesn't seem to help your case much. If he had the right to enter the apartment or thought he did have the right, I doubt all 7 of you were as quiet as mice back there. He enters the location and if the judge finds he did so legally then chances are the judge is going to say it was reasonable for him to perform a limited search, if nothing else for his safety. He hears a bunch of people behind a closed door that what he thought shouldn't be there then how does he know the door isn't going to fly open with guns blazing. Once he opens the door, he's going to say that the marijuana that was on the floor was in plain view and if at this point what he has done hasn't been ruled illegal, then chances are anything after opening the bedroom door is going to be admissible.

If your lawyer started trying to push forward and trying to suppress evidence and filing a motion for discovery and deposing the police officer, the state may find it is too much trouble to prosecute and may offer you some deal. They almost always offer deals but you may be able to push yourself into a really good deal for such a headache of a case. Talk to the janitor and maybe he'll clue you in to what was said between him and the cop.