Glide4.1.1 支持代理Proxy+Authenticator(用户名+密码验证)

Glide图片加载框架的强大,使用简单相信是众所周知的,之前在项目中一直都用的,但是最近在项目中需要使用代理,在加载图片的时候也要用,本来以为很简单,网上查了下发现这一块其实没那么容易啊,只能边看源码边学习解决。

  1. Glide项目地址: Glide Github
  2. Glide WIKI
  3. Glide 4.0源码解析

查看源码,可以看到进行网络请求的时候,使用的是HttpUrlConnection(这里我们没有使用OKHttp或者Volley进行优化,有兴趣的可以查看WIKI文档进行集成)
源码分析基于Glide 4.1.1

Glide常用方式与源码分析:

Glide.with(activity).load(url).into(imageview)

1. 初始化,配置 Loader

  • 查看Glide类,Registry类:
    Glide.with(activity),对Glide进行初始化,主要方法如下:

Glide.getRetriever()
Glide.get(context)
Glide.checkAndInitializeGlide(context);
Glide.initializeGlide

Glide glide = builder.build(applicationContext);

Glide 用GlideBuilder对象生成Glide对象,Glide类的构造函数中,对Glide对象进行初始化,这里涉及到的初始化的重点是对Registry对象的初始化:

 registry.register(ByteBuffer.class, new ByteBufferEncoder())
        .register(InputStream.class, new StreamEncoder(arrayPool))
        /* Bitmaps */
        .append(ByteBuffer.class, Bitmap.class,
            new ByteBufferBitmapDecoder(downsampler))
        .append(InputStream.class, Bitmap.class,
            new StreamBitmapDecoder(downsampler, arrayPool))
        .append(ParcelFileDescriptor.class, Bitmap.class, new VideoBitmapDecoder(bitmapPool))
        .register(Bitmap.class, new BitmapEncoder())
        /* GlideBitmapDrawables */
        .append(ByteBuffer.class, BitmapDrawable.class,
            new BitmapDrawableDecoder<>(resources, bitmapPool,
                new ByteBufferBitmapDecoder(downsampler)))
        .append(InputStream.class, BitmapDrawable.class,
            new BitmapDrawableDecoder<>(resources, bitmapPool,
                new StreamBitmapDecoder(downsampler, arrayPool)))
        .append(ParcelFileDescriptor.class, BitmapDrawable.class,
            new BitmapDrawableDecoder<>(resources, bitmapPool, new VideoBitmapDecoder(bitmapPool)))
        .register(BitmapDrawable.class, new BitmapDrawableEncoder(bitmapPool, new BitmapEncoder()))
        /* GIFs */
        .prepend(InputStream.class, GifDrawable.class,
            new StreamGifDecoder(registry.getImageHeaderParsers(), byteBufferGifDecoder, arrayPool))
        .prepend(ByteBuffer.class, GifDrawable.class, byteBufferGifDecoder)
        .register(GifDrawable.class, new GifDrawableEncoder())
        /* GIF Frames */
        .append(GifDecoder.class, GifDecoder.class, new UnitModelLoader.Factory<GifDecoder>())
        .append(GifDecoder.class, Bitmap.class, new GifFrameResourceDecoder(bitmapPool))
        /* Files */
        .register(new ByteBufferRewinder.Factory())
        .append(File.class, ByteBuffer.class, new ByteBufferFileLoader.Factory())
        .append(File.class, InputStream.class, new FileLoader.StreamFactory())
        .append(File.class, File.class, new FileDecoder())
        .append(File.class, ParcelFileDescriptor.class, new FileLoader.FileDescriptorFactory())
        .append(File.class, File.class, new UnitModelLoader.Factory<File>())
        /* Models */
        .register(new InputStreamRewinder.Factory(arrayPool))
        .append(int.class, InputStream.class, new ResourceLoader.StreamFactory(resources))
        .append(
                int.class,
                ParcelFileDescriptor.class,
                new ResourceLoader.FileDescriptorFactory(resources))
        .append(Integer.class, InputStream.class, new ResourceLoader.StreamFactory(resources))
        .append(
                Integer.class,
                ParcelFileDescriptor.class,
                new ResourceLoader.FileDescriptorFactory(resources))
        .append(String.class, InputStream.class, new DataUrlLoader.StreamFactory())
        .append(String.class, InputStream.class, new StringLoader.StreamFactory())
        .append(String.class, ParcelFileDescriptor.class, new StringLoader.FileDescriptorFactory())
        .append(Uri.class, InputStream.class, new HttpUriLoader.Factory())
        .append(Uri.class, InputStream.class, new AssetUriLoader.StreamFactory(context.getAssets()))
        .append(
                Uri.class,
                ParcelFileDescriptor.class,
                new AssetUriLoader.FileDescriptorFactory(context.getAssets()))
        .append(Uri.class, InputStream.class, new MediaStoreImageThumbLoader.Factory(context))
        .append(Uri.class, InputStream.class, new MediaStoreVideoThumbLoader.Factory(context))
        .append(
            Uri.class,
             InputStream.class,
             new UriLoader.StreamFactory(context.getContentResolver()))
        .append(Uri.class, ParcelFileDescriptor.class,
             new UriLoader.FileDescriptorFactory(context.getContentResolver()))
        .append(Uri.class, InputStream.class, new UrlUriLoader.StreamFactory())
        .append(URL.class, InputStream.class, new UrlLoader.StreamFactory())
        .append(Uri.class, File.class, new MediaStoreFileLoader.Factory(context))
        .append(GlideUrl.class, InputStream.class, new HttpGlideUrlLoader.Factory())
        .append(byte[].class, ByteBuffer.class, new ByteArrayLoader.ByteBufferFactory())
        .append(byte[].class, InputStream.class, new ByteArrayLoader.StreamFactory())
        /* Transcoders */
        .register(Bitmap.class, BitmapDrawable.class,
            new BitmapDrawableTranscoder(resources, bitmapPool))
        .register(Bitmap.class, byte[].class, new BitmapBytesTranscoder())
        .register(GifDrawable.class, byte[].class, new GifDrawableBytesTranscoder());

  • Registry类是用来:
