2015年11月22日 星期日

git tips

1. Push to review
    git push ssh://UserName@hostname:29418/repo_name HEAD:refs/for/master(branch name)

2. Push directly, need admin
    git push ssh://UserName@hostname:29418/repo_name HEAD:refs/heads/master

2015年11月12日 星期四

APK tools side note and how to sign a releaseed APK.

###################################
####     How to unpack APK?    ####
###################################
1. Put apktool, apktool.jar under the same folder.
2. Run "apktool d xxx.apk".


############################################
####     How to pack files into APK?    ####
############################################
1. Put apktool, aapt under the same folder.
2. Run "apktool b xxxx-folder-name".
3. The output will be under xxxx-folder-name/dist/ with name xxxx-folder-name.apk.


#######################################
####    How to create keystore?    ####
#######################################
Refer to http://developer.android.com/tools/publishing/app-signing.html
 1. Run "keytool -genkey -v -keystore steven.keystore -alias steven -keyalg RSA -keysize 2048 -validity 10000"
 2. Verity keystore with "keytool -list -v -keystore ./steven.keystore"


###################################
####    How to sign an APK?    ####
###################################
Refer to http://developer.android.com/tools/publishing/app-signing.html
1. Run "jarsigner -verbose -keystore  ./steven.keystore -signedjar xxxx-signed.apk xxxx.apk steven"
   or  "jarsigner -verbose -sigalg SHA1withRSA -digestalg SHA1 -keystore steven.keystore ./xxxx.apk"
2. Verify the signed APK with "jarsigner -verify -verbose ./xxxx.apk"


###################################
####    How to laing an APK?   ####
###################################
Refer to http://developer.android.com/tools/publishing/app-signing.html
1. Run "zipalign -v 4 xxx-unaligned.apk xxx.apk"
zipalign ensures that all uncompressed data starts with a particular byte alignment
relative to the start of the file, which reduces the amount of RAM consumed by an app.