注意:这个工具是用来导入到中国区节点的
依赖: gevent、requests
Ubuntu 可以
# apt-get install python-gevent python-requests
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. |
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; |
#!/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] | |
########################################################### |
$ 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 |
import android.app.ActivityManager; | |
import android.content.Context; | |
import android.os.Process; | |
import android.util.Log; | |
import java.util.List; | |
public class ProcessUtils { |
/* | |
* 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 |
The following allows you to very easily flip between languages and country on Android. | |
This will IMMEDIATELY cause the change without even needing to shut down the target testing app. | |
(That is, the currently displayed page will reloaded.) | |
You first need to install this APP on the phone: | |
https://play.google.com/store/apps/details?id=net.sanapeli.adbchangelanguage&hl=en | |
Then to flip copy and paste one of the lines below in a terminal. |
/* | |
* Copyright 2016-2017 JetBrains s.r.o. | |
* | |
* 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 functools | |
def log(func): | |
@functools.wraps(func) | |
def wrapper(*args): | |
print(u"request body: {}".format(args[0])) | |
response = func(*args) | |
print u"response body: {}".format(response) | |
return response |