Skip to content

Instantly share code, notes, and snippets.

@athkalia
athkalia / proguard-project
Created June 16, 2015 02:04
Android Proguard config that just works
# // 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 August 29, 2015 14:25 — forked from ishida/gist:2719962
change alias in keystore using keytool
$ keytool -changealias -keystore MY_KEYSTORE_2.jks -alias XXX-XXX-XXX-XXX-XXX -destalias MY_ALIAS
@athkalia
athkalia / pmd_rules.xml
Last active August 27, 2024 07:47
Rules for pmd
<?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.-->
<?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 ===================================================================-->
@athkalia
athkalia / Android Privacy Policy Template
Last active August 14, 2018 05:55 — forked from alphamu/Android Privacy Policy Template
privacy policy just-another-android-app
<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
public class ClinicalRecordsSdk {
private static ClinicalRecordsSdk instance;
@Inject ClinicalRecordsApi clinicalRecordsApi;
public static ClinicalRecordsApi getApiInstance() {
if (instance == null) {
createInstance();
}
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) {
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())
}
/**
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