Skip to content

Instantly share code, notes, and snippets.

View yanglw's full-sized avatar

Liangwei Yang yanglw

  • Wuxi,China
View GitHub Profile
@yanglw
yanglw / version.gradle
Last active May 15, 2020 03:46
Android 自动版本控制脚本
// versionCode 的数值为当前时间与起始时间相差的分钟数。
// 2017 年时,Google Play Store 支持最大的 versionCode 为 2_100_000_000 。2_100_000_000 分转化为年,大约为 3995 年。
def versionCode
if (project.hasProperty("versionCode")) {
versionCode = project.property('versionCode').toInteger()
} else {
versionCode = (System.currentTimeMillis() - Date.parse("yyyy-MM-dd HH:mm:ss", "2020-03-27 11:11:11").time).intdiv(60 * 1000).intValue()
}
@yanglw
yanglw / .java
Created August 25, 2019 05:39
android EditText 控件设置只读
editText.setCursorVisible(false);
editText.setFocusable(false);
editText.setFocusableInTouchMode(false);
@yanglw
yanglw / A.groovy
Last active April 23, 2020 02:14
解析网易云音乐 ncm 格式的文件为源文件
import com.mpatric.mp3agic.ID3v1
import com.mpatric.mp3agic.ID3v2
import com.mpatric.mp3agic.ID3v24Tag
import com.mpatric.mp3agic.Mp3File
import groovy.json.JsonParser
import groovy.json.internal.JsonFastParser
import groovy.json.internal.ValueMap
import groovy.transform.Field
import sun.security.provider.MD5