/**
 * Manages component registration to extend or replace Glide's default loading, decoding, and
 * encoding logic.
 */

简单来说:就是根据传入什么样的modelClass来取使用哪个ModelLoaderFactory。类似于EventBus 这种,根据传入的类型调用具体的处理逻辑。这里我们的httpUrl字符串在Glide中会被封装成GlideUrl对象,对应的loader类是HttpGlideUrlLoader

GlideUrl.class, InputStream.class, new HttpGlideUrlLoader.Factory()

2. GlideApp

在Glide4中会在make之后自动生成GlideApp:

  1. 在build.gradle中添加:
dependencies {

    compile 'com.github.bumptech.glide:glide:4.1.1'
    annotationProcessor  'com.github.bumptech.glide:compiler:4.1.1'
}

其中第二句annotationProcessor 是重点

  1. 使用:@GlideModule

@GlideModule
public class MyGlideAppModule extends AppGlideModule {

    @Override
    public void applyOptions(Context context, GlideBuilder builder) {
        super.applyOptions(context, builder);

        int memoryCacheSizeBytes = 1024 * 1024 * 20; // 20mb
        builder.setMemoryCache(new LruResourceCache(memoryCacheSizeBytes));


    }

    @Override
    public boolean isManifestParsingEnabled() {
        return false;
    }
}

  1. Clean and make

3. HttpGlideUrlLoader,HttpUrlFetcher

这两个类主要负责进行网络请求。

  1. HttpUrlFetcher 这个类中使用HttpURLConnection进行网络请求
