The licenses you bought on the Mac App Store are non-transferable, as you already found out. The license for the preinstalled copy CAN be transfered, but only as part of a transfer with the original hardware it was installed on.
Therefor the only thing you can do when selling your old computer is delivering it with the original software it came with. Anything else would be a violation of the license agreement, and can be considered as software piracy.
Since I got the popup in iOS Simulator, I was able to use Safari's Develop menu to inspect the page. From there it was just an exercise in rooting around to find the obfuscated JavaScript, which, when run through jsbeautifier.org (which has the side effect of de-obfuscating it), looks like this:
var m = ['iphone', 'ipod', 'ipad', 'android'],
u = navigator['userAgent']['toLowerCase']();
for (var d = 0; d < m['length']; d++) {
if (u['indexOf'](m[d]) != -1) {
if (confirm('Why you no play Candy Crush!!')) {
window['top']['location'] = document['getElementById']('creative')['href'];
break;
};
};
};
I think it's pretty safe to say that this is indeed a rogue ad, since on the page where I saw it, the ad itself was blank. It's trying to get you to click through to a link.
So, in other words, it's a real pain in the buttocks, but probably not actual malware. The ad in question is apparently delivered by AdMax by NEXAGE, so I'll see what I can do about alerting them.
Best Answer
Apple does not really come into the equation here. There are no rules stating that you must specific open source licenses or anything like that.
In order to publish app on the App Store you need to have properly licensed code. It doesn't matter which license it is as such, you just need to have the rights to use the code in the manner you're choosing to do so.
If you want to know about combining (L)GPL code with MPL code in general, you can find a very thorough and practical set of instructions here:
https://www.mozilla.org/en-US/MPL/2.0/combining-mpl-and-gpl/