This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* 将二进制转换成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); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* 将16进制转换为二进制 | |
* | |
* @param hexStr | |
* @return | |
*/ | |
public static byte[] parseHexStr2Byte(String hexStr) { | |
if (hexStr.length() < 1) | |
return null; | |
byte[] result = new byte[hexStr.length() / 2]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* 调用aapt工具进行打包 | |
* | |
* @param resPath | |
* 资源原路径 | |
* @param outPath | |
* 打包输出路径 | |
* @return | |
*/ | |
public static boolean compileNinePatch(String resPath, String outPath) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
''' | |
folder2xml.py | |
create by Jianwu Gao , | |
2014.6.10 | |
''' | |
import os | |
import sys | |
from xml.dom.minidom import Document |