注意:这个工具是用来导入到中国区节点的
依赖: gevent、requests
Ubuntu 可以
# apt-get install python-gevent python-requests
| /* | |
| * Copyright (C) 2016 Eric Cochran | |
| * | |
| * Licensed under the Apache License, Version 2.0 (the "License"); | |
| * you may not use this file except in compliance with the License. | |
| * You may obtain a copy of the License at | |
| * | |
| * http://www.apache.org/licenses/LICENSE-2.0 | |
| * | |
| * Unless required by applicable law or agreed to in writing, software | 
| import android.app.ActivityManager; | |
| import android.content.Context; | |
| import android.os.Process; | |
| import android.util.Log; | |
| import java.util.List; | |
| public class ProcessUtils { | 
| $ javap -verbose -c -s -l -private Demo\$\$Lambda\$1 | |
| Classfile /private/tmp/Demo$$Lambda$1.class | |
| Last modified Oct 12, 2016; size 754 bytes | |
| MD5 checksum 81ce9dafbca34417b2dfa94f596a85a1 | |
| final class Demo$$Lambda$1 implements org.apache.spark.api.java.function.VoidFunction | |
| minor version: 0 | |
| major version: 52 | |
| flags: ACC_FINAL, ACC_SUPER, ACC_SYNTHETIC | |
| Constant pool: | |
| #1 = Utf8 Demo$$Lambda$1 | 
| #!/bin/bash | |
| cat << EOF | |
| ########################################################### | |
| # Workaround adb disconnecting issue on macOS Sierra | |
| # | |
| # More info: | |
| # https://code.google.com/p/android/issues/detail?id=219085 | |
| # credits to: [email protected], [email protected] | |
| ########################################################### | 
| import android.os.Build; | |
| import android.support.v4.view.ViewCompat; | |
| import android.support.v4.view.ViewPager; | |
| import android.view.View; | |
| public class ScaleInTransformer implements ViewPager.PageTransformer { | |
| @Override | |
| public void transformPage(View view, float position) { | |
| float scale = 0.5f; | 
| import android.content.Context; | |
| import android.util.AttributeSet; | |
| import android.view.View; | |
| import android.view.ViewGroup; | |
| import android.widget.Checkable; | |
| import android.widget.LinearLayout; | |
| /** | |
| * This is a simple wrapper for {@link android.widget.LinearLayout} that implements the {@link android.widget.Checkable} | |
| * interface by keeping an internal 'checked' state flag. | 
| # first: | |
| lsbom -f -l -s -pf /var/db/receipts/org.nodejs.pkg.bom | while read f; do sudo rm /usr/local/${f}; done | |
| sudo rm -rf /usr/local/lib/node /usr/local/lib/node_modules /var/db/receipts/org.nodejs.* | |
| # To recap, the best way (I've found) to completely uninstall node + npm is to do the following: | |
| # go to /usr/local/lib and delete any node and node_modules | |
| cd /usr/local/lib | |
| sudo rm -rf node* | 
| import android.content.Context; | |
| import android.content.res.TypedArray; | |
| import android.graphics.Canvas; | |
| import android.graphics.drawable.Drawable; | |
| import android.util.AttributeSet; | |
| import android.widget.ImageView; | |
| public class ForegroundImageView extends ImageView { | |
| private Drawable foreground; |