One of my friends recently made a website where one could download paid apps on the Play store for free. I also saw many other websites that do the same.
- How did he do it?
- Is it legal? If yes, then why?
Before I get into the details, understand that pirating software is illegal and will certainly land you in hot water.
That being said, Android apps are really easy to pirate. An
.apk file is really a collection of obfuscated Java bytecode, which can be easily reverse engineered to produce the original source (though, of course, with illegible method names, etc.) It won't be a perfect copy of the original source code, but it will allow a pirate to remove parts where licenses are checked, trials are consumed, and possibly add more code that circumvents in-app purchases.
Most apps are obfuscated using ProGuard, though Google is trying out a new obfuscator in Android Studio 3.2 and above. It's unknown how effective the new obfuscator is. Developers need to understand a determined person could reverse engineer just about anything.
Again, this is illegal. Don't attempt to crack paid software.
As to why it's illegal, there's laws and regulations such as the DMCA that heavily regulate piracy. You can be subject to lawsuits for criminal copyright infringement. This is applicable in the US and probably many other countries.