This should be simple to get around.
Use the PackageManager, look for the package's uri
eg.
com.approb.lucky (this is isn't the exact one as I don't really want to install this on my dev phone, please post it if you know it)
if you see the package is installed, then refuse to run your app by showing a message that we do not support piracy, or that to protect their privacy the app will not run because malware called lucky patcher was detected. That should scare em into removing it probably.
They can patch all they want, but we can always know if it's installed.
AdAware blocks ads differently. It just makes a local list of ad websites and redirects them to nothing, causing ads to appear transparent since most people don't think to color a box black before drawing an ad. This one seems like much more of a menace since it does who knows what to apk's.
The second way is gonna be harder but might worth for the b4a guys to look into, somehow generating an encrypted md5 checksum and storing it with the app as a second level of verification protection specific to b4a apps so when they open, they can check if its been tampered with.