Menu Home

Build WebRTC

First of All, You have evaded the “WALL”. God bless you. Host OS: Ubuntu 16.04 LTE Build Tools git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git Then add depot_tools to your PATH Checkout Source Set the target OS Here, I will build webrtc for Andorid platform. export GYP_DEFINES=”OS=android” Sync Source mkdir webrtc_android cd webrtc_android fetch […]

Mac Git Auto Completion Script

1. Checkout Script git clone [email protected]:lnmcc/git-completion.git 2. Put the script into home directory cp -av .git-completion.bash ~/ 3. Edit ~/.profile # GIT Settings source ~/.git-completion.bash 4. Export new env settings source ~/.profile Done !

FileName Checker

/* A-Za-z0-9_- */ static int safe_filename(const char *f) { const char *start = f; for (; *f; f++) { if (!((unsigned)((*f | 32) – ‘a’) < 26 || (unsigned)(*f - '0') < 10 || *f == '_' || *f == '-')) { if (f == start) return 0; else if […]

Android:Get Certificate SHA1 with JNI

#include <assert.h> #include <string.h> #include <stdio.h> #include <android/log.h> const char HexCode[]={‘0′,’1′,’2′,’3′,’4′,’5′,’6′,’7′,’8′,’9′,’A’,’B’,’C’,’D’,’E’,’F’}; static void byte_array_to_hex_string(JNIEnv *env, const jbyteArray array, const jsize array_size, char *hex_string) { jbyte *sha1 = (*env)->GetByteArrayElements(env, array, NULL); for (int i = 0; i < array_size; i++) { hex_string[i * 2] = HexCode[((unsigned char)sha1[i]) / 16]; hex_string[i * […]