Skip to content

Instantly share code, notes, and snippets.

@jimlyas
Last active February 3, 2022 02:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jimlyas/74557b71b5a5abd0534f0678a8392b24 to your computer and use it in GitHub Desktop.
Save jimlyas/74557b71b5a5abd0534f0678a8392b24 to your computer and use it in GitHub Desktop.
Gist for Security Android Medium
android {
buildTypes {
release {
debuggable false
minifyEnabled true
shrinkResources true
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
signingConfig signingConfigs.release
}
}
}
val okHttpClient = OkHttpClient.Builder()
.certificatePinner(CertificatePinner.Builder()
.add(
"www.example.com",
"sha256/ZC3lTYTDBJQVf1P2V7+fibTqbIsWNR/X7CWNVW+CEEA="
).build()
)
.build()
final SupportFactory factory = new SupportFactory(SQLiteDatabase.getBytes("userEnteredPassphrase"));
final SomeDatabase room = Room.databaseBuilder(activity, SomeDatabase.class, "YourDatabaseName")
.openHelperFactory(factory)
.build();
class a implements a1 {
private final String as = "SomethingImportantTokenHere";
public void e(String e) {
if(as==e) {
th();
} else {
eg();
}
}
}
class SampleClass : SomeInterface {
private val someToken = "SomeImportantTokenHere"
fun authenticate(token : String) {
if(someToken==token){
login()
} else {
forceLogout()
}
}
<?xml version='1.0' encoding='utf-8' standalone='yes' ?>
<map>
<string name="ghleirukgheiuklhgujkwershgifsdjkleh" value="wegerujkfhgvnbidfjklsghuierghkjsdhbnv" />
<string name="etglhj;riwkhgjkleurhgeruikljghetfge" value="equghkwrekhguisdjkghusjklrehbvkgjlifsrehguiorjkgbhljkert" />
</map>
<?xml version='1.0' encoding='utf-8' standalone='yes' ?>
<map>
<string name="username" value="something" />
<string name="password" value="somethingImportant" />
</map>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment