摘要:
记录一下,方便取用 #include <thread> #ifdef _WIN32 #include <Windows.h> const char* timenow() { static thread_local char str[32]; SYSTEMTIME st; GetLocalTime(& 阅读全文
摘要:
linux 里面写一些命令行小玩意儿有 getopt 这个函数方便使用,Windows 上是不自带的,从 libevent 的仓库里扣了出来 // getopt.h #ifndef __GETOPT_H__ #define __GETOPT_H__ #ifdef __cplusplus extern 阅读全文
摘要:
话不多说,直接上示例代码 std::string Base64Encode(const unsigned char* data, size_t size) { size_t base64_len = (size + 2) / 3 * 4; if (base64_len == 0) { return 阅读全文
摘要:
在 java 上进行 AES128/ECB/PKCS5Padding 加密解密是很简单的 public static String aesDecrypt(String str,String key) throws Exception{ Cipher cipher = Cipher.getInstan 阅读全文
摘要:
使用 wxWidgets 时,可能遇到自定义的 Dialog 创建之后,总是在最顶层窗口上,可以尝试一下在自定义dialog 的构造函数内 SetWindowStyle(GetWindowStyle() & ~wxSTAY_ON_TOP); 阅读全文
摘要:
以下载链接https://www.openssl.org/source/openssl-1.1.1o.tar.gz为例 下载解压之后,查看根目录的 NOTES.ANDROID,其中有 export ANDROID_NDK_HOME=/home/whoever/Android/android-sdk/ 阅读全文
摘要:
unordered_map有一些隐形的坑,下面的代码 #include<unordered_map> #include<map> #include<iostream> using namespace std; int main() { unordered_map<int, int> map1; ma 阅读全文
摘要:
想要分析安卓的启动过程中的详细信息,比如耗时、CPU/IO占用情况,我们可以通过这样一条命令 adb shell 'touch /data/bootchart/enabled' 然后重启安卓设备。开机之后,执行命令 $ANDROID_BUILD_TOP/system/core/init/grab-b 阅读全文
摘要:
p.s: 以下内容均以 openssl 实现。 RSA 密钥的存储方式有很多,某些情况下,我们直接保存密钥的 modulus(n),publicExponent(e),privateExponent(d),使用的时候再将它们转换成 RSA 密钥。下面来讲讲在 C/C++ 环境中,如何把这几个大整数转 阅读全文
摘要:
在安卓里面实现一个 native 的系统服务,不仅可以通过定义 Interface ,还可以通过直接继承 BBinder 来实现。本篇文章即讲述如何通过继承 Bbinder 来实现一个系统服务,并且讲述如何在 native 上使用 binder 的 linktoDeath 机制 首先列出需要包含的头 阅读全文