Alternatively you could take the gas piston out, make it so that it won't be semi-auto and you can go down to 26" overall length with a 16" barrel and detachable mags. Just have to cycle it by hand like the brits.
12276.1 (a) Notwithstanding Penal Code section 12276, “assault weapon” shall also mean the following:
(1) A semiautomatic, centerfire rifle that has the capacity to accept a detachable magazine and any one of
(A) A pistol grip that protrudes conspicuously beneath the action of the weapon.
(B) A thumbhole stock.
(C) A folding or telescoping stock.
(D) A grenade launcher or flare launcher.
(E) A flash suppressor.
(F) A forward pistol grip.
(2) A semiautomatic, centerfire rifle that has a fixed magazine with the capacity to accept more than 10
(3) A semiautomatic, centerfire rifle that has an overall length of less than 30 inches.