Open neethuravindran opened 6 years ago
I like this idea. Here's my current thoughts about how it should be implemented:
So we could do something simple like base64 encoding, but also putting all the decoded values in a comment above to keep readability the same. As the comments will be dropped during compilation a simple string search will not longer work.
/*
The following array stores the following package names in base64:
"com.noshufou.android.su",
"com.noshufou.android.su.elite",
"eu.chainfire.supersu",
"com.koushikdutta.superuser",
"com.thirdparty.superuser",
"com.yellowes.su",
"com.topjohnwu.magisk"
*/
public static final String[] knownRootAppsPackages = {
"Y29tLm5vc2h1Zm91LmFuZHJvaWQuc3U=",
"Y29tLm5vc2h1Zm91LmFuZHJvaWQuc3UuZWxpdGU=",
"ZXUuY2hhaW5maXJlLnN1cGVyc3U=",
"Y29tLmtvdXNoaWtkdXR0YS5zdXBlcnVzZXI=",
"Y29tLnRoaXJkcGFydHkuc3VwZXJ1c2Vy",
"Y29tLnllbGxvd2VzLnN1",
"Y29tLnRvcGpvaG53dS5tYWdpc2s="
};
Hallo @stealthcopter
yes, but base64 is too simple )
for example encrypt original strings with AES256(str, salt), where salt is external hash. This make hard to find a pre-defined strings or base64(str)-strings...
what you think?
@WuglyakBolgoink yeah, I like the idea of it not being static. I'm not aware of a good way of doing this in java/android/gradle. We also have the issue that if it's a compile time thing that all current build processes are supported as we don't want to break anything using our library. We welcome PR and contributions, so if you have time and want to have a look into it please do!
I could see it working with an encrypted properties file that we generate each release (and chuck the corresponding keys into a java class), however that's seems like it could be prone to breaking from updates.
For the below constants, It would be better to keep the encrypted file path strings in the string array **1. knownRootAppsPackages