- 开启ipv4转发
vi /etc/sysctl.conf
# 将net.ipv4.ip_forward=0更改为net.ipv4.ip_forward=1
sysctl -p
- 安装dnsmasq 和pdnsd解决dns污染
DNS的解析方案为 resolve.conf ==> dnsmasq ==> pdnsd
vi /etc/sysctl.conf
# 将net.ipv4.ip_forward=0更改为net.ipv4.ip_forward=1
sysctl -p
DNS的解析方案为 resolve.conf ==> dnsmasq ==> pdnsd
<template> | |
<div> | |
<input type="text" placeholder="Enter message" v-model="newMessage" @keyup.enter="addMessage"> | |
<button type="submit" @click="addMessage">Add message</button> | |
<ul> | |
<li v-for="message in messages"> | |
<span @dblclick="editMessage(message)" v-if="message != editedMessage">{{ message.text }}</span> | |
<input | |
type="text" | |
v-model="message.text" |
import com.google.auto.value.AutoValue; | |
import java.lang.annotation.Retention; | |
import java.lang.annotation.Target; | |
import static java.lang.annotation.ElementType.TYPE; | |
import static java.lang.annotation.RetentionPolicy.RUNTIME; | |
/** | |
* Marks an {@link AutoValue @AutoValue}-annotated type for proper Gson serialization. | |
* <p> |
public class HelpWebView extends WebView { | |
private GestureDetector gestureDetector; | |
private AtomicBoolean mPreventAction = new AtomicBoolean(false); | |
private AtomicLong mPreventActionTime = new AtomicLong(0); | |
public HelpWebView(Context context) { | |
super(context); | |
gestureDetector = new GestureDetector(context, new GestureListener()); | |
} |
@Override | |
public boolean onTouchEvent(MotionEvent event) | |
{ | |
boolean result = mScaleGestureDetector.onTouchEvent(event); | |
// result is always true here, so I need another way to check for a detected scaling gesture | |
boolean isScaling = result = mScaleGestureDetector.isInProgress(); | |
if (!isScaling) | |
{ | |
// if no scaling is performed check for other gestures (fling, long tab, etc.) |
// cache enable flag | |
captureRelativeLayout.setDrawingCacheEnabled(true); | |
bitmap = captureRelativeLayout.getDrawingCache(true).copy(Config.ARGB_8888, false); | |
captureRelativeLayout.destroyDrawingCache(); | |
// build cache | |
captureRelativeLayout.buildDrawingCache(true); | |
bitmap = captureRelativeLayout.getDrawingCache(true).copy(Config.ARGB_8888, false); | |
captureRelativeLayout.destroyDrawingCache(); |
ImageView imageview; | |
WebView webview; | |
class Background extends AsyncTask<Void, Void, Bitmap> | |
{ | |
@Override | |
protected Bitmap doInBackground(Void... params) | |
{ | |
try | |
{ | |
Thread.sleep(2000); |