BlackBerry and Nokia have reinvented themselves as AI plays, with shares up 156% and 219%, respectively, over the past year.