Skip to content

Instantly share code, notes, and snippets.

View ed-george's full-sized avatar
🌍
Working remotely...

Ed Holloway-George ed-george

🌍
Working remotely...
View GitHub Profile
@ed-george
ed-george / Example4.kt
Created June 4, 2022 00:10
Unpacking Android Security: Part 2 - Insecure Data Storage (Example 4)
// Use a user-entered passphrase to encrypt/decrypt
val passPhrase: ByteArray = "password".encodeToByteArray()
val sqlCipherSupportFactory: SupportSQLiteOpenHelper.Factory = SupportFactory(passPhrase)
val database = Room.databaseBuilder(
applicationContext,
YourRoomDatabase::class.java,
"secure-database")
.openHelperFactory(sqlCipherSupportFactory)
.build()
@ed-george
ed-george / Example5.kt
Created June 4, 2022 00:11
Unpacking Android Security: Part 2 - Insecure Data Storage (Example 5)
val Context.dataStore by preferencesDataStore(name = "insecure-data-store")
val pref1 = stringPreferencesKey("example_pref")
val pref2 = stringPreferencesKey("example_pref_2")
dataStore.edit { settings ->
settings[pref1] = "My 1st Pref"
settings[pref2] = "My 2nd Pref"
}
@ed-george
ed-george / trackSynthetics.sh
Created August 19, 2022 12:27
A simple bash script to see how your projects Synthetics usage has changed over time
#! /bin/bash
# To use:
# Copy this file to the root of your Android Project
# chmod +x trackSynthetics.sh
# ./trackSynthetics.sh | tee results.csv
# Open CSV file in your choice of spreadsheet software
start=2022-02-23 # Date to start tracking
end=2022-08-19 # Date to end tracking
@ed-george
ed-george / gradle-wrapper-verify.sh
Created July 1, 2023 15:07
Verify your Gradle Wrapper's integrity
#!/bin/zsh
# This script will verify your gradle-wrapper.jar
# file's integrity for your project's Gradle version
# For more info, see:
# https://docs.gradle.org/current/userguide/gradle_wrapper.html#manually_verifying_the_gradle_wrapper_jar
#
# Usage: ./gradle-wrapper-verify.sh
# Use within $PROJ_ROOT/gradle/wrapper folder
@ed-george
ed-george / VerticalTextView.kt
Created September 8, 2025 23:12
VerticalTextView XML / View implementation for androidx.text.vertical 1.0.0-alpha01
package dev.spght.example.text
import android.content.Context
import android.graphics.Canvas
import android.text.Spanned
import android.text.TextPaint
import android.util.AttributeSet
import android.view.View
import androidx.text.vertical.VerticalTextLayout
@ed-george
ed-george / AppSignatureUtil.kt
Created October 29, 2025 09:47
A utility class to aid verification of signing application certificates in Android. Adds additional support for enhanced Android P features
/*
Copyright 2025 Ed Holloway-George • spght.dev
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software