@Override
  public void loadData(Priority priority, DataCallback<? super InputStream> callback) {
    long startTime = LogTime.getLogTime();
    final InputStream result;
    try {
      result = loadDataWithRedirects(glideUrl.toURL(), 0 /*redirects*/, null /*lastUrl*/,
          glideUrl.getHeaders());
    } catch (IOException e) {
      if (Log.isLoggable(TAG, Log.DEBUG)) {
        Log.d(TAG, "Failed to load data for url", e);
      }
      callback.onLoadFailed(e);
      return;
    }

    if (Log.isLoggable(TAG, Log.VERBOSE)) {
      Log.v(TAG, "Finished http url fetcher fetch in " + LogTime.getElapsedMillis(startTime)
          + " ms and loaded " + result);
    }
    callback.onDataReady(result);
  }

  private InputStream loadDataWithRedirects(URL url, int redirects, URL lastUrl,
      Map<String, String> headers) throws IOException {
    if (redirects >= MAXIMUM_REDIRECTS) {
      throw new HttpException("Too many (> " + MAXIMUM_REDIRECTS + ") redirects!");
    } else {
      // Comparing the URLs using .equals performs additional network I/O and is generally broken.
      // See http://michaelscharf.blogspot.com/2006/11/javaneturlequals-and-hashcode-make.html.
      try {
        if (lastUrl != null && url.toURI().equals(lastUrl.toURI())) {
          throw new HttpException("In re-direct loop");

        }
      } catch (URISyntaxException e) {
        // Do nothing, this is best effort.
      }
    }

    urlConnection = connectionFactory.build(url);
    for (Map.Entry<String, String> headerEntry : headers.entrySet()) {
      urlConnection.addRequestProperty(headerEntry.getKey(), headerEntry.getValue());
    }
    urlConnection.setConnectTimeout(timeout);
    urlConnection.setReadTimeout(timeout);
    urlConnection.setUseCaches(false);
    urlConnection.setDoInput(true);

    // Stop the urlConnection instance of HttpUrlConnection from following redirects so that
    // redirects will be handled by recursive calls to this method, loadDataWithRedirects.
    urlConnection.setInstanceFollowRedirects(false);

    // Connect explicitly to avoid errors in decoders if connection fails.
    urlConnection.connect();
    if (isCancelled) {
      return null;
    }
    final int statusCode = urlConnection.getResponseCode();
    if (statusCode / 100 == 2) {
      return getStreamForSuccessfulRequest(urlConnection);
    } else if (statusCode / 100 == 3) {
      String redirectUrlString = urlConnection.getHeaderField("Location");
      if (TextUtils.isEmpty(redirectUrlString)) {
        throw new HttpException("Received empty or null redirect url");
      }
      URL redirectUrl = new URL(url, redirectUrlString);
      return loadDataWithRedirects(redirectUrl, redirects + 1, url, headers);
    } else if (statusCode == -1) {
      throw new HttpException(statusCode);
    } else {
      throw new HttpException(urlConnection.getResponseMessage(), statusCode);
    }
  }

而HttpUrlConnection 是使用HttpUrlFetcher中的connectionFactory字段进行生成的HttpUrlConnection:

 @Override
    public HttpURLConnection build(URL url) throws IOException {
      return (HttpURLConnection) url.openConnection();
    }

  1. HttpGlideUrlLoader:核心代码如下,创建HttpUrlFetcher进行网络请求
  @Override
  public LoadData<InputStream> buildLoadData(GlideUrl model, int width, int height,
      Options options) {
    // GlideUrls memoize parsed URLs so caching them saves a few object instantiations and time
    // spent parsing urls.
    GlideUrl url = model;
    if (modelCache != null) {
      url = modelCache.get(model, 0, 0);
      if (url == null) {
        modelCache.put(model, 0, 0, model);
        url = model;
      }
    }
    int timeout = options.get(TIMEOUT);
    return new LoadData<>(url, new HttpUrlFetcher(url, timeout));
  }

主要的代码分析就到这里。

