Skip to content

Instantly share code, notes, and snippets.

Avatar

Sakis Kaliakoudas athkalia

View GitHub Profile
@athkalia
athkalia / proguard-project
Created Jun 16, 2015
Android Proguard config that just works
View proguard-project
# // PROGUARD CONFIG FOR ALL ANDROID APPS // *******************************************************************************************************************
-optimizationpasses 5
-dontusemixedcaseclassnames
-dontskipnonpubliclibraryclasses
-dontskipnonpubliclibraryclassmembers
-dontpreverify
-verbose
-optimizations !code/simplification/arithmetic,!field/*,!class/merging/*
-flattenpackagehierarchy
@athkalia
athkalia / gist:efb36cb7716e650bf588
Last active Aug 29, 2015 — forked from ishida/gist:2719962
change alias in keystore using keytool
View gist:efb36cb7716e650bf588
$ keytool -changealias -keystore MY_KEYSTORE_2.jks -alias XXX-XXX-XXX-XXX-XXX -destalias MY_ALIAS
@athkalia
athkalia / pmd_rules.xml
Last active Mar 21, 2018
Rules for pmd
View pmd_rules.xml
<?xml version="1.0"?>
<ruleset name="mybraces"
xmlns="http://pmd.sourceforge.net/ruleset/2.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://pmd.sourceforge.net/ruleset/2.0.0 http://pmd.sourceforge.net/ruleset_2_0_0.xsd">
<description>PMD rules and properties</description>
<!--Specify the rule files and exclusions. Some rules have priority less than
warning and they don't trigger the teamcity fail build capability.-->
View checkstyle_rules.xml
<?xml version="1.0"?>
<!DOCTYPE module PUBLIC
"-//Puppy Crawl//DTD Check Configuration 1.3//EN"
"http://www.puppycrawl.com/dtds/configuration_1_3.dtd">
<!--All the rules for the checkstyle static analysis tool. Some rules run under
the 'Checker' module while most of them run under the 'TreeWalker' module.-->
<module name="Checker">
<!--=================================================================== Configuration ===================================================================-->
View ClinicalRecordsSdk.java
public class ClinicalRecordsSdk {
private static ClinicalRecordsSdk instance;
@Inject ClinicalRecordsApi clinicalRecordsApi;
public static ClinicalRecordsApi getApiInstance() {
if (instance == null) {
createInstance();
}
View CertificateCheck.java
private String calculateHash() {
try {
String certificateFingerprint = getCertificateSha1Fingerprint().toLowerCase(Locale.UK);
MessageDigest digest = MessageDigest.getInstance(SHA_256);
String packageName = context.getPackageName();
Timber.d("Calculating hash for package name %s", packageName);
digest.update(packageName.getBytes(UTF_8));
digest.update(certificateFingerprint.getBytes(UTF_8));
return HexEncoder.bytesToHexString(digest.digest());
} catch (NoSuchAlgorithmException e) {
View OfflineGenerateHash.kt
fun main(args: Array<String>) {
val digest = MessageDigest.getInstance("SHA-256")
args.forEach { digest.update(it.toLowerCase().toByteArray(Charset.forName("UTF-8"))) }
println(digest.digest().toHexString())
}
/**
@athkalia
athkalia / Android Privacy Policy Template
Last active Aug 14, 2018 — forked from alphamu/Android Privacy Policy Template
privacy policy just-another-android-app
View Android Privacy Policy Template
<html>
<body>
<h2>Privacy Policy</h2>
<p>Developer built the Just-another-android-app app as a open source app. This SERVICE is provided by the developer at no cost and is intended
for use as is.</p>
<p>This page is used to inform website visitors regarding my policies with the collection, use, and
disclosure of Personal Information if anyone decided to use my Service.</p>
<p>No information is collected other than the following</p>
<p><strong>Log Data</strong></p>
<p>I want to inform you that whenever you use my Service, in case of an error in the app I collect
View TodoFormatDetector.kt
package com.babylon.checks.detectors
import com.android.tools.lint.client.api.UElementHandler
import com.android.tools.lint.detector.api.Category
import com.android.tools.lint.detector.api.Detector
import com.android.tools.lint.detector.api.Implementation
import com.android.tools.lint.detector.api.Issue
import com.android.tools.lint.detector.api.JavaContext
import com.android.tools.lint.detector.api.Scope
import com.android.tools.lint.detector.api.Severity