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
system/core/rootdir/init.rc中加上 | |
on property:sys.boot_completed=1 | |
write /sys/bus/platform/drivers/usb20_otg/force_usb_mode 2 | |
start adbd |
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
添加2个make版本: | |
$ 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 |
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
private static volatile TCPMessageHandler instance = null; | |
public static TCPMessageHandler getInstance() { | |
if (instance == null) { | |
synchronized (TCPMessageHandler.class) { | |
if (instance == null) { | |
instance = new TCPMessageHandler(); | |
} | |
} | |
} |
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
$ cat src/com/franny/test/HelloWorld.java | |
package com.franny.test; | |
public class HelloWorld { | |
public native int doubleHelloWorld(int num); //申明一个native方法 | |
static{ | |
System.loadLibrary("HelloWorldImpl"); //装入动态链接库,"HelloWorldImpl"是装入动态链接库的名称 | |
} |
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
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" }, |
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
Intent intent1= new Intent("android.intent.action.MAIN", null); | |
intent1.addCategory("android.intent.category.APP_GALLERY"); | |
Intent intent2 = new Intent(Intent.ACTION_VIEW, Uri.parse("content://media/internal/images/media")); | |
// 两种办法都可以 | |
mGallery.setOnClickListener(v -> startActivity(intent1)); |
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
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); | |
} |
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
/frameworks/base/core/res/res/drawable/pointer_arrow_icon.xml | |
./drawable-xxhdpi/pointer_arrow.png | |
./drawable-mdpi/pointer_arrow.png | |
./drawable-mdpi/pointer_arrow_large.png | |
./drawable-xhdpi/pointer_arrow.png | |
./drawable-xhdpi/pointer_arrow_large.png | |
./drawable/pointer_arrow_large_icon.xml | |
./drawable/pointer_arrow_icon.xml | |
./drawable-hdpi/pointer_arrow.png |
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
git config --global alias.co checkout | |
git config --global alias.st status | |
git config --global alias.br 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' |
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
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |