Skip to content

Instantly share code, notes, and snippets.

View xdtianyu's full-sized avatar
🏠
Working from home

tianyu xdtianyu

🏠
Working from home
View GitHub Profile
@xdtianyu
xdtianyu / build.gradle
Created December 11, 2019 02:13
android framework jar
allprojects {
gradle.projectsEvaluated {
tasks.withType(JavaCompile) {
options.compilerArgs << "-Xbootclasspath/p:${rootDir}/app/libs/ext/framework.jar"
}
}
}
@xdtianyu
xdtianyu / railgun-arch-install.zsh
Created May 5, 2019 03:07 — forked from typcn/railgun-arch-install.zsh
Install cloudflare railgun on ArchLinux
#!/usr/bin/zsh
mkdir rg-install
cd rg-install
wget http://pkg.cloudflare.com/dists/xenial/railgun/binary-amd64/Packages.gz
gunzip Packages.gz
wget "http://pkg.cloudflare.com/${$(cat Packages | grep Filename:)//Filename: }"
ar -x *.deb
tar xvf data.tar.xz
rm -rf /usr/local/railgun
mkdir -p /usr/local/railgun
@xdtianyu
xdtianyu / build.gradle
Created September 25, 2018 09:14
coverage,checkstyle
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
ext.kotlin_version = '1.2.61'
repositories {
google()
jcenter()
}
dependencies {
@xdtianyu
xdtianyu / jacoco.gradle
Created August 21, 2018 07:45 — forked from bhargavms/jacoco.gradle
A gradle plugin for checking test coverage using jacoco.
apply plugin: 'jacoco'
jacoco {
toolVersion "0.7.1.201405082137"
reportsDir = file("$buildDir/intermediates/test")
}
// Taken from https://blog.gouline.net/2015/06/23/code-coverage-on-android-with-jacoco/
project.afterEvaluate {
// Grab all build types and product flavors
def buildTypes = android.buildTypes.collect { type -> type.name }
@xdtianyu
xdtianyu / .gitlab-ci.yml
Created August 16, 2018 02:19 — forked from danielgomezrico/.gitlab-ci.yml
Android / Gitlab ci - sample setup files to setup your own local gitlab runner with real physical android devices. Check https://github.com/caipivara/awesome-android-scripts
stages:
- build
- test
- deploy
variables:
GIT_STRATEGY: clone
cache:
key: ${CI_PROJECT_ID}
100% — FF
99% — FC
98% — FA
97% — F7
96% — F5
95% — F2
94% — F0
93% — ED
92% — EB
91% — E8
@xdtianyu
xdtianyu / adb.md
Created March 30, 2018 14:53
adb wireless

enable developer mode, phone shell with root

su
setprop service.adb.tcp.port 5555
stop adbd
start adbd

ifconfig get phone ip address

Tools -> Terminal ->Application settings ->Shell Path: "c:\cygwin64\bin\sh" -lic "cd ${OLDPWD-.}; bash"
https://gist.github.com/mpicker0/a6a3f10e6b9278074f93
group = publishedGroupId // Maven Group ID for the artifact
install {
repositories.mavenInstaller {
// This generates POM.xml with proper parameters
pom {
project {
packaging 'aar'
groupId publishedGroupId
@xdtianyu
xdtianyu / iptables.ash
Created February 16, 2018 23:36 — forked from pagxir/iptables.ash
share vpn over tethering for android 4.4+
#!/system/bin/sh
# log -t IPTABLES -- $@
# iptables -w -t mangle -A INPUT -i tun0 -j MARK --set-mark 0x3006a
IPTABLES="/system/bin/iptables.oem iptables"
need_arg=0;
last_cmd="";
IIF=""