Skip to content

Instantly share code, notes, and snippets.



Block or report user

Report or block FrannyZhao

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
FrannyZhao / android开机启动adbd
Created Sep 4, 2019
View android开机启动adbd
on property:sys.boot_completed=1
write /sys/bus/platform/drivers/usb20_otg/force_usb_mode 2
start adbd
FrannyZhao / ubuntu set alternative
Last active Jul 5, 2019
ubuntu set alternative
View ubuntu set alternative
$ sudo update-alternatives --install /usr/bin/make make /usr/bin/make3.81 1010
update-alternatives: using /usr/bin/make3.81 to provide /usr/bin/make (make) in auto mode
$ sudo update-alternatives --install /usr/bin/make make /usr/bin/make4.1 1011
update-alternatives: using /usr/bin/make4.1 to provide /usr/bin/make (make) in auto mode
$ sudo update-alternatives --display make
make - auto mode
View Singleton标准写法
private static volatile TCPMessageHandler instance = null;
public static TCPMessageHandler getInstance() {
if (instance == null) {
synchronized (TCPMessageHandler.class) {
if (instance == null) {
instance = new TCPMessageHandler();
View JNI Sample
$ cat src/com/franny/test/
package com.franny.test;
public class HelloWorld {
public native int doubleHelloWorld(int num); //申明一个native方法
System.loadLibrary("HelloWorldImpl"); //装入动态链接库,"HelloWorldImpl"是装入动态链接库的名称
View android enable su in source code
zhaofengyi@moosgod-MS-7B10:~/mtkz300/system/core$ git diff
diff --git a/libcutils/fs_config.cpp b/libcutils/fs_config.cpp
index cc96ff8..8f44691 100644
--- a/libcutils/fs_config.cpp
+++ b/libcutils/fs_config.cpp
@@ -166,7 +166,7 @@ static const struct fs_path_config android_files[] = {
// the following two files are INTENTIONALLY set-uid, but they
// are NOT included on user builds.
{ 06755, AID_ROOT, AID_ROOT, 0, "system/xbin/procmem" },
- { 04750, AID_ROOT, AID_SHELL, 0, "system/xbin/su" },
View Andoid打开系统自带应用
Intent intent1= new Intent("android.intent.action.MAIN", null);
Intent intent2 = new Intent(Intent.ACTION_VIEW, Uri.parse("content://media/internal/images/media"));
// 两种办法都可以
mGallery.setOnClickListener(v -> startActivity(intent1));
View Android Handler
private final UIHandler uiHandler = new UIHandler(this);
static class UIHandler extends Handler {
private final WeakReference<DashboardFragment> mFragment;
private static final int MSG_SHOW_MASK = 1;
private static final int MSG_HIDE_MASK = 2;
private UIHandler(DashboardFragment fragment) {
mFragment = new WeakReference<>(fragment);
View android customize mouse cursor
View git alias
git config --global checkout
git config --global status
git config --global branch
git config --global alias.f fetch
git config --global alias.cp cherry-pick
git config --global alias.rh 'reset --hard'
git config --global alias.l1 'log -1'
git config --global alias.rbm 'rebase origin/master'
FrannyZhao / 0_reuse_code.js
Created May 24, 2016
Here are some things you can do with Gists in GistBox.
View 0_reuse_code.js
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
You can’t perform that action at this time.