不难看出要想支持Proxy只需要改动一行代码即可:

 @Override
    public HttpURLConnection build(URL url) throws IOException {
      return (HttpURLConnection) url.openConnection(proxy);
    }

当然还要加一些是否存在proxy的判断:

 @Override
    public HttpURLConnection build(URL url) throws IOException {
            HttpURLConnection conn = null;
            if (existProxy()) {
                conn = (HttpURLConnection) url.openConnection(getProxy());
            } else {
                conn = (HttpURLConnection) url.openConnection();
            }
    }

  • 如果需要添加用户名和密码认证:

          if (!TextUtils.isEmpty(username) && !TextUtils.isEmpty(pwd)) {
                Authenticator authenticator = new Authenticator() {

                    public PasswordAuthentication getPasswordAuthentication() {
                        return (new PasswordAuthentication(username,
                                pwd.toCharArray()));
                    }
                };
                Authenticator.setDefault(authenticator);
            } else {
                Authenticator.setDefault(null);
            }

注意 关键是如何添加???
这里能够想到的是使用自定义的HttpGlideUrlLoader。
问题1. HttpUrlFetcher中的connectionFactory是final的,HttpUrlConnectionFactory 是default的不能扩展,HttpUrlFetchery构造函数也是default的

  // Visible for testing.
  HttpUrlFetcher(GlideUrl glideUrl, int timeout, HttpUrlConnectionFactory connectionFactory) {
    this.glideUrl = glideUrl;
    this.timeout = timeout;
    this.connectionFactory = connectionFactory;
  }

解决方案

1. 方案一

修改Glide源码,重新打包。或者直接将源码放到项目中修改

  1. HttpUrlFetcher第二个构造方法置为public,将HttpUrlFetcher$HttpUrlConnectionFactory 接口置为 public
  2. HttpGlideUrlLoader中添加Proxy字段与设置方法,建议是 static,如果proxy为空就调用HttpUrlFetcher第一个构造函数,如果不为空就调用第二个,实现HttpUrlFetcher$HttpUrlConnectionFactory接口并将proxy传入即可
 private static class ProxyHttpUrlConnectionFactory implements HttpUrlConnectionFactory {
  
    private Proxy mProxy

    private static boolean setProxy(proxy p,String username,String pwd){
          mProxy = p;

          if (!TextUtils.isEmpty(username) && !TextUtils.isEmpty(pwd)) {
                Authenticator authenticator = new Authenticator() {

                    public PasswordAuthentication getPasswordAuthentication() {
                        return (new PasswordAuthentication(username,
                                pwd.toCharArray()));
                    }
                };
                Authenticator.setDefault(authenticator);
            } else {
                Authenticator.setDefault(null);
            }
    }

   private static boolean exist(){
      return mProxy != null;
    }

    @Synthetic
    public ProxyHttpUrlConnectionFactory () { }

    @Override
    public HttpURLConnection build(URL url) throws IOException {
      //return (HttpURLConnection) url.openConnection(mProxy);
    }
  }

这个方案有点:

  1. 改动少
  2. 容易理解和实现

缺点:

  1. 改动了源码,对于后续Glide升级存在问题

2. 方案二

自定义HttpGlideUrlLoader,前面说到的Registry类的初始化中,当modelClass是GlideUrl时,使用的就是HttpGlideUrlLoader,那这里取代这个默认的Loader,使用自定义即可:
假设自定义的是MyHttpGlideUriLoader, 扩展 extends ModelLoader<GlideUrl, InputStream>, 则:

 registry.replace(GlideUrl.class, InputStream.class, new MyHttpGlideUrlLoader.Factory());

并把HttpGlideUrlLoader中的代码复制到MyHttpGlideUriLoader,区别只有buildLoadData方法中最后return时。

