Skip to content

Instantly share code, notes, and snippets.

View Trumeet's full-sized avatar
🏳️‍⚧️

Yuuta Liang Trumeet

🏳️‍⚧️
View GitHub Profile
@Trumeet
Trumeet / strip_play_services.gradle
Created June 7, 2017 11:49 — forked from dmarcato/strip_play_services.gradle
Gradle task to strip unused packages on Google Play Services library
def toCamelCase(String string) {
String result = ""
string.findAll("[^\\W]+") { String word ->
result += word.capitalize()
}
return result
}
afterEvaluate { project ->
Configuration runtimeConfiguration = project.configurations.getByName('compile')
/*
* Copyright Aesean
*
* 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
@Trumeet
Trumeet / customsdkgen.sh
Created November 14, 2017 09:57
Build a custom android sdk with some hidden api (Not tested, I just copy it from https://github.com/AOKP/build/blob/mm/tools/customsdkgen.sh)
#!/bin/bash
SDK_VER=23
CUSTOM_VER=123
CUSTOM_NAME=aokp
. ${ANDROID_BUILD_TOP}/vendor/aokp/tools/colors
if [ -z "$OUT" ]; then
echo -e $CL_RED"Please lunch a product before using this command"$CL_RST
@Trumeet
Trumeet / .gitlab-ci-example.yml
Created July 29, 2018 08:45
GitLab CI Android project config example
# 官方 https://about.gitlab.com/2016/11/30/setting-up-gitlab-ci-for-android-projects/ 早已过时,无法正常使用。这里分享一个自用的,不保证能行
image: openjdk:8-jdk
variables:
ANDROID_COMPILE_SDK: "27"
ANDROID_BUILD_TOOLS: "27.0.3"
ANDROID_SDK_TOOLS: "4333796" # 在 https://developer.android.com/studio/ 下面的 Command line tools only 查
before_script:
- apt-get --quiet update --yes>/dev/null

Keybase proof

I hereby claim:

  • I am Trumeet on github.
  • I am trumeet (https://keybase.io/trumeet) on keybase.
  • I have a public key whose fingerprint is D0AD F3AF 3371 4E47 9229 B603 96CB D083 5978 39CF

To claim this, I am signing this object:

package moe.yuuta.intro
import android.graphics.Color
import android.graphics.drawable.ColorDrawable
import android.os.Bundle
import android.view.View
import android.widget.Button
import android.widget.ImageButton
import androidx.appcompat.app.AppCompatActivity
import androidx.fragment.app.Fragment
@Trumeet
Trumeet / JyutpingConverter.java
Last active March 2, 2019 04:56
Get the Jyutping of a single Chinese character, data are parsed from cantonese.org
package moe.yuuta.jyutpingconverter;
import org.jsoup.Jsoup;
import org.jsoup.nodes.Document;
import org.jsoup.nodes.Element;
import org.jsoup.select.Elements;
import java.io.IOException;
import java.util.*;
import java.util.stream.Collectors;
@Trumeet
Trumeet / Jyutping.csv
Created February 15, 2019 16:45
The most useful Chinese characters (from http://faculty.arts.ubc.ca/tli/guideline/changyongzibiao.pdf), useful Cantonese characters (from Wikipedia) and their Jyutping (converted via https://gist.github.com/Trumeet/dac51a72382a7bd2a5e458ed2e7c49d1)
Chinese character Jyutping
jat1
jyut3 jyut6
ji6
sap6
ding1
cong2
cat1
buk1
jan4
@Trumeet
Trumeet / ProguardDictionaryGenerator
Created February 24, 2019 20:12
A simple tool to generate styled proguard dictionary
/**
* Proguard dictionary generator
* Usage:
* java Generator [character] [lines]
* Example:
* java Generator A 5
* then you will get:
* A
* Aa
* Aaa
@Trumeet
Trumeet / UserHandleUtils.kt
Created March 9, 2019 02:46
Create UserHandle instance without using hidden APIs
object UserHandleUtils {
private fun createUserHandleWithUserID(userId: Int): UserHandle {
val parcel = Parcel.obtain()
// I bet that it won't change a lot
parcel.writeInt(userId)
val userHandle = UserHandle(parcel)
parcel.recycle()
return userHandle
}
}