Apple buys back shares as Q2 earnings rise