然后自定义MyHttpUrlFetcher,将HttpUrlFetcher复制一份,区别只有DefaultHttpUrlConnectionFactory :

  private static class DefaultHttpUrlConnectionFactory implements HttpUrlConnectionFactory {
  
    private static Proxy mProxy

    private static boolean setProxy(proxy p,String username,String pwd){
          mProxy = p;

          if (!TextUtils.isEmpty(username) && !TextUtils.isEmpty(pwd)) {
                Authenticator authenticator = new Authenticator() {

                    public PasswordAuthentication getPasswordAuthentication() {
                        return (new PasswordAuthentication(username,
                                pwd.toCharArray()));
                    }
                };
                Authenticator.setDefault(authenticator);
            } else {
                Authenticator.setDefault(null);
            }
    }

   private static boolean exist(){
      return mProxy != null;
    }

    @Synthetic
    DefaultHttpUrlConnectionFactory() { }

    @Override
    public HttpURLConnection build(URL url) throws IOException {
      //return (HttpURLConnection) url.openConnection();
    // 改成
         HttpURLConnection conn = null;
            if (existProxy()) {
                conn = (HttpURLConnection) url.openConnection(mProxy);
            } else {
                conn = (HttpURLConnection) url.openConnection();
            }

    }
  }

这个方案其实很好理解的。但是这个方案需要改的东西太多,有点挫,其实真正的改动只是HttpUrlConnectionFactory.build 方法而已,

优点:

  1. 容易理解

缺点:

  1. 改动太多,添加太多冗余代码

3. 方案三

使用反射+动态代理

思路说明:因为真正需要修改的只是HttpUrlFetcher$HttpUrlConnectionFactory 接口实现的build方法,如果能够将HttpUrlFetcher.connectionFactory替换掉就行了,所以这里需要使用到反射。先反射出HttpUrlConnectionFactory接口,并实现,然后反射HttpUrlFetcher.connectionFactory字段并赋值。这就是整体的思路

反射这里就不讲了,主要是如何实现HttpUrlConnectionFactory接口呢?
动态代理,如果看过retrofit源码的话应该不难理解。

  1. 首先跟方案二一样,自定义MyGlideUrlLoader,使用register.replace替换默认的loader。

  2. 在MyGlideUrlLoader中buildLoadData方法进行复写:

public class MyHttpGlideUrlLoader extends HttpGlideUrlLoader {
    private static final String TAG = MyHttpGlideUrlLoader.class.getSimpleName();

    public MyHttpGlideUrlLoader(ModelCache<GlideUrl, GlideUrl> modelCache) {
        super(modelCache);
    }

    @Override
    public LoadData<InputStream> buildLoadData(GlideUrl model, int width, int height, Options options) {
        LoadData old = super.buildLoadData(model, width, height, options);//if proy is not null,drop the result,just set the modelCache
        if (!MyHttpUrlConnectionFactory.existProxy()) {
            return old;
        }

        //反射出HttpUrlFetcher$HttpUrlConnectionFactory接口
        Class factoryInterface = null;
        try {
            factoryInterface = Class.forName("com.bumptech.glide.load.data.HttpUrlFetcher$HttpUrlConnectionFactory");
        } catch (ClassNotFoundException e) {
            e.printStackTrace();
        }

        //动态代理这个接口
        Object factoryProxy = null;
        if (factoryInterface != null) {
            factoryProxy = java.lang.reflect.Proxy.newProxyInstance(factoryInterface.getClassLoader(),
                    new Class[]{factoryInterface},
                    new MyInvocationHandler(new MyHttpUrlConnectionFactory()));
        }
        
        if (old != null && old.fetcher != null && factoryProxy != null) {
            try {
                //给connectionFactory字段赋新的值
                Field factoryField = HttpUrlFetcher.class.getDeclaredField("connectionFactory");
                factoryField.setAccessible(true);
                factoryField.set(old.fetcher, factoryProxy);
            } catch (NoSuchFieldException e) {
                e.printStackTrace();
            } catch (IllegalAccessException e) {
                e.printStackTrace();
            }
        }

        return old;
    }

    private static class MyInvocationHandler implements InvocationHandler {
        private MyHttpUrlConnectionFactory factory;

        public MyInvocationHandler(MyHttpUrlConnectionFactory f) {
            factory = f;
        }

        @Override
        public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
            URL url = null;
            if(args != null && args.length > 0 && args[0] instanceof URL){
                url = (URL) args[0];
            }
            if(url != null){
                return factory.build(url);
            }

            return method.invoke(proxy,args);
        }
    }

//代理类中真正的执行是这个类
    public static class MyHttpUrlConnectionFactory {
        private static Proxy sProxyConfig;

        public static void setProxy(Proxy proxy,final String username,final String pwd) {
            if (!TextUtils.isEmpty(username) && !TextUtils.isEmpty(pwd)) {
                Authenticator authenticator = new Authenticator() {

                    public PasswordAuthentication getPasswordAuthentication() {
                        return (new PasswordAuthentication(username,
                                pwd.toCharArray()));
                    }
                };
                Authenticator.setDefault(authenticator);
            } else {
                Authenticator.setDefault(null);
            }

            MyHttpUrlConnectionFactory.sProxyConfig = proxy;
        }

        public static void clearProxy() {
            setProxy(null,null,null);
        }

        public static boolean existProxy() {
            return sProxyConfig != null;
        }

        public MyHttpUrlConnectionFactory() {

        }

        public HttpURLConnection build(URL url) throws IOException {
            HttpURLConnection conn = null;
            if (existProxy()) {
                conn = (HttpURLConnection) url.openConnection(sProxyConfig);
            } else {
                conn = (HttpURLConnection) url.openConnection();
            }
            return conn;
        }
    }


    /**
     * The default factory for {@link MyHttpGlideUrlLoader}s.
     */
    public static class Factory implements ModelLoaderFactory<GlideUrl, InputStream> {
        private final ModelCache<GlideUrl, GlideUrl> modelCache = new ModelCache<>(500);

        @Override
        public ModelLoader<GlideUrl, InputStream> build(MultiModelLoaderFactory multiFactory) {
            return new MyHttpGlideUrlLoader(modelCache);
        }

        @Override
        public void teardown() {
            // Do nothing.
        }
    }
}

方案三优点:

  1. 代码改动量不大
  2. 使用反射和动态代理,比方案二看上去高大上了点,动态代理之前只是看没有实践过,呵呵。。。。

缺点:

  1. 需要理解反射和动态代理
  2. 在Glide后续版本升级中,如果com.bumptech.glide.load.data.HttpUrlFetcher$HttpUrlConnectionFactory名称改了,或者com.bumptech.glide.load.data.HttpUrlFetcher.connectionFactory字段名称改了,就歇菜了。。。

综上

个人还是倾向于方案一,改动量很小,但是在项目中要求不能改动第三方代码,所以使用了方案三

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
  • 序言:七十年代末,一起剥皮案震惊了整个滨河市,随后出现的几起案子,更是在滨河造成了极大的恐慌,老刑警刘岩,带你破解...
    沈念sama阅读 194,390评论 5 459
  • 序言:滨河连续发生了三起死亡事件,死亡现场离奇诡异,居然都是意外死亡,警方通过查阅死者的电脑和手机,发现死者居然都...
    沈念sama阅读 81,821评论 2 371
  • 文/潘晓璐 我一进店门,熙熙楼的掌柜王于贵愁眉苦脸地迎上来,“玉大人,你说我怎么就摊上这事。” “怎么了?”我有些...
    开封第一讲书人阅读 141,632评论 0 319
  • 文/不坏的土叔 我叫张陵,是天一观的道长。 经常有香客问我,道长,这世上最难降的妖魔是什么? 我笑而不...
    开封第一讲书人阅读 52,170评论 1 263
  • 正文 为了忘掉前任,我火速办了婚礼,结果婚礼上,老公的妹妹穿的比我还像新娘。我一直安慰自己,他们只是感情好,可当我...
    茶点故事阅读 61,033评论 4 355
  • 文/花漫 我一把揭开白布。 她就那样静静地躺着,像睡着了一般。 火红的嫁衣衬着肌肤如雪。 梳的纹丝不乱的头发上,一...
    开封第一讲书人阅读 46,098评论 1 272
  • 那天,我揣着相机与录音,去河边找鬼。 笑死,一个胖子当着我的面吹牛,可吹牛的内容都是我干的。 我是一名探鬼主播,决...
    沈念sama阅读 36,511评论 3 381
  • 文/苍兰香墨 我猛地睁开眼,长吁一口气:“原来是场噩梦啊……” “哼!你这毒妇竟也来了?” 一声冷哼从身侧响起,我...
    开封第一讲书人阅读 35,204评论 0 253
  • 序言:老挝万荣一对情侣失踪,失踪者是张志新(化名)和其女友刘颖,没想到半个月后,有当地人在树林里发现了一具尸体,经...
    沈念sama阅读 39,479评论 1 290
  • 正文 独居荒郊野岭守林人离奇死亡,尸身上长有42处带血的脓包…… 初始之章·张勋 以下内容为张勋视角 年9月15日...
    茶点故事阅读 34,572评论 2 309
  • 正文 我和宋清朗相恋三年,在试婚纱的时候发现自己被绿了。 大学时的朋友给我发了我未婚夫和他白月光在一起吃饭的照片。...
    茶点故事阅读 36,341评论 1 326
  • 序言:一个原本活蹦乱跳的男人离奇死亡,死状恐怖,灵堂内的尸体忽然破棺而出,到底是诈尸还是另有隐情,我是刑警宁泽,带...
    沈念sama阅读 32,213评论 3 312
  • 正文 年R本政府宣布,位于F岛的核电站,受9级特大地震影响,放射性物质发生泄漏。R本人自食恶果不足惜,却给世界环境...
    茶点故事阅读 37,576评论 3 298
  • 文/蒙蒙 一、第九天 我趴在偏房一处隐蔽的房顶上张望。 院中可真热闹,春花似锦、人声如沸。这庄子的主人今日做“春日...
    开封第一讲书人阅读 28,893评论 0 17
  • 文/苍兰香墨 我抬头看了看天上的太阳。三九已至,却和暖如春,着一层夹袄步出监牢的瞬间,已是汗流浃背。 一阵脚步声响...
    开封第一讲书人阅读 30,171评论 1 250
  • 我被黑心中介骗来泰国打工, 没想到刚下飞机就差点儿被人妖公主榨干…… 1. 我叫王不留,地道东北人。 一个月前我还...
    沈念sama阅读 41,486评论 2 341
  • 正文 我出身青楼,却偏偏与公主长得像,于是被迫代替她去往敌国和亲。 传闻我的和亲对象是个残疾皇子,可洞房花烛夜当晚...
    茶点故事阅读 40,676评论 2 335

推荐阅读更多精彩内容

  • Android 自定义View的各种姿势1 Activity的显示之ViewRootImpl详解 Activity...
    passiontim阅读 171,050评论 25 707
  • Spring Cloud为开发人员提供了快速构建分布式系统中一些常见模式的工具(例如配置管理,服务发现,断路器,智...
    卡卡罗2017阅读 134,497评论 18 139
  • 立秋:斗指西南维为立秋,阴意出地始杀万物,按秋训示,谷熟也"。 三候:凉风至;白露降;寒蝉鸣 秋风 南方靠海的城市...
    阿阿闲阅读 395评论 4 8
  • 一、精彩摘录 P4完成任何任务都需要一定的时间。同时,任何任务都最好或必须在某个特定的时间点之前完成,即,任务都有...
    发愤的海洱阅读 233评论 0 1
  • .1. 有个小个子 爱上了小胖子 每次见面 酝酿无数次 .2. 小胖子低下头 擦了擦手 眼神荡漾着温柔 ...
    绿子的信阅读 213评论 3 4