The Aeroplan mileage earned on an AC codeshared flight on another airline's metal, depends upon the rules of earning miles for that airline. See link below, for details on your particular questions:
https://www.aeroplan.com/en/collect/...rn_airline.jsp
(note - you must determine, from the Air Canada/Aeroplan/other airline's agent as to the booking code on that airline, which corresponds to the Q and L booking codes on an Air Canada ticket - and then use the web site to see what the converted booking code ticket will earn you, in terms of Aeroplan miles).