Skip to content

Instantly share code, notes, and snippets.

View Gracker's full-sized avatar
:octocat:
Focusing

Jianwu Gao Gracker

:octocat:
Focusing
View GitHub Profile
/**
* 将16进制转换为二进制
*
* @param hexStr
* @return
*/
public static byte[] parseHexStr2Byte(String hexStr) {
if (hexStr.length() < 1)
return null;
byte[] result = new byte[hexStr.length() / 2];
/**
* 将二进制转换成16进制
*
* @param buf
* @return
*/
public static String parseByte2HexStr(byte buf[]) {
StringBuffer sb = new StringBuffer();
for (int i = 0; i < buf.length; i++) {
String hex = Integer.toHexString(buf[i] & 0xFF);
@Gracker
Gracker / compileNinePatch.java
Created July 4, 2014 03:46
使用命令行来编译Android .9文件
/**
* 调用aapt工具进行打包
*
* @param resPath
* 资源原路径
* @param outPath
* 打包输出路径
* @return
*/
public static boolean compileNinePatch(String resPath, String outPath) {
public static void compileNinePatch() {
File projectRootPath = new File("ThemeTools");
File manifest = new File("lewaThemeTools" + File.separator
+ "AndroidManifest.xml");
File android = new File("lewaThemeTools" + File.separator + "libs"
+ File.separator + "android.jar");
File resource = new File("temp" + File.separator + "drawable");
File tempFile = new File("temp" + File.separator + "temp.zip");
File tempFolder = new File("temp" + File.separator + "temp");
@Gracker
Gracker / files2xml.py
Last active August 29, 2015 14:02
Folder to xml
'''
folder2xml.py
create by Jianwu Gao ,
2014.6.10
'''
import os
import sys
from xml.dom.minidom import Document