Full Code of yanxuwen/okhttp for AI

master 5dff429dfd66 cached
98 files
149.3 KB
39.1k tokens
282 symbols
1 requests
Download .txt
Repository: yanxuwen/okhttp
Branch: master
Commit: 5dff429dfd66
Files: 98
Total size: 149.3 KB

Directory structure:
gitextract_6p_2z26y/

├── README.md
└── XRetrofit/
    ├── .gitignore
    ├── Could
    ├── annotations/
    │   ├── .gitignore
    │   ├── build.gradle
    │   └── src/
    │       └── main/
    │           └── java/
    │               └── com/
    │                   └── yanxuwen/
    │                       └── xretrofit_annotations/
    │                           └── annotation/
    │                               ├── method/
    │                               │   ├── DELETE.java
    │                               │   ├── DOWNLOAD.java
    │                               │   ├── FORM.java
    │                               │   ├── GET.java
    │                               │   ├── Headers.java
    │                               │   ├── POST.java
    │                               │   ├── PUT.java
    │                               │   └── UPLOAD.java
    │                               ├── param/
    │                               │   ├── Body.java
    │                               │   ├── FilePath.java
    │                               │   ├── Header.java
    │                               │   ├── Param.java
    │                               │   ├── Path.java
    │                               │   └── Query.java
    │                               └── service/
    │                                   └── NetServiceClass.java
    ├── app/
    │   ├── .gitignore
    │   ├── build.gradle
    │   ├── proguard-rules.pro
    │   └── src/
    │       └── main/
    │           ├── AndroidManifest.xml
    │           ├── java/
    │           │   └── com/
    │           │       └── yanxuwen/
    │           │           └── xretrofit/
    │           │               ├── MainActivity.java
    │           │               ├── MyApplication.java
    │           │               ├── RxSchedulers.java
    │           │               ├── bean/
    │           │               │   ├── HomeInfoV5.java
    │           │               │   └── LoginBuild.java
    │           │               ├── callback/
    │           │               │   ├── MyCallBack.java
    │           │               │   ├── MyProgressCallBack.java
    │           │               │   └── ServerException.java
    │           │               ├── converter/
    │           │               │   ├── GsonConverterFactories.java
    │           │               │   ├── GsonRequestConverter.java
    │           │               │   ├── GsonResponseConverter.java
    │           │               │   ├── Rxjava2CallAdapter.java
    │           │               │   └── Rxjava2CallAdapterFactories.java
    │           │               └── http/
    │           │                   ├── HttpRequest.java
    │           │                   └── NetService.java
    │           └── res/
    │               ├── drawable/
    │               │   └── ic_launcher_background.xml
    │               ├── drawable-v24/
    │               │   └── ic_launcher_foreground.xml
    │               ├── layout/
    │               │   └── activity_main.xml
    │               ├── mipmap-anydpi-v26/
    │               │   ├── ic_launcher.xml
    │               │   └── ic_launcher_round.xml
    │               ├── values/
    │               │   ├── colors.xml
    │               │   ├── strings.xml
    │               │   └── styles.xml
    │               └── xml/
    │                   └── network_security_config.xml
    ├── bintray.gradle
    ├── build.gradle
    ├── compiler/
    │   ├── .gitignore
    │   ├── build.gradle
    │   └── src/
    │       └── main/
    │           └── java/
    │               └── com/
    │                   └── xretrofit/
    │                       └── compiler/
    │                           ├── ElementUtils.java
    │                           ├── HttpServiceProcessor2.java
    │                           └── create/
    │                               └── CreateClassUtils.java
    ├── gradle/
    │   └── wrapper/
    │       ├── gradle-wrapper.jar
    │       └── gradle-wrapper.properties
    ├── gradle.properties
    ├── gradlew
    ├── gradlew.bat
    ├── install.gradle
    ├── jitpack.gradle
    ├── settings.gradle
    ├── versions.gradle
    └── xretrofit/
        ├── .gitignore
        ├── build.gradle
        ├── proguard-rules.pro
        └── src/
            └── main/
                ├── AndroidManifest.xml
                └── java/
                    └── com/
                        └── xretrofit/
                            ├── CallAdapter/
                            │   ├── CallAdapter.java
                            │   ├── MCallAdapter.java
                            │   ├── ObjectCallAdapter.java
                            │   ├── ObjectCallAdapterFactory.java
                            │   └── ProgressCallAdapter.java
                            ├── HttpException.java
                            ├── HttpManager.java
                            ├── Interceptor/
                            │   ├── DownloadResponseBody.java
                            │   ├── ProgressListener.java
                            │   └── UploadRequestBodyBody.java
                            ├── Response.java
                            ├── bean/
                            │   └── RequestParams.java
                            ├── call/
                            │   ├── Call.java
                            │   ├── OkHttpCall.java
                            │   └── ProgressCall.java
                            ├── callback/
                            │   ├── CallBack.java
                            │   └── ProgressCallBack.java
                            ├── converter/
                            │   ├── Converter.java
                            │   ├── DownloadConverterFactories.java
                            │   ├── DownloadResponseConverter.java
                            │   ├── StringConverterFactories.java
                            │   ├── StringResponseConverter.java
                            │   ├── UploadConverterFactories.java
                            │   └── UploadRequestConverter.java
                            ├── method/
                            │   ├── MethodAnnotation.java
                            │   ├── ParamAnnotation.java
                            │   └── ServiceMethod.java
                            ├── okhttp/
                            │   └── SslUtils.java
                            └── utils/
                                ├── UrlUtils.java
                                └── Utils.java

================================================
FILE CONTENTS
================================================

================================================
FILE: README.md
================================================
#### 介绍
XRetrofit   是一个极致模仿Retrofit 的风格代码,代码没有Retrofit 复杂,简单易懂。
####
 支持`get`、`post`、`put`、`delete` 请求,这些使用都一样。
简化文件上传,跟下载 使用`@DOWNLOAD` 跟`@UPLOAD`
简化` post` 表单请求跟JOSN请求。
支持转换器,如果需要Gson的转换器,可以去demo那边去复制
支持适配器,内置跟Retrofit的`Call<String>`,当然了String可以替换任意的类型,跟Retrofit一样
没有内置`Rxjava的适配器`,如果需要,自己去demo那边复制。
##### 区别
`Retrofit`      属于运行时注解,通过动态代理生成一个代码
`XRetrofit`   属于编译时注解,通过APT生成代码,如果要学习APT,可以操作这篇文章[《带你了解APT》点击传送门](https://www.jianshu.com/p/00dce41e5d00)

##### 依赖,  只支持androidX,没有supper版本
~~~
    implementation 'com.yanxuwen.xretrofit:xretrofit:2.0.0'
    annotationProcessor 'com.yanxuwen.xretrofit:xretrofit-compiler:2.0.0'
~~~
##### 依赖,  由于jcenter要跑路了,所以已迁移到jitpack  
~~~
    implementation 'com.github.yanxuwen:xretrofit:0.0.8'
    annotationProcessor 'com.github.yanxuwen.xretrofit:compiler:0.0.8'
~~~
#### 使用方法,跟Retrofit一样,要定义接口,唯一区别在于在类上面要添加注解`@NetServiceClass`
#### 定义接口,该例子分别写了`Rxjava`  、`Call`  、`同步请求`的使用
~~~
@NetServiceClass
public interface NetService {
    /**
     * Rxjava  适配器
     */
    @GET("api/manage-home/v5/home/detail-v2")
    Observable<HomeInfoV5> get(@Query("page") int page, @Query("limit") int limit);

    /**
     * 自带Call  适配器
     */
    @GET("api/manage-home/v5/home/{version}")
    Call<HomeInfoV5> get(@Path("version") String version, @Query("page") int page, @Query("limit") int limit);

    /**
     * 同步请求
     */
    @GET("api/manage-home/v5/home/detail-v2")
    String get3(@Query("page") int page, @Query("limit") int limit);

}
~~~
#### 执行请求,以Call 适配器为例子
~~~
   public void onGet2(View view) {
        Call<HomeInfoV5> call = HttpRequest.getNetService().get("detail-v2", 0, 10);
        call.enqueue(new MyCallBack<HomeInfoV5>(this) {

            @Override
            public void success(HomeInfoV5 s) {
                Log.e("yxw", "onGet:" + s.getMsg());
            }

            @Override
            public void fail(String msg) {
                Log.e("yxw", "onGet:" + msg);
            }

            @Override
            public void cancel() {
                Log.e("yxw", "cancel");
            }
        });

    }
~~~
#### 执行请求,以Rxjava 适配器为例子
~~~

    /**
     * get请求
     */
    public void onGet(View view) {
        Observable<HomeInfoV5> observable = HttpRequest.getNetService().get(0, 10);
        observable.subscribeOn(Schedulers.io())
                .observeOn(AndroidSchedulers.mainThread())
                .doOnDispose(new Action() {
                    @Override
                    public void run() throws Exception {
                        Log.e("yxw","取消订阅2");
                    }
                })
                .as(AutoDispose.<HomeInfoV5>autoDisposable(
                        AndroidLifecycleScopeProvider.from(this, Lifecycle.Event.ON_PAUSE)))//OnDestory时自动解绑
                .subscribe(new Observer<HomeInfoV5>() {
                    @Override
                    public void onSubscribe(@NonNull Disposable d) {
                        Log.e("yxw", "onGet2 onSubscribe ");
                    }

                    @Override
                    public void onNext(@NonNull HomeInfoV5 homeInfoV5) {
                        Log.e("yxw", "onGet2 onNext " + homeInfoV5.getMsg());
                    }

                    @Override
                    public void onError(@NonNull Throwable e) {
                        Log.e("yxw", "onGet2 fail " + e.getMessage());
                    }

                    @Override
                    public void onComplete() {
                        Log.e("yxw", "onGet2 onComplete ");
                    }
                });

    }

    }
~~~
#### POST请求如何区分表单跟JOSN,,这里我们抛弃了Retrofit的复杂度
例子如下:表单请求
~~~
    @FORM
    @POST("https://bx-uat.bisinuolan.cn/api/login/mobile")
    Call<String> postForm(@Param("mobile") String mobile, @Param("sms_code") String sms_code);
~~~
注意2个注解 `@FORM` 跟`@Param`   我们舍弃了Retrofit的 `@Field` 跟`@FormUrlEncoded`  
 `@FORM` 替换了`@FormUrlEncoded`  来区分是否表单
 `@Param` 替换了`@Field`    ,
 `@Param` 有个好处就是:
1、不管是表单请求还JSON请求,都是可以作为参数来传参
2、如果用来Json请求的话,他会作为json格式的最外层数据,
哎这个怎么解释呢。就是如果你用@Param("userId"),那么最终传参是
~~~
{
	"userId": "c053e1a2-7335-4451-9201-e25e805a19f5-1578390821008"
}
~~~

 `@Body`    注解,可以这样传
~~~
    /**
     * json 整串提交
     */
    @POST("api/customer/v1/open/user/level/my")
    Call<String> postJson2(@Body String json);

    /**
     * json 实体类提交
     */
    @POST("api/customer/v1/open/user/level/my")
    Call<String> postJson(@Body LoginBuild json);
~~~
 `@Body`  注解跟Retrofit 注解一样,拥有一个功能,那是`转换器`,在添加转换器的时候,我们会通过 `@Body` 注解,判断当前是什么类型,然后通过类型,进行转换你想要的数据。。
上面的那个实体类提交就是这个原理,判断是Object类型的话,然后将Object类型转换为JSON格式进行提交。
那么你就可以定义你们公司需要啥类型,做啥处理。反正你们自己想。

***

#### 配置。这个是跟Retrofit是一样的。。

        OkHttpClient client = new OkHttpClient
                .Builder()
                .connectTimeout(15, TimeUnit.SECONDS)//连接超时时间
                .readTimeout(15, TimeUnit.SECONDS)//读取超时时间
                .writeTimeout(15, TimeUnit.SECONDS)//写入超时时间
                .retryOnConnectionFailure(false)//连接不上是否重连,false不重连
                .hostnameVerifier(new TrustAllHostnameVerifier())//校验名称,这个对象就是信任所有的主机,也就是信任所有https的请求
                .sslSocketFactory(SslUtils.getSslSocketFactory().sSLSocketFactory, SslUtils.getSslSocketFactory().trustManager)
                .build();
        HttpManager.Builder()
                .baseUrl("https://bxapi.bisinuolan.cn/")
                .addConverterFactory(GsonConverterFactories.create())//FastJson转换器、可以替换成Gson
                .addCallAdapterFactory(Rxjava2CallAdapterFactories.create())//Rxjava2适配器,不配置有自带Call适配器
                .client(client)
                .build();

#### 出如何初始呢,NetService (类名是随便定义的)接口呢,那就是下面那个
~~~
public class HttpRequest {

    private static NetService netService;

    public static NetService getNetService() {
        try {
            if (netService == null) {
                synchronized (HttpRequest.class) {
                    if (netService == null) {
                        netService = (NetService) Class.forName(HttpManager.getImplName(NetService.class))
                                .getConstructor().newInstance();
                    }
                }
            }
        } catch (Exception e) {
            e.printStackTrace();
        }
        return netService;
    }
}

~~~

然后使用的时候就是直接
HttpRequest.getNetService().get(0, 10);
***
### github  [点击跳转](https://github.com/yanxuwen/XRetrofit)
### 如果你喜欢就去 github 帮我star下,非常感谢o(∩_∩)o~~~








================================================
FILE: XRetrofit/.gitignore
================================================
# Built application files
*.apk
*.ap_

# Files for the ART/Dalvik VM
*.dex

# Java class files
*.class

# Generated files
bin/
gen/
out/

# Gradle files
.gradle/
build/

# Local configuration file (sdk path, etc)
local.properties

# Proguard folder generated by Eclipse
proguard/

# Log Files
*.log

# Android Studio Navigation editor temp files
.navigation/

# Android Studio captures folder
captures/

# Intellij
*.iml
.idea/

# Keystore files
*.jks

# External native build folder generated in Android Studio 2.2 and later
.externalNativeBuild

================================================
FILE: XRetrofit/Could
================================================


================================================
FILE: XRetrofit/annotations/.gitignore
================================================
/build

================================================
FILE: XRetrofit/annotations/build.gradle
================================================
apply plugin: 'java'

ext {
    bintrayName = 'annotations'
    artifact = bintrayName
    libraryName = 'xretrofit-annotations'
    libraryDescription = 'this is a  xretrofit-annotations'
    libraryVersion = main_version
}
compileJava {
    sourceCompatibility = '1.8'
    targetCompatibility = '1.8'
}

dependencies {
}

//apply from: '../install.gradle'
//apply from: '../bintray.gradle'
apply from: '../jitpack.gradle'


================================================
FILE: XRetrofit/annotations/src/main/java/com/yanxuwen/xretrofit_annotations/annotation/method/DELETE.java
================================================
//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by Fernflower decompiler)
//

package com.yanxuwen.xretrofit_annotations.annotation.method;

import java.lang.annotation.Documented;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

@Documented
@Target({ElementType.METHOD})
@Retention(RetentionPolicy.CLASS)
public @interface DELETE {
    String value() default "";
}


================================================
FILE: XRetrofit/annotations/src/main/java/com/yanxuwen/xretrofit_annotations/annotation/method/DOWNLOAD.java
================================================
//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by Fernflower decompiler)
//

package com.yanxuwen.xretrofit_annotations.annotation.method;

import java.lang.annotation.Documented;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

@Documented
@Target({ElementType.METHOD})
@Retention(RetentionPolicy.CLASS)
public @interface DOWNLOAD {
    String value() default "";
}


================================================
FILE: XRetrofit/annotations/src/main/java/com/yanxuwen/xretrofit_annotations/annotation/method/FORM.java
================================================
//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by Fernflower decompiler)
//

package com.yanxuwen.xretrofit_annotations.annotation.method;

import java.lang.annotation.Documented;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

/**
 *  标记是否是表单提交
 */
@Documented
@Target({ElementType.METHOD})
@Retention(RetentionPolicy.CLASS)
public @interface FORM {
}


================================================
FILE: XRetrofit/annotations/src/main/java/com/yanxuwen/xretrofit_annotations/annotation/method/GET.java
================================================
//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by Fernflower decompiler)
//

package com.yanxuwen.xretrofit_annotations.annotation.method;

import java.lang.annotation.Documented;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

@Documented
@Target({ElementType.METHOD})
@Retention(RetentionPolicy.CLASS)
public @interface GET {
    String value() default "";
}


================================================
FILE: XRetrofit/annotations/src/main/java/com/yanxuwen/xretrofit_annotations/annotation/method/Headers.java
================================================
//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by Fernflower decompiler)
//

package com.yanxuwen.xretrofit_annotations.annotation.method;

import java.lang.annotation.Documented;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

@Documented
@Target({ElementType.METHOD})
@Retention(RetentionPolicy.CLASS)
public @interface Headers {
    String[] value();
    boolean encoded() default false;
}


================================================
FILE: XRetrofit/annotations/src/main/java/com/yanxuwen/xretrofit_annotations/annotation/method/POST.java
================================================
//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by Fernflower decompiler)
//

package com.yanxuwen.xretrofit_annotations.annotation.method;

import java.lang.annotation.Documented;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

@Documented
@Target({ElementType.METHOD})
@Retention(RetentionPolicy.CLASS)
public @interface POST {
    String value() default "";

}


================================================
FILE: XRetrofit/annotations/src/main/java/com/yanxuwen/xretrofit_annotations/annotation/method/PUT.java
================================================
//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by Fernflower decompiler)
//

package com.yanxuwen.xretrofit_annotations.annotation.method;

import java.lang.annotation.Documented;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

@Documented
@Target({ElementType.METHOD})
@Retention(RetentionPolicy.CLASS)
public @interface PUT {
    String value() default "";
}


================================================
FILE: XRetrofit/annotations/src/main/java/com/yanxuwen/xretrofit_annotations/annotation/method/UPLOAD.java
================================================
//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by Fernflower decompiler)
//

package com.yanxuwen.xretrofit_annotations.annotation.method;

import java.lang.annotation.Documented;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

@Documented
@Target({ElementType.METHOD})
@Retention(RetentionPolicy.CLASS)
public @interface UPLOAD {
    String value() default "";
}


================================================
FILE: XRetrofit/annotations/src/main/java/com/yanxuwen/xretrofit_annotations/annotation/param/Body.java
================================================
//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by Fernflower decompiler)
//

package com.yanxuwen.xretrofit_annotations.annotation.param;

import java.lang.annotation.Documented;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

@Documented
@Target({ElementType.PARAMETER})
@Retention(RetentionPolicy.CLASS)
public @interface Body {
}


================================================
FILE: XRetrofit/annotations/src/main/java/com/yanxuwen/xretrofit_annotations/annotation/param/FilePath.java
================================================
//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by Fernflower decompiler)
//

package com.yanxuwen.xretrofit_annotations.annotation.param;

import java.lang.annotation.Documented;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

//用于文件上传用的路径
//支持 File String List<File> List<String>
@Documented
@Target({ElementType.PARAMETER})
@Retention(RetentionPolicy.CLASS)
public @interface FilePath {
}


================================================
FILE: XRetrofit/annotations/src/main/java/com/yanxuwen/xretrofit_annotations/annotation/param/Header.java
================================================
//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by Fernflower decompiler)
//

package com.yanxuwen.xretrofit_annotations.annotation.param;

import java.lang.annotation.Documented;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

@Documented
@Retention(RetentionPolicy.CLASS)
@Target({ElementType.PARAMETER})
public @interface Header {
    String value();
    boolean encoded() default false;
}


================================================
FILE: XRetrofit/annotations/src/main/java/com/yanxuwen/xretrofit_annotations/annotation/param/Param.java
================================================
//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by Fernflower decompiler)
//

package com.yanxuwen.xretrofit_annotations.annotation.param;

import java.lang.annotation.Documented;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

@Documented
@Target({ElementType.PARAMETER})
@Retention(RetentionPolicy.CLASS)
public @interface Param {
    String value();
}


================================================
FILE: XRetrofit/annotations/src/main/java/com/yanxuwen/xretrofit_annotations/annotation/param/Path.java
================================================
//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by Fernflower decompiler)
//

package com.yanxuwen.xretrofit_annotations.annotation.param;

import java.lang.annotation.Documented;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

@Documented
@Retention(RetentionPolicy.CLASS)
@Target({ElementType.PARAMETER})
public @interface Path {
    String value();

    boolean encoded() default false;
}


================================================
FILE: XRetrofit/annotations/src/main/java/com/yanxuwen/xretrofit_annotations/annotation/param/Query.java
================================================
//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by Fernflower decompiler)
//

package com.yanxuwen.xretrofit_annotations.annotation.param;

import java.lang.annotation.Documented;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

@Documented
@Target({ElementType.PARAMETER})
@Retention(RetentionPolicy.CLASS)
public @interface Query {
    String value();
}


================================================
FILE: XRetrofit/annotations/src/main/java/com/yanxuwen/xretrofit_annotations/annotation/service/NetServiceClass.java
================================================
package com.yanxuwen.xretrofit_annotations.annotation.service;

import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

@Target({ElementType.TYPE})
@Retention(RetentionPolicy.CLASS)
public @interface NetServiceClass {
    String value() default "";
}


================================================
FILE: XRetrofit/app/.gitignore
================================================
/build


================================================
FILE: XRetrofit/app/build.gradle
================================================
apply plugin: 'com.android.application'

android {
    compileSdkVersion build_versions.target_sdk
    buildToolsVersion build_versions.build_tools
    defaultConfig {
        applicationId "com.yanxuwen.myhttpservice"
        minSdkVersion build_versions.min_sdk
        targetSdkVersion build_versions.target_sdk
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
        multiDexEnabled true
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
        }
    }
    repositories {
        flatDir { dirs 'libs' }
    }

    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }

}
//自动导入libs目录下的aar文件
fileTree(dir: 'libs', include: '**/*.aar').each { File file ->
    dependencies.add("implementation", [name: file.name.lastIndexOf('.').with {
        it != -1 ? file.name[0..<it] : file.name
    }, ext                                  : 'aar'])
}
dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    api support.app_compat
    // RxJava
    api other.rxandroid
    api other.rxjava
    //自动解绑取代RxLifecycle
    api other.autoDispose
    //权限
    api other.rxpermissions

    api other.fastjson

    implementation project(path: ':xretrofit')
    annotationProcessor project(':compiler')
}


================================================
FILE: XRetrofit/app/proguard-rules.pro
================================================
# Add project specific ProGuard rules here.
# You can control the set of applied configuration files using the
# proguardFiles setting in build.gradle.
#
# For more details, see
#   http://developer.android.com/guide/developing/tools/proguard.html

# If your project uses WebView with JS, uncomment the following
# and specify the fully qualified class name to the JavaScript interface
# class:
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
#   public *;
#}

# Uncomment this to preserve the line number information for
# debugging stack traces.
#-keepattributes SourceFile,LineNumberTable

# If you keep the line number information, uncomment this to
# hide the original source file name.
#-renamesourcefileattribute SourceFile


================================================
FILE: XRetrofit/app/src/main/AndroidManifest.xml
================================================
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.yanxuwen.xretrofit">
    <uses-permission android:name="android.permission.INTERNET"/>
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
    <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
    <application
        android:networkSecurityConfig="@xml/network_security_config"
        android:name=".MyApplication"
        android:allowBackup="true"
        android:icon="@mipmap/ic_launcher"
        android:label="@string/app_name"
        android:roundIcon="@mipmap/ic_launcher_round"
        android:supportsRtl="true"
        android:theme="@style/AppTheme">
        <activity android:name=".MainActivity">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
    </application>

</manifest>

================================================
FILE: XRetrofit/app/src/main/java/com/yanxuwen/xretrofit/MainActivity.java
================================================
package com.yanxuwen.xretrofit;

import android.Manifest;
import android.os.Bundle;
import android.os.Environment;
import android.os.Looper;
import android.util.Log;
import android.view.View;
import android.widget.Toast;

import androidx.appcompat.app.AppCompatActivity;
import androidx.lifecycle.Lifecycle;

import com.tbruyelle.rxpermissions2.Permission;
import com.tbruyelle.rxpermissions2.RxPermissions;
import com.uber.autodispose.AutoDispose;
import com.uber.autodispose.android.lifecycle.AndroidLifecycleScopeProvider;
import com.xretrofit.call.Call;
import com.xretrofit.call.ProgressCall;
import com.yanxuwen.xretrofit.bean.HomeInfoV5;
import com.yanxuwen.xretrofit.bean.LoginBuild;
import com.yanxuwen.xretrofit.callback.MyCallBack;
import com.yanxuwen.xretrofit.callback.MyProgressCallBack;
import com.yanxuwen.xretrofit.http.HttpRequest;

import io.reactivex.Observable;
import io.reactivex.Observer;
import io.reactivex.android.schedulers.AndroidSchedulers;
import io.reactivex.annotations.NonNull;
import io.reactivex.disposables.Disposable;
import io.reactivex.functions.Action;
import io.reactivex.functions.Consumer;
import io.reactivex.schedulers.Schedulers;

public class MainActivity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
    }

    public boolean isMainThread() {
        return Looper.getMainLooper().getThread() == Thread.currentThread();
    }

    /**
     * get请求
     */
    public void onGet(View view) {
        Observable<HomeInfoV5> observable = HttpRequest.getNetService().get(0, 10);
        observable
                .as(RxSchedulers.applySchedulers(this))
                .subscribe(new Observer<HomeInfoV5>() {
                    @Override
                    public void onSubscribe(@NonNull Disposable d) {
                        Log.e("yxw", isMainThread() +" onGet2 onSubscribe ");
                    }

                    @Override
                    public void onNext(@NonNull HomeInfoV5 homeInfoV5) {
                        Log.e("yxw", isMainThread() + " onGet2 onNext " + homeInfoV5.getMsg());
                    }

                    @Override
                    public void onError(@NonNull Throwable e) {
                        Log.e("yxw", "onGet2 fail " + e.getMessage());
                    }

                    @Override
                    public void onComplete() {
                        Log.e("yxw", isMainThread() + " onGet2 onComplete ");
                    }
                });

    }

    /**
     * get请求(URL中带有参数,也支持post)
     */
    public void onGet2(View view) {
        Call<HomeInfoV5> call = HttpRequest.getNetService().get("detail-v2", 0, 10);
        call.enqueue(new MyCallBack<HomeInfoV5>(this) {

            @Override
            public void success(HomeInfoV5 s) {
                Log.e("yxw", "onGet:" + s.getMsg());
            }

            @Override
            public void fail(String msg) {
                Log.e("yxw", "onGet:" + msg);
            }

            @Override
            public void cancel() {
                Log.e("yxw", "cancel");
            }
        });

    }

    /**
     * 表单提交
     */
    public void postForm(View view) {
        Call<String> call = HttpRequest.getNetService().postForm("19906058322", "10960");
        call.enqueue(new MyCallBack<String>() {
            @Override
            public void success(String s) {
                Log.e("yxw", "postForm:" + s);
            }

            @Override
            public void fail(String msg) {
                Log.e("yxw", "postForm:" + msg);
            }
        });
    }

    /**
     * json提交
     */
    public void postJson(View view) {
        String userId = "c053e1a2-7335-4451-9201-e25e805a19f5-1578390821008";
        Call<String> call = HttpRequest.getNetService().postJson(userId);
        call.enqueue(new MyCallBack<String>() {
            @Override
            public void success(String s) {
                Log.e("yxw", "postJson:" + s);
            }

            @Override
            public void fail(String msg) {
                Log.e("yxw", "postJson:" + msg);
            }
        });
    }

    /**
     * json 整串提交
     */
    public void postJson2(View view) {
        String json = "{\n" +
                "\t\"userId\": \"c053e1a2-7335-4451-9201-e25e805a19f5-1578390821008\"\n" +
                "}";
        Call<String> call = HttpRequest.getNetService().postJson2(json);
        call.enqueue(new MyCallBack<String>() {
            @Override
            public void success(String s) {
                Log.e("yxw", "postJson2:" + s);
            }

            @Override
            public void fail(String msg) {
                Log.e("yxw", "postJson2:" + msg);
            }
        });
    }

    /**
     * json 整串提交
     */
    public void postJson3(View view) {
        LoginBuild mLoginBuild = new LoginBuild();
        mLoginBuild.setUserId("c053e1a2-7335-4451-9201-e25e805a19f5-1578390821008");
        Call<String> call = HttpRequest.getNetService().postJson(mLoginBuild);
        call.enqueue(new MyCallBack<String>() {
            @Override
            public void success(String s) {
                Log.e("yxw", "postJson2:" + s);
            }

            @Override
            public void fail(String msg) {
                Log.e("yxw", "postJson2:" + msg);
            }
        });
    }

    /**
     * put 提交
     */
    public void onPut(View view) {
        Call<String> call = HttpRequest.getNetService().put("header", "测试", "signature", "area");
        call.enqueue(new MyCallBack<String>() {
            @Override
            public void success(String s) {
                Log.e("yxw", "onPut :" + s);
            }

            @Override
            public void fail(String msg) {
                Log.e("yxw", "onPut fail :" + msg);
            }
        });
    }

    /**
     * delete 提交
     */
    public void onDelete(View view) {
        Call<String> call = HttpRequest.getNetService().delete("header", "123231");
        call.enqueue(new MyCallBack<String>() {
            @Override
            public void success(String s) {
                Log.e("yxw", "onDelete :" + s);
            }

            @Override
            public void fail(String msg) {
                Log.e("yxw", "onDelete fail :" + msg);
            }
        });
    }

    public void onDownload(View v) {
        //先权限申请,在请求
        RxPermissions rxPermissions = new RxPermissions(this);
        rxPermissions.requestEach(
                Manifest.permission.WRITE_EXTERNAL_STORAGE)
                .subscribe(new Consumer<Permission>() {
                    @Override
                    public void accept(Permission permission) throws Exception {
                        if (permission.granted) {
                            String path = Environment.getExternalStorageDirectory().toString() + "/测试/text2.apk";//获取目录
                            ProgressCall<String> call = HttpRequest.getNetService().download(path);
                            call.enqueue(new MyProgressCallBack<String>() {
                                @Override
                                public void onProgress(float progress) {
                                    Log.e("yxw", "onDownload progress :" + progress);
                                }

                                @Override
                                public void success(String s) {
                                    Log.e("yxw", "onDownload  :" + s);
                                }

                                @Override
                                public void fail(String msg) {
                                    Log.e("yxw", "onDownload fail :" + msg);
                                }
                            });
                        } else {
                            Toast.makeText(MainActivity.this, "请打开存储权限", Toast.LENGTH_SHORT).show();
                        }
                    }
                });
    }

    public void onUpload(View v) {
//        //先权限申请,在请求
        RxPermissions rxPermissions = new RxPermissions(this);
        rxPermissions.requestEach(
                Manifest.permission.WRITE_EXTERNAL_STORAGE)
                .subscribe(new Consumer<Permission>() {
                    @Override
                    public void accept(Permission permission) throws Exception {
                        if (permission.granted) {
                            //允许权限
                            String path = Environment.getExternalStorageDirectory().toString() + "/测试/测试.mp4";//获取跟目录
                            ProgressCall<String> call = HttpRequest.getNetService().upload(path, true);
                            call.enqueue(new MyProgressCallBack<String>() {
                                @Override
                                public void success(String s) {
                                    Log.e("yxw", "onUpload :" + s);
                                }

                                @Override
                                public void fail(String msg) {
                                    Log.e("yxw", "onUpload2 fail:" + msg);
                                }

                                @Override
                                public void onProgress(float progress) {
                                    Log.e("yxw", "onUpload2 progress:" + progress);
                                }
                            });
                        } else {
                            Toast.makeText(MainActivity.this, "请打开存储权限", Toast.LENGTH_SHORT).show();
                        }
                    }
                });
    }
}


================================================
FILE: XRetrofit/app/src/main/java/com/yanxuwen/xretrofit/MyApplication.java
================================================
package com.yanxuwen.xretrofit;

import android.app.Application;

import com.xretrofit.HttpManager;
import com.xretrofit.okhttp.SslUtils;
import com.yanxuwen.xretrofit.converter.GsonConverterFactories;
import com.yanxuwen.xretrofit.converter.Rxjava2CallAdapterFactories;

import java.util.concurrent.TimeUnit;

import javax.net.ssl.HostnameVerifier;
import javax.net.ssl.SSLSession;

import okhttp3.OkHttpClient;

public class MyApplication extends Application {
    @Override
    public void onCreate() {
        super.onCreate();
        init();
    }

    public void init() {

        OkHttpClient client = new OkHttpClient
                .Builder()
                .connectTimeout(15, TimeUnit.SECONDS)//连接超时时间
                .readTimeout(15, TimeUnit.SECONDS)//读取超时时间
                .writeTimeout(15, TimeUnit.SECONDS)//写入超时时间
                .retryOnConnectionFailure(false)//连接不上是否重连,false不重连
                .hostnameVerifier(new TrustAllHostnameVerifier())//校验名称,这个对象就是信任所有的主机,也就是信任所有https的请求
                .sslSocketFactory(SslUtils.getSslSocketFactory().sSLSocketFactory, SslUtils.getSslSocketFactory().trustManager)
                .build();
        HttpManager.Builder()
                .baseUrl("https://bxapi.bisinuolan.cn/")
                .addConverterFactory(GsonConverterFactories.create())//FastJson转换器、可以替换成Gson
                .addCallAdapterFactory(Rxjava2CallAdapterFactories.create())//Rxjava2适配器,不配置有自带Call适配器
                .client(client)
                .build();
    }

    /**
     * 信任所有的服务器,返回true
     */
    private static class TrustAllHostnameVerifier implements HostnameVerifier {
        @Override
        public boolean verify(String hostname, SSLSession session) {
            return true;
        }
    }
}


================================================
FILE: XRetrofit/app/src/main/java/com/yanxuwen/xretrofit/RxSchedulers.java
================================================
package com.yanxuwen.xretrofit;

import androidx.lifecycle.Lifecycle;
import androidx.lifecycle.LifecycleOwner;

import com.uber.autodispose.AutoDispose;
import com.uber.autodispose.ObservableSubscribeProxy;
import com.uber.autodispose.android.lifecycle.AndroidLifecycleScopeProvider;

import io.reactivex.Observable;
import io.reactivex.ObservableConverter;
import io.reactivex.android.schedulers.AndroidSchedulers;
import io.reactivex.annotations.NonNull;
import io.reactivex.schedulers.Schedulers;

/**
 * @author bsnl_yanxuwen
 * @date 2021/3/19 10:52
 * Description :
 */
public class RxSchedulers {
    public static <T> ObservableConverter<T, ObservableSubscribeProxy> applySchedulers(LifecycleOwner owner) {
        return new ObservableConverter<T, ObservableSubscribeProxy>() {
            @NonNull
            @Override
            public ObservableSubscribeProxy apply(@NonNull Observable<T> upstream) {
                return upstream
                        .subscribeOn(Schedulers.io())
                        .observeOn(AndroidSchedulers.mainThread())
                        .as(AutoDispose.autoDisposable(
                                AndroidLifecycleScopeProvider.from(owner, Lifecycle.Event.ON_DESTROY)));
            }
        };
    }
}


================================================
FILE: XRetrofit/app/src/main/java/com/yanxuwen/xretrofit/bean/HomeInfoV5.java
================================================
package com.yanxuwen.xretrofit.bean;

/**
 * @author bsnl_yanxuwen
 * @date 2021/2/19 9:21
 * Description :
 */
public class HomeInfoV5 {

    private String msg;

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }
}


================================================
FILE: XRetrofit/app/src/main/java/com/yanxuwen/xretrofit/bean/LoginBuild.java
================================================
package com.yanxuwen.xretrofit.bean;

public class LoginBuild {

    /**
     * password : “123456”
     * mobile : “15060568265”
     */

    private String userId;
    private String msg;

    public String getUserId() {
        return userId;
    }

    public void setUserId(String userId) {
        this.userId = userId;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }
}


================================================
FILE: XRetrofit/app/src/main/java/com/yanxuwen/xretrofit/callback/MyCallBack.java
================================================
package com.yanxuwen.xretrofit.callback;

import android.util.Log;

import androidx.fragment.app.FragmentActivity;
import androidx.lifecycle.Lifecycle;
import androidx.lifecycle.LifecycleObserver;
import androidx.lifecycle.OnLifecycleEvent;

import com.xretrofit.Response;
import com.xretrofit.call.Call;
import com.xretrofit.callback.CallBack;

/**
 * @author bsnl_yanxuwen
 * @date 2021/2/5 11:19
 * Description :
 */
public abstract class MyCallBack<T> implements CallBack<T> {

    private FragmentActivity activity;

    public MyCallBack() {
    }

    public MyCallBack(FragmentActivity activity) {
        this.activity = activity;
    }

    @Override
    public void onStart(Call<T> call) {
        if (activity != null) {
            activity.getLifecycle().addObserver(new LifecycleObserver() {
                @OnLifecycleEvent(Lifecycle.Event.ON_DESTROY)
                public void onDestroy() {
                    Log.e("yxw", "????取消请求");
                    call.cancel();
                }

            });
        }
    }

    @Override
    public final void onSuccess(Call<T> call, Response<T> response) {
        if (response.errorBody() != null) {
            fail("网络异常");
            return;
        }
        success(response.body());

    }

    @Override
    public final void onFail(Call<T> call, Throwable e) {
        if (call.isCanceled()){
            cancel();
        } else {
            fail(ServerException.handleException(e));
        }
    }


    public abstract void success(T t);

    public abstract void fail(String msg);

    public void cancel(){

    }

}


================================================
FILE: XRetrofit/app/src/main/java/com/yanxuwen/xretrofit/callback/MyProgressCallBack.java
================================================
package com.yanxuwen.xretrofit.callback;

import com.xretrofit.Response;
import com.xretrofit.call.Call;
import com.xretrofit.callback.ProgressCallBack;

public abstract class MyProgressCallBack<T> extends ProgressCallBack<T> {

    @Override
    public void onStart(Call<T> call) {

    }

    @Override
    public final void onSuccess(Call<T> call, Response<T> response) {
        if (response.errorBody() != null) {
            fail("网络异常");
            return;
        }
        success(response.body());

    }

    @Override
    public final void onFail(Call<T> call, Throwable e) {
        fail(ServerException.handleException(e));
    }


    public abstract void success(T t);

    public abstract void fail(String msg);

}


================================================
FILE: XRetrofit/app/src/main/java/com/yanxuwen/xretrofit/callback/ServerException.java
================================================
package com.yanxuwen.xretrofit.callback;

import org.apache.http.conn.ConnectTimeoutException;
import org.json.JSONException;

import java.io.NotSerializableException;
import java.net.ConnectException;
import java.net.SocketTimeoutException;
import java.net.UnknownHostException;
import java.text.ParseException;

public class ServerException {

    public static  String handleException(Throwable e) {
        String msg = e.getMessage();
        if (e instanceof SocketTimeoutException) {
            msg = "网络连接超时,请检查网络";
        } else if (e instanceof ConnectException) {
            msg = "网络异常,请检查网络";
        } else if (e instanceof ConnectTimeoutException) {
            msg = "网络连接超时,请检查网络";
        } else if (e instanceof UnknownHostException) {
            msg = "网络异常,请检查网络";
        } else if (e instanceof NullPointerException) {
            msg = "空指针异常";
        } else if (e instanceof javax.net.ssl.SSLHandshakeException) {
            msg = "证书验证失败";
        } else if (e instanceof ClassCastException) {
            msg = "类型转换错误";
        } else if (/*e instanceof JsonParseException ||*/
            e instanceof JSONException ||
                e instanceof com.alibaba.fastjson.JSONException ||
                /*e instanceof JsonSerializer ||*/
                e instanceof NotSerializableException ||
                e instanceof ParseException) {
            msg = "解析错误";
        }
        return msg;
    }
}


================================================
FILE: XRetrofit/app/src/main/java/com/yanxuwen/xretrofit/converter/GsonConverterFactories.java
================================================
package com.yanxuwen.xretrofit.converter;

import com.xretrofit.converter.Converter;

import org.jetbrains.annotations.Nullable;

import java.lang.reflect.Type;

import okhttp3.RequestBody;
import okhttp3.ResponseBody;

/**
 * @author bsnl_yanxuwen
 * @date 2021/2/4 15:46
 * Description :
 * 接口数据转换器
 * fastjson转换器
 */
public class GsonConverterFactories extends Converter.Factory {

    public static GsonConverterFactories create() {
        return new GsonConverterFactories();
    }

    @Nullable
    @Override
    public Converter<?, RequestBody> requestBodyConverter(Type request, Type requestParamType) {
        if (requestParamType instanceof Object) {
            return new GsonRequestConverter();
        }
        return null;
    }

    @Nullable
    @Override
    public Converter<ResponseBody, ?> responseBodyConverter(Type request, Type responseType) {
        Class<?> rawType = getRawType(responseType);
        if (rawType instanceof Object) {
            return new GsonResponseConverter(responseType);
        }
        return null;
    }
}


================================================
FILE: XRetrofit/app/src/main/java/com/yanxuwen/xretrofit/converter/GsonRequestConverter.java
================================================
package com.yanxuwen.xretrofit.converter;

import com.alibaba.fastjson.JSONObject;
import com.xretrofit.converter.Converter;

import okhttp3.MediaType;
import okhttp3.RequestBody;

/**
 * @author bsnl_yanxuwen
 * @date 2021/2/5 16:00
 * Description :
 * 请求参数数据转换
 */
class GsonRequestConverter<T> implements Converter<T, RequestBody> {
    private static final MediaType JSON = MediaType.parse("application/json;charset=utf-8");


    @Override
    public RequestBody convert(T value) throws Exception {
        RequestBody requestBody = RequestBody.create(JSON, JSONObject.toJSONString(value));
        return requestBody;
    }
}


================================================
FILE: XRetrofit/app/src/main/java/com/yanxuwen/xretrofit/converter/GsonResponseConverter.java
================================================
package com.yanxuwen.xretrofit.converter;

import com.alibaba.fastjson.JSONObject;
import com.xretrofit.converter.Converter;

import java.lang.reflect.Type;

import okhttp3.ResponseBody;

/**
 * @author bsnl_yanxuwen
 * @date 2021/2/4 17:09
 * Description :
 * 请求结果数据转换
 * Gson操作
 */
public class GsonResponseConverter<T> implements Converter<ResponseBody, T> {

    private Type responseType;

    protected GsonResponseConverter(Type responseType){
        this.responseType = responseType;
    }


    @Override
    public T convert(ResponseBody value) throws Exception {
        String responseStr = value.string();
        return (T) JSONObject.parseObject(responseStr,responseType);
    }
}


================================================
FILE: XRetrofit/app/src/main/java/com/yanxuwen/xretrofit/converter/Rxjava2CallAdapter.java
================================================
package com.yanxuwen.xretrofit.converter;

import com.xretrofit.CallAdapter.CallAdapter;
import com.xretrofit.HttpException;
import com.xretrofit.Response;
import com.xretrofit.call.Call;

import java.lang.ref.WeakReference;
import java.lang.reflect.Type;

import io.reactivex.Observable;
import io.reactivex.Observer;
import io.reactivex.disposables.Disposable;
import io.reactivex.exceptions.CompositeException;
import io.reactivex.exceptions.Exceptions;
import io.reactivex.plugins.RxJavaPlugins;

/**
 * @author bsnl_yanxuwen
 * @date 2021/2/8 10:19
 * Description :
 * rxjava 适配器
 */
class Rxjava2CallAdapter<T> implements CallAdapter<Observable, T> {

    private Type responseType;

    protected Rxjava2CallAdapter(Type responseType) {
        this.responseType = responseType;
    }


    @Override
    public Type responseType() {
        return responseType;
    }


    @Override
    public Observable adapt(Call<T> call) {
        Observable observable = new CallExecuteObservable(call);
        return observable;
    }

    final class CallExecuteObservable<T> extends Observable<T> {
        private final Call<T> call;


        CallExecuteObservable(Call<T> call) {
            this.call = call;

        }

        @Override
        protected void subscribeActual(Observer<? super T> observer) {
            CallDisposable disposable = new CallDisposable(call);
            observer.onSubscribe(disposable);
            Response<T> response = null;
            try {
                response = call.execute();
                if (response.isSuccessful()) {
                    observer.onNext((T) response.body());
                } else {
                    Throwable t = new HttpException(response);
                    try {
                        observer.onError(t);
                    } catch (Throwable inner) {
                        Exceptions.throwIfFatal(inner);
                        RxJavaPlugins.onError(new CompositeException(t, inner));
                    }
                }
            } catch (Throwable t) {
                Exceptions.throwIfFatal(t);
                if (!disposable.isDisposed()) {
                    try {
                        observer.onError(t);
                    } catch (Throwable inner) {
                        Exceptions.throwIfFatal(inner);
                        RxJavaPlugins.onError(new CompositeException(t, inner));
                    }
                }
            }
            observer.onComplete();
        }

    }


    private static final class CallDisposable implements Disposable {
        private volatile boolean disposed;
        private WeakReference<Call> weakCall;

        CallDisposable(Call<?> call) {
            weakCall = new WeakReference<>(call);

        }

        @Override
        public void dispose() {
            disposed = true;
            if (weakCall != null) {
                weakCall.get().cancel();
            }
        }

        @Override
        public boolean isDisposed() {
            return disposed;
        }
    }
}

================================================
FILE: XRetrofit/app/src/main/java/com/yanxuwen/xretrofit/converter/Rxjava2CallAdapterFactories.java
================================================
package com.yanxuwen.xretrofit.converter;

import com.xretrofit.CallAdapter.CallAdapter;
import com.xretrofit.utils.Utils;

import org.jetbrains.annotations.Nullable;

import java.lang.reflect.Type;

import io.reactivex.Observable;

/**
 * @author bsnl_yanxuwen
 * @date 2021/2/4 15:46
 * Description :
 * rxjava2 适配器
 */
public class Rxjava2CallAdapterFactories<T> extends CallAdapter.Factory {

    public static Rxjava2CallAdapterFactories create() {
        return new Rxjava2CallAdapterFactories();
    }


    @Nullable
    @Override
    public CallAdapter<Observable, T> get(Type returnType) {
        Class<?> rawType = getRawType(returnType);
        final Type responseType = Utils.getCallResponseType(returnType);
        if (rawType == Observable.class) {
            return new Rxjava2CallAdapter<T>(responseType);
        }
        return null;
    }
}


================================================
FILE: XRetrofit/app/src/main/java/com/yanxuwen/xretrofit/http/HttpRequest.java
================================================
package com.yanxuwen.xretrofit.http;

import com.xretrofit.HttpManager;

public class HttpRequest {

    private static NetService netService;

    public static NetService getNetService() {
        try {
            if (netService == null) {
                synchronized (HttpRequest.class) {
                    if (netService == null) {
                        netService = (NetService) Class.forName(HttpManager.getImplName(NetService.class))
                                .getConstructor().newInstance();
                    }
                }
            }
        } catch (Exception e) {
            e.printStackTrace();
        }
        return netService;
    }
}


================================================
FILE: XRetrofit/app/src/main/java/com/yanxuwen/xretrofit/http/NetService.java
================================================
package com.yanxuwen.xretrofit.http;

import com.xretrofit.call.Call;
import com.xretrofit.call.ProgressCall;
import com.yanxuwen.xretrofit_annotations.annotation.method.DELETE;
import com.yanxuwen.xretrofit_annotations.annotation.method.DOWNLOAD;
import com.yanxuwen.xretrofit_annotations.annotation.method.FORM;
import com.yanxuwen.xretrofit_annotations.annotation.method.GET;
import com.yanxuwen.xretrofit_annotations.annotation.method.POST;
import com.yanxuwen.xretrofit_annotations.annotation.method.PUT;
import com.yanxuwen.xretrofit_annotations.annotation.method.UPLOAD;
import com.yanxuwen.xretrofit_annotations.annotation.param.Body;
import com.yanxuwen.xretrofit_annotations.annotation.param.FilePath;
import com.yanxuwen.xretrofit_annotations.annotation.param.Header;
import com.yanxuwen.xretrofit_annotations.annotation.param.Param;
import com.yanxuwen.xretrofit_annotations.annotation.param.Path;
import com.yanxuwen.xretrofit_annotations.annotation.param.Query;
import com.yanxuwen.xretrofit_annotations.annotation.service.NetServiceClass;
import com.yanxuwen.xretrofit.bean.HomeInfoV5;
import com.yanxuwen.xretrofit.bean.LoginBuild;

import io.reactivex.Observable;

@NetServiceClass
public interface NetService {
    /**
     * get
     */
    @GET("api/manage-home/v5/home/detail-v2")
    Observable<HomeInfoV5> get(@Query("page") int page, @Query("limit") int limit);

    /**
     * get请求(URL中带有参数)
     */
    @GET("api/manage-home/v5/home/{version}")
    Call<HomeInfoV5> get(@Path("version") String version, @Query("page") int page, @Query("limit") int limit);

    /**
     * 表单提交
     */
    @FORM
    @POST("https://bx-uat.bisinuolan.cn/api/login/mobile")
    Call<String> postForm(@Param("mobile") String mobile, @Param("sms_code") String sms_code);

    /**
     * json提交
     */
    @POST("https://bx-co-uat-appgateway.bsnlco.com/api/customer/v1/open/user/level/my")
    Call<String> postJson(@Param("userId") String userId);

    /**
     * json 整串提交
     */
    @POST("https://bx-co-uat-appgateway.bsnlco.com/api/customer/v1/open/user/level/my")
    Call<String> postJson2(@Body String json);

    /**
     * json 实体类提交
     */
    @POST("https://bx-co-uat-appgateway.bsnlco.com/api/customer/v1/open/user/level/my")
    Call<String> postJson(@Body LoginBuild json);

    /**
     * put 提交
     */
    @PUT("http://api.sdwhcn.com:5056/v1/member")
    Call<String> put(@Header("Authorization") String header, @Query("nickname") String nickname, @Query("signature") String signature, @Query("area") String area);

    /**
     * delete 提交
     */
    @DELETE("http://api.sdwhcn.com:5056/v1/member_collect_article/{id}")
    Call<String> delete(@Header("Authorization") String header, @Path("id") String id);

    /**
     *
     */
    @DOWNLOAD("https://ztjyupdate.ztjy61.com/333897c77ec9a86605006679c7a4b418-ZTJY")
    ProgressCall<String> download(@FilePath String file);

    /**
     * 多图上传
     */
    @UPLOAD("https://bxuatapi.bisinuolan.cn/api/bsnl-oss/appUploadShot")
    ProgressCall<String> upload(@FilePath String file, @Param("shot") boolean shot);

}

================================================
FILE: XRetrofit/app/src/main/res/drawable/ic_launcher_background.xml
================================================
<?xml version="1.0" encoding="utf-8"?>
<vector xmlns:android="http://schemas.android.com/apk/res/android"
    android:width="108dp"
    android:height="108dp"
    android:viewportWidth="108"
    android:viewportHeight="108">
    <path
        android:fillColor="#008577"
        android:pathData="M0,0h108v108h-108z" />
    <path
        android:fillColor="#00000000"
        android:pathData="M9,0L9,108"
        android:strokeWidth="0.8"
        android:strokeColor="#33FFFFFF" />
    <path
        android:fillColor="#00000000"
        android:pathData="M19,0L19,108"
        android:strokeWidth="0.8"
        android:strokeColor="#33FFFFFF" />
    <path
        android:fillColor="#00000000"
        android:pathData="M29,0L29,108"
        android:strokeWidth="0.8"
        android:strokeColor="#33FFFFFF" />
    <path
        android:fillColor="#00000000"
        android:pathData="M39,0L39,108"
        android:strokeWidth="0.8"
        android:strokeColor="#33FFFFFF" />
    <path
        android:fillColor="#00000000"
        android:pathData="M49,0L49,108"
        android:strokeWidth="0.8"
        android:strokeColor="#33FFFFFF" />
    <path
        android:fillColor="#00000000"
        android:pathData="M59,0L59,108"
        android:strokeWidth="0.8"
        android:strokeColor="#33FFFFFF" />
    <path
        android:fillColor="#00000000"
        android:pathData="M69,0L69,108"
        android:strokeWidth="0.8"
        android:strokeColor="#33FFFFFF" />
    <path
        android:fillColor="#00000000"
        android:pathData="M79,0L79,108"
        android:strokeWidth="0.8"
        android:strokeColor="#33FFFFFF" />
    <path
        android:fillColor="#00000000"
        android:pathData="M89,0L89,108"
        android:strokeWidth="0.8"
        android:strokeColor="#33FFFFFF" />
    <path
        android:fillColor="#00000000"
        android:pathData="M99,0L99,108"
        android:strokeWidth="0.8"
        android:strokeColor="#33FFFFFF" />
    <path
        android:fillColor="#00000000"
        android:pathData="M0,9L108,9"
        android:strokeWidth="0.8"
        android:strokeColor="#33FFFFFF" />
    <path
        android:fillColor="#00000000"
        android:pathData="M0,19L108,19"
        android:strokeWidth="0.8"
        android:strokeColor="#33FFFFFF" />
    <path
        android:fillColor="#00000000"
        android:pathData="M0,29L108,29"
        android:strokeWidth="0.8"
        android:strokeColor="#33FFFFFF" />
    <path
        android:fillColor="#00000000"
        android:pathData="M0,39L108,39"
        android:strokeWidth="0.8"
        android:strokeColor="#33FFFFFF" />
    <path
        android:fillColor="#00000000"
        android:pathData="M0,49L108,49"
        android:strokeWidth="0.8"
        android:strokeColor="#33FFFFFF" />
    <path
        android:fillColor="#00000000"
        android:pathData="M0,59L108,59"
        android:strokeWidth="0.8"
        android:strokeColor="#33FFFFFF" />
    <path
        android:fillColor="#00000000"
        android:pathData="M0,69L108,69"
        android:strokeWidth="0.8"
        android:strokeColor="#33FFFFFF" />
    <path
        android:fillColor="#00000000"
        android:pathData="M0,79L108,79"
        android:strokeWidth="0.8"
        android:strokeColor="#33FFFFFF" />
    <path
        android:fillColor="#00000000"
        android:pathData="M0,89L108,89"
        android:strokeWidth="0.8"
        android:strokeColor="#33FFFFFF" />
    <path
        android:fillColor="#00000000"
        android:pathData="M0,99L108,99"
        android:strokeWidth="0.8"
        android:strokeColor="#33FFFFFF" />
    <path
        android:fillColor="#00000000"
        android:pathData="M19,29L89,29"
        android:strokeWidth="0.8"
        android:strokeColor="#33FFFFFF" />
    <path
        android:fillColor="#00000000"
        android:pathData="M19,39L89,39"
        android:strokeWidth="0.8"
        android:strokeColor="#33FFFFFF" />
    <path
        android:fillColor="#00000000"
        android:pathData="M19,49L89,49"
        android:strokeWidth="0.8"
        android:strokeColor="#33FFFFFF" />
    <path
        android:fillColor="#00000000"
        android:pathData="M19,59L89,59"
        android:strokeWidth="0.8"
        android:strokeColor="#33FFFFFF" />
    <path
        android:fillColor="#00000000"
        android:pathData="M19,69L89,69"
        android:strokeWidth="0.8"
        android:strokeColor="#33FFFFFF" />
    <path
        android:fillColor="#00000000"
        android:pathData="M19,79L89,79"
        android:strokeWidth="0.8"
        android:strokeColor="#33FFFFFF" />
    <path
        android:fillColor="#00000000"
        android:pathData="M29,19L29,89"
        android:strokeWidth="0.8"
        android:strokeColor="#33FFFFFF" />
    <path
        android:fillColor="#00000000"
        android:pathData="M39,19L39,89"
        android:strokeWidth="0.8"
        android:strokeColor="#33FFFFFF" />
    <path
        android:fillColor="#00000000"
        android:pathData="M49,19L49,89"
        android:strokeWidth="0.8"
        android:strokeColor="#33FFFFFF" />
    <path
        android:fillColor="#00000000"
        android:pathData="M59,19L59,89"
        android:strokeWidth="0.8"
        android:strokeColor="#33FFFFFF" />
    <path
        android:fillColor="#00000000"
        android:pathData="M69,19L69,89"
        android:strokeWidth="0.8"
        android:strokeColor="#33FFFFFF" />
    <path
        android:fillColor="#00000000"
        android:pathData="M79,19L79,89"
        android:strokeWidth="0.8"
        android:strokeColor="#33FFFFFF" />
</vector>


================================================
FILE: XRetrofit/app/src/main/res/drawable-v24/ic_launcher_foreground.xml
================================================
<vector xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:aapt="http://schemas.android.com/aapt"
    android:width="108dp"
    android:height="108dp"
    android:viewportWidth="108"
    android:viewportHeight="108">
    <path
        android:fillType="evenOdd"
        android:pathData="M32,64C32,64 38.39,52.99 44.13,50.95C51.37,48.37 70.14,49.57 70.14,49.57L108.26,87.69L108,109.01L75.97,107.97L32,64Z"
        android:strokeWidth="1"
        android:strokeColor="#00000000">
        <aapt:attr name="android:fillColor">
            <gradient
                android:endX="78.5885"
                android:endY="90.9159"
                android:startX="48.7653"
                android:startY="61.0927"
                android:type="linear">
                <item
                    android:color="#44000000"
                    android:offset="0.0" />
                <item
                    android:color="#00000000"
                    android:offset="1.0" />
            </gradient>
        </aapt:attr>
    </path>
    <path
        android:fillColor="#FFFFFF"
        android:fillType="nonZero"
        android:pathData="M66.94,46.02L66.94,46.02C72.44,50.07 76,56.61 76,64L32,64C32,56.61 35.56,50.11 40.98,46.06L36.18,41.19C35.45,40.45 35.45,39.3 36.18,38.56C36.91,37.81 38.05,37.81 38.78,38.56L44.25,44.05C47.18,42.57 50.48,41.71 54,41.71C57.48,41.71 60.78,42.57 63.68,44.05L69.11,38.56C69.84,37.81 70.98,37.81 71.71,38.56C72.44,39.3 72.44,40.45 71.71,41.19L66.94,46.02ZM62.94,56.92C64.08,56.92 65,56.01 65,54.88C65,53.76 64.08,52.85 62.94,52.85C61.8,52.85 60.88,53.76 60.88,54.88C60.88,56.01 61.8,56.92 62.94,56.92ZM45.06,56.92C46.2,56.92 47.13,56.01 47.13,54.88C47.13,53.76 46.2,52.85 45.06,52.85C43.92,52.85 43,53.76 43,54.88C43,56.01 43.92,56.92 45.06,56.92Z"
        android:strokeWidth="1"
        android:strokeColor="#00000000" />
</vector>


================================================
FILE: XRetrofit/app/src/main/res/layout/activity_main.xml
================================================
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:id="@+id/activity_main"
    android:orientation="vertical"
    android:layout_width="match_parent"
    android:layout_height="match_parent">
    <Button
        android:id="@+id/tv_get"
        android:layout_centerInParent="true"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="get请求"
        android:onClick="onGet"
        />
    <Button
        android:layout_centerInParent="true"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="get请求(URL中带有参数)"
        android:onClick="onGet2"
        />
    <Button
        android:layout_centerInParent="true"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="post表单提交"
        android:onClick="postForm"
        />
    <Button
        android:layout_centerInParent="true"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="json提交"
        android:onClick="postJson"
        />
    <Button
        android:layout_centerInParent="true"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="json 整串提交"
        android:onClick="postJson2"
        />
    <Button
        android:layout_centerInParent="true"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="json 实体类提交"
        android:onClick="postJson3"
        />
    <Button
        android:layout_centerInParent="true"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="put 提交"
        android:onClick="onPut"
        />
    <Button
        android:layout_centerInParent="true"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="delete 提交"
        android:onClick="onDelete"
        />
    <Button
        android:layout_centerInParent="true"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="文件下载"
        android:onClick="onDownload"
        />
    <Button
        android:layout_centerInParent="true"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="文件上传"
        android:onClick="onUpload"
        />
</LinearLayout>


================================================
FILE: XRetrofit/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml
================================================
<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
    <background android:drawable="@drawable/ic_launcher_background" />
    <foreground android:drawable="@drawable/ic_launcher_foreground" />
</adaptive-icon>

================================================
FILE: XRetrofit/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml
================================================
<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
    <background android:drawable="@drawable/ic_launcher_background" />
    <foreground android:drawable="@drawable/ic_launcher_foreground" />
</adaptive-icon>

================================================
FILE: XRetrofit/app/src/main/res/values/colors.xml
================================================
<?xml version="1.0" encoding="utf-8"?>
<resources>
    <color name="colorPrimary">#008577</color>
    <color name="colorPrimaryDark">#00574B</color>
    <color name="colorAccent">#D81B60</color>
</resources>


================================================
FILE: XRetrofit/app/src/main/res/values/strings.xml
================================================
<resources>
    <string name="app_name">XRetrofit</string>
</resources>


================================================
FILE: XRetrofit/app/src/main/res/values/styles.xml
================================================
<resources>

    <!-- Base application theme. -->
    <style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
        <!-- Customize your theme here. -->
        <item name="colorPrimary">@color/colorPrimary</item>
        <item name="colorPrimaryDark">@color/colorPrimaryDark</item>
        <item name="colorAccent">@color/colorAccent</item>
    </style>

</resources>


================================================
FILE: XRetrofit/app/src/main/res/xml/network_security_config.xml
================================================
<?xml version="1.0" encoding="utf-8"?>
<!--解决安卓P 没有使用https的话会报 CLEARTEXT communication to api.sdwhcn.com not permitted by network security policy-->
<network-security-config>
    <base-config cleartextTrafficPermitted="true" />
</network-security-config>

================================================
FILE: XRetrofit/bintray.gradle
================================================
// backup of [https://raw.githubusercontent.com/nuuneoi/JCenter/master/bintrayv1.gradle]

apply plugin: 'com.jfrog.bintray'

version = libraryVersion

if (project.hasProperty("android")) { // Android libraries
    task sourcesJar(type: Jar) {
        classifier = 'sources'
        from android.sourceSets.main.java.srcDirs
    }

    task javadoc(type: Javadoc) {
        source = android.sourceSets.main.java.srcDirs
        classpath += project.files(android.getBootClasspath().join(File.pathSeparator))
    }
} else { // Java libraries
    task sourcesJar(type: Jar, dependsOn: classes) {
        classifier = 'sources'
        from sourceSets.main.allSource
    }
}

task javadocJar(type: Jar, dependsOn: javadoc) {
    classifier = 'javadoc'
    from javadoc.destinationDir
}

artifacts {
    archives javadocJar
    archives sourcesJar
}

javadoc {
    failOnError false
    options {
        encoding "UTF-8"
        charSet 'UTF-8'
        author true
        version true
        links "http://docs.oracle.com/javase/7/docs/api"
    }
}

// Bintray
Properties properties = new Properties()
properties.load(project.rootProject.file('local.properties').newDataInputStream())

bintray {
    user = properties.getProperty("bintray.user")
    key = properties.getProperty("bintray.apikey")

    configurations = ['archives']
    pkg {
        repo = "maven"
        name = bintrayName
        desc = libraryDescription
        websiteUrl = siteUrl
        vcsUrl = gitUrl
        licenses = ["Apache-2.0"]
        publish = true
        publicDownloadNumbers = true
        version {
            desc = libraryDescription
            gpg {
                sign = true //Determines whether to GPG sign the files. The default is false
                passphrase = properties.getProperty("bintray.gpg.password")
                //Optional. The passphrase for GPG signing'
            }
        }
    }
}

================================================
FILE: XRetrofit/build.gradle
================================================
// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
    apply from: 'versions.gradle'
    repositories {
        maven { url 'http://maven.aliyun.com/nexus/content/groups/public/' }
        jcenter()
        google()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.6.0'
        classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.7.3'
        classpath 'com.github.dcendents:android-maven-gradle-plugin:2.1'
    }

}

allprojects {
    repositories {
        maven { url 'http://maven.aliyun.com/nexus/content/groups/public/' }
        maven { url 'https://jitpack.io' }
        jcenter()
        google()
    }
}
task clean(type: Delete) {
    delete rootProject.buildDir
}

================================================
FILE: XRetrofit/compiler/.gitignore
================================================
/build


================================================
FILE: XRetrofit/compiler/build.gradle
================================================
apply plugin: 'java'
ext {
    bintrayName = 'compiler'
    artifact = bintrayName
    libraryName = 'xretrofit compiler'
    libraryDescription = 'this is a  xretrofit-compiler'
    libraryVersion = main_version
}
compileJava {
    sourceCompatibility = '1.8'
    targetCompatibility = '1.8'
}

dependencies {
    implementation 'com.google.auto.service:auto-service:1.0-rc6'
    annotationProcessor 'com.google.auto.service:auto-service:1.0-rc6'

    implementation 'com.squareup:javapoet:1.10.0'

    implementation project(path: ':annotations')
}

//apply from: '../install.gradle'
//apply from: '../bintray.gradle'
apply from: '../jitpack.gradle'


================================================
FILE: XRetrofit/compiler/src/main/java/com/xretrofit/compiler/ElementUtils.java
================================================
package com.xretrofit.compiler;

/**
 * 这个类改版的话,HttpManager里面的getImplName 也需要改变
 */
@SuppressWarnings("unchecked")
public class ElementUtils {
    public static String packageName = "com.http";

    public static String getImplName(Class<?> clazz) {
        return packageName + "." + clazz.getSimpleName() + "$Impl";
    }
}


================================================
FILE: XRetrofit/compiler/src/main/java/com/xretrofit/compiler/HttpServiceProcessor2.java
================================================
package com.xretrofit.compiler;

import com.google.auto.service.AutoService;
import com.xretrofit.compiler.create.CreateClassUtils;
import com.squareup.javapoet.JavaFile;
import com.yanxuwen.xretrofit_annotations.annotation.service.NetServiceClass;

import java.util.HashMap;
import java.util.HashSet;
import java.util.LinkedHashSet;
import java.util.Map;
import java.util.Set;

import javax.annotation.processing.AbstractProcessor;
import javax.annotation.processing.Filer;
import javax.annotation.processing.Messager;
import javax.annotation.processing.ProcessingEnvironment;
import javax.annotation.processing.Processor;
import javax.annotation.processing.RoundEnvironment;
import javax.lang.model.SourceVersion;
import javax.lang.model.element.Element;
import javax.lang.model.element.ElementKind;
import javax.lang.model.element.PackageElement;
import javax.lang.model.element.TypeElement;
import javax.lang.model.util.Elements;
import javax.tools.Diagnostic;

/**
 * @author bsnl_yanxuwen
 * @date 2021/1/28 15:49
 * Description :
 */
@AutoService(Processor.class)
public class HttpServiceProcessor2 extends AbstractProcessor {

    private Messager mMessager;//可以用来打印一些信息
    private Elements mElementUtils;
    private Filer mFiler;//生成java源码
    private Map<String, CreateClassUtils> mapClass = new HashMap<>();

    @Override
    public synchronized void init(ProcessingEnvironment processingEnv) {
        super.init(processingEnv);
        mMessager = processingEnv.getMessager();
        mElementUtils = processingEnv.getElementUtils();
        mFiler = processingEnv.getFiler();
    }

    /**
     * 指定注解
     */
    @Override
    public Set<String> getSupportedAnnotationTypes() {
        HashSet<String> supportTypes = new LinkedHashSet<>();
        supportTypes.add(NetServiceClass.class.getCanonicalName());
        return supportTypes;
    }

    /**
     * 用来指定你使用的Java版本
     */
    @Override
    public SourceVersion getSupportedSourceVersion() {
        return SourceVersion.latestSupported();
    }



    @Override
    public boolean process(Set<? extends TypeElement> annotations, RoundEnvironment roundEnv) {
        mMessager.printMessage(Diagnostic.Kind.NOTE, "processing...");

        //step1:得到所有的注解
        Set<? extends Element> elements = roundEnv.getElementsAnnotatedWith(NetServiceClass.class);
        if (elements == null || elements.isEmpty()) {
            mMessager.printMessage(Diagnostic.Kind.NOTE, "elements is null");
            return true;
        }
        for (Element element : elements) {
            if (element.getKind() != ElementKind.INTERFACE) {
                continue;
            }
            TypeElement classElement = (TypeElement) element;

            CreateClassUtils creatorUtils = mapClass.get(getKey(classElement));
            if (creatorUtils == null) {
                creatorUtils = new CreateClassUtils(mElementUtils, classElement);
            }
            mapClass.put(getKey(classElement), creatorUtils);
        }

//        //step3:创建DataCallBack
//        ClassCallBackUtils backUtils = new ClassCallBackUtils(mElementUtils);
//        //创建文件
//        try {
//            JavaFile javaFile = JavaFile.builder(ElementUtils.packageName, backUtils.generateJavaCode()).build();
//            javaFile.writeTo(processingEnv.getFiler());
//        } catch (IOException e) {
//            e.printStackTrace();
//        }

        //step3:遍历存储的类信息,创建java文件
        for (String key : mapClass.keySet()) {
            CreateClassUtils creatorUtils = mapClass.get(key);
            try {
                //创建文件
                JavaFile javaFile = JavaFile.builder(ElementUtils.packageName, creatorUtils.generateJavaCode()).build();
                javaFile.writeTo(processingEnv.getFiler());

            } catch (Exception e) {
                e.printStackTrace();
            }

        }
        return true;
    }

    /**
     * 根据类元素获取 key
     * 包名 + 类名
     */
    public String getKey(TypeElement classElement) {
        if (mElementUtils == null) {
            return "";
        }
        PackageElement packageElement = mElementUtils.getPackageOf(classElement);
        String packageName = packageElement.getQualifiedName().toString();
        String className = classElement.getSimpleName().toString();
        return packageName + "." + className;
    }
}


================================================
FILE: XRetrofit/compiler/src/main/java/com/xretrofit/compiler/create/CreateClassUtils.java
================================================
package com.xretrofit.compiler.create;

import com.squareup.javapoet.ClassName;
import com.squareup.javapoet.FieldSpec;
import com.squareup.javapoet.MethodSpec;
import com.squareup.javapoet.ParameterSpec;
import com.squareup.javapoet.TypeName;
import com.squareup.javapoet.TypeSpec;
import com.yanxuwen.xretrofit_annotations.annotation.service.NetServiceClass;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;

import javax.lang.model.element.AnnotationMirror;
import javax.lang.model.element.AnnotationValue;
import javax.lang.model.element.Element;
import javax.lang.model.element.ElementKind;
import javax.lang.model.element.ExecutableElement;
import javax.lang.model.element.Modifier;
import javax.lang.model.element.PackageElement;
import javax.lang.model.element.TypeElement;
import javax.lang.model.element.VariableElement;
import javax.lang.model.type.TypeKind;
import javax.lang.model.util.Elements;

/**
 * @author bsnl_yanxuwen
 * @date 2021/1/28 15:51
 * Description :
 */
public class CreateClassUtils {
    private String mBindingClassName;
    private String mClassName;
    private String mPackageName;
    private TypeElement mTypeElement;
    private final String packagename_api = "com.xretrofit.api";
    private final String packagename_bean = "com.xretrofit.bean";
    private final String packagename_utils = "com.xretrofit.utils";
    private final String packagename_method = "com.xretrofit.method";
    private Elements elementUtils;

    public CreateClassUtils(Elements elementUtils, TypeElement classElement) {
        this.mTypeElement = classElement;
        this.elementUtils = elementUtils;
        PackageElement packageElement = elementUtils.getPackageOf(mTypeElement);
        String packageName = packageElement.getQualifiedName().toString();
        String className = mTypeElement.getSimpleName().toString();
        this.mPackageName = packageName;
        this.mClassName = className;
        this.mBindingClassName = className + "$Impl";
    }


    /**
     * 创建Java代码
     *
     * @return
     */
    public TypeSpec generateJavaCode() {

        ClassName className = ClassName.get(mPackageName, mClassName);

        NetServiceClass service = (NetServiceClass) mTypeElement.getAnnotation(NetServiceClass.class);
        FieldSpec baseUrl = FieldSpec.builder(String.class, "baseUrl", Modifier.PRIVATE)
                .initializer(service != null ? "\"" + service.value() + "\"" : " null ").build();

        TypeSpec bindingClass = TypeSpec.classBuilder(mBindingClassName)
                .addModifiers(Modifier.PUBLIC)
                .addSuperinterface(className)
                .addField(baseUrl)//添加baseUrl变量
                .addMethods(addMethod())//添加方法
                .build();
        return bindingClass;

    }


    /**
     * 循环添加方法
     */
    private List<MethodSpec> addMethod() {
        List<MethodSpec> list = new ArrayList<>();
        //获取元素集合
        List<? extends Element> listType = mTypeElement.getEnclosedElements();
        if (listType == null || listType.isEmpty()) {
            return list;
        }
        for (Element element : listType) {
            if (element.getKind() != ElementKind.METHOD) {
                continue;
            }
            ExecutableElement executableElement = (ExecutableElement) element;
            String methodName = element.getSimpleName().toString();


            MethodSpec.Builder methodSpec = MethodSpec.methodBuilder(methodName)
                    .addModifiers(Modifier.PUBLIC)
                    .returns(TypeName.get(executableElement.getReturnType()))
                    .addParameters(addParameters(executableElement));
            addStatement(methodSpec, executableElement);//判断是否含有Query的注解,则添加
            list.add(methodSpec.build());
        }
        return list;
    }

    /**
     * 循环添加参数
     */
    private List<ParameterSpec> addParameters(ExecutableElement executableElement) {
        List<ParameterSpec> list = new ArrayList<>();

        //获取元素集合
        List<? extends VariableElement> listType = executableElement.getParameters();
        if (listType == null || listType.isEmpty()) {
            return list;
        }

        for (VariableElement variableElement : listType) {
            String name = variableElement.getSimpleName().toString();
            TypeName typeName = TypeName.get(variableElement.asType());
            ParameterSpec parameterSpec = ParameterSpec.builder(typeName, name)
//                .addAnnotation(nullable)//注解参数
                    .build();
            list.add(parameterSpec);
        }
        return list;
    }


    /**
     * 添加代码
     */
    private void addStatement(MethodSpec.Builder builder, ExecutableElement executableElement) {

        ClassName ServiceMethod = ClassName.get(packagename_method, "ServiceMethod");
        ClassName MethodAnnotation = ClassName.get(packagename_method, "MethodAnnotation");
        ClassName ParamAnnotation = ClassName.get(packagename_method, "ParamAnnotation");
        ClassName HashMap = ClassName.get("java.util", "HashMap");

        ClassName List = ClassName.get("java.util", "List");
        ClassName ArrayList = ClassName.get("java.util", "ArrayList");
        ClassName Object = ClassName.get("java.lang", "Object");
        builder.addStatement("$T<Class, $T> mapMa= new $T<>()", HashMap, MethodAnnotation, HashMap);
        //获取方法注解
        int numM = 0;
        for (AnnotationMirror annotationMirror : executableElement.getAnnotationMirrors()) {
            Class annotationClass = null;
            try {
                annotationClass = Class.forName(annotationMirror.getAnnotationType().toString());
            } catch (ClassNotFoundException e) {
                e.printStackTrace();
            }
            boolean isValue = false;
            builder.addStatement("$T<$T> list_ma_$N = new $T<>()", List, Object, String.valueOf(numM), ArrayList);
            for (Map.Entry<? extends ExecutableElement, ? extends AnnotationValue> entry : annotationMirror.getElementValues().entrySet()) {
                isValue = true;
                //如果注解里面是数组,如@Headers
                if (entry.getValue().getValue() instanceof List) {
                    for (int i = 0; i < ((List) entry.getValue().getValue()).size(); i++) {
                        builder.addStatement("list_ma_$N.add($N)", String.valueOf(numM), String.valueOf(((List) entry.getValue().getValue()).get(i)));
                    }
                } else {
                    builder.addStatement("list_ma_$N.add($N)", String.valueOf(numM), String.valueOf(entry.getValue()));
                }
            }
            builder.addStatement("mapMa.put($N.class,new $T($N.class,$N))", annotationClass.getName(), MethodAnnotation, annotationClass.getName(), isValue ? "list_ma_" + numM : "null");
            numM++;
        }
        builder.addCode("\n");

        //参数添加
        builder.addStatement("List<$T> listPA = new $N<>()", ParamAnnotation, String.valueOf(ArrayList));
        int numP = 0;
        //获取参数注解
        List<? extends VariableElement> list = executableElement.getParameters();
        if (list != null) {
            for (VariableElement variableElement : list) {
                for (AnnotationMirror annotationMirror : variableElement.getAnnotationMirrors()) {
                    Class annotationClass = null;
                    try {
                        annotationClass = Class.forName(annotationMirror.getAnnotationType().toString());
                    } catch (ClassNotFoundException e) {
                        e.printStackTrace();
                    }
                    boolean isValue = false;
                    builder.addStatement("List<$T> list_pa_$N = new $N<>()", Object, String.valueOf(numP), String.valueOf(ArrayList));
                    for (Map.Entry<? extends ExecutableElement, ? extends AnnotationValue> entry : annotationMirror.getElementValues().entrySet()) {
                        isValue = true;
                        builder.addStatement("list_pa_$N.add($N)", String.valueOf(numP), String.valueOf(entry.getValue()));
                    }
                    builder.addStatement("listPA.add(new $T($N.class,$N,$N))", ParamAnnotation, annotationClass.getName(),
                            isValue ? "list_pa_" + numP : "null",
                            variableElement.getSimpleName());
                }
                numP++;
            }
        }

        builder.addStatement("$T serviceMethod = new $T()", ServiceMethod, ServiceMethod);

        if (executableElement.getReturnType().getKind() != TypeKind.VOID) {
            ClassName TypeToken = ClassName.get("com.google.common.reflect", "TypeToken");
            builder.addStatement("return serviceMethod.request(mapMa,listPA,new $T<$N>(){}.getType())", TypeToken, String.valueOf(executableElement.getReturnType()));
        } else {
            builder.addStatement("serviceMethod.request(mapMa,listPA,Void.class)");
        }
    }
}


================================================
FILE: XRetrofit/gradle/wrapper/gradle-wrapper.properties
================================================
#Tue Apr 16 17:53:26 CST 2019
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.4-all.zip


================================================
FILE: XRetrofit/gradle.properties
================================================
# Project-wide Gradle settings.
# IDE (e.g. Android Studio) users:
# Gradle settings configured through the IDE *will override*
# any settings specified in this file.
# For more details on how to configure your build environment visit
# http://www.gradle.org/docs/current/userguide/build_environment.html
# Specifies the JVM arguments used for the daemon process.
# The setting is particularly useful for tweaking memory settings.
# When configured, Gradle will run in incubating parallel mode.
# This option should only be used with decoupled projects. More details, visit
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
# org.gradle.parallel=true
org.gradle.daemon=true

bintrayRepo=maven
main_version=0.0.8
publishedGroupId=com.github.yanxuwen
siteUrl=https://github.com/yanxuwen/xretrofit
gitUrl=https://github.com/yanxuwen/xretrofit.git
developerId=yxe
developerName=yanxuwen
developerEmail=420255048@qq.com
android.useAndroidX=true
android.enableJetifier=true


org.gradle.jvmargs=-Xmx2048m -Dfile.encoding=UTF-8

#org.gradle.jvmargs= -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=5005,
#Dorg.gradle.debug=true







================================================
FILE: XRetrofit/gradlew
================================================
#!/usr/bin/env sh

##############################################################################
##
##  Gradle start up script for UN*X
##
##############################################################################

# Attempt to set APP_HOME
# Resolve links: $0 may be a link
PRG="$0"
# Need this for relative symlinks.
while [ -h "$PRG" ] ; do
    ls=`ls -ld "$PRG"`
    link=`expr "$ls" : '.*-> \(.*\)$'`
    if expr "$link" : '/.*' > /dev/null; then
        PRG="$link"
    else
        PRG=`dirname "$PRG"`"/$link"
    fi
done
SAVED="`pwd`"
cd "`dirname \"$PRG\"`/" >/dev/null
APP_HOME="`pwd -P`"
cd "$SAVED" >/dev/null

APP_NAME="Gradle"
APP_BASE_NAME=`basename "$0"`

# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS=""

# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD="maximum"

warn () {
    echo "$*"
}

die () {
    echo
    echo "$*"
    echo
    exit 1
}

# OS specific support (must be 'true' or 'false').
cygwin=false
msys=false
darwin=false
nonstop=false
case "`uname`" in
  CYGWIN* )
    cygwin=true
    ;;
  Darwin* )
    darwin=true
    ;;
  MINGW* )
    msys=true
    ;;
  NONSTOP* )
    nonstop=true
    ;;
esac

CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar

# Determine the Java command to use to start the JVM.
if [ -n "$JAVA_HOME" ] ; then
    if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
        # IBM's JDK on AIX uses strange locations for the executables
        JAVACMD="$JAVA_HOME/jre/sh/java"
    else
        JAVACMD="$JAVA_HOME/bin/java"
    fi
    if [ ! -x "$JAVACMD" ] ; then
        die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME

Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
    fi
else
    JAVACMD="java"
    which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.

Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi

# Increase the maximum file descriptors if we can.
if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
    MAX_FD_LIMIT=`ulimit -H -n`
    if [ $? -eq 0 ] ; then
        if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
            MAX_FD="$MAX_FD_LIMIT"
        fi
        ulimit -n $MAX_FD
        if [ $? -ne 0 ] ; then
            warn "Could not set maximum file descriptor limit: $MAX_FD"
        fi
    else
        warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
    fi
fi

# For Darwin, add options to specify how the application appears in the dock
if $darwin; then
    GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
fi

# For Cygwin, switch paths to Windows format before running java
if $cygwin ; then
    APP_HOME=`cygpath --path --mixed "$APP_HOME"`
    CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
    JAVACMD=`cygpath --unix "$JAVACMD"`

    # We build the pattern for arguments to be converted via cygpath
    ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
    SEP=""
    for dir in $ROOTDIRSRAW ; do
        ROOTDIRS="$ROOTDIRS$SEP$dir"
        SEP="|"
    done
    OURCYGPATTERN="(^($ROOTDIRS))"
    # Add a user-defined pattern to the cygpath arguments
    if [ "$GRADLE_CYGPATTERN" != "" ] ; then
        OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
    fi
    # Now convert the arguments - kludge to limit ourselves to /bin/sh
    i=0
    for arg in "$@" ; do
        CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
        CHECK2=`echo "$arg"|egrep -c "^-"`                                 ### Determine if an option

        if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then                    ### Added a condition
            eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
        else
            eval `echo args$i`="\"$arg\""
        fi
        i=$((i+1))
    done
    case $i in
        (0) set -- ;;
        (1) set -- "$args0" ;;
        (2) set -- "$args0" "$args1" ;;
        (3) set -- "$args0" "$args1" "$args2" ;;
        (4) set -- "$args0" "$args1" "$args2" "$args3" ;;
        (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
        (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
        (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
        (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
        (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
    esac
fi

# Escape application args
save () {
    for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
    echo " "
}
APP_ARGS=$(save "$@")

# Collect all arguments for the java command, following the shell quoting and substitution rules
eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"

# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong
if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then
  cd "$(dirname "$0")"
fi

exec "$JAVACMD" "$@"


================================================
FILE: XRetrofit/gradlew.bat
================================================
@if "%DEBUG%" == "" @echo off
@rem ##########################################################################
@rem
@rem  Gradle startup script for Windows
@rem
@rem ##########################################################################

@rem Set local scope for the variables with windows NT shell
if "%OS%"=="Windows_NT" setlocal

set DIRNAME=%~dp0
if "%DIRNAME%" == "" set DIRNAME=.
set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%

@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
set DEFAULT_JVM_OPTS=

@rem Find java.exe
if defined JAVA_HOME goto findJavaFromJavaHome

set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
if "%ERRORLEVEL%" == "0" goto init

echo.
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.

goto fail

:findJavaFromJavaHome
set JAVA_HOME=%JAVA_HOME:"=%
set JAVA_EXE=%JAVA_HOME%/bin/java.exe

if exist "%JAVA_EXE%" goto init

echo.
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.

goto fail

:init
@rem Get command-line arguments, handling Windows variants

if not "%OS%" == "Windows_NT" goto win9xME_args

:win9xME_args
@rem Slurp the command line arguments.
set CMD_LINE_ARGS=
set _SKIP=2

:win9xME_args_slurp
if "x%~1" == "x" goto execute

set CMD_LINE_ARGS=%*

:execute
@rem Setup the command line

set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar

@rem Execute Gradle
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%

:end
@rem End local scope for the variables with windows NT shell
if "%ERRORLEVEL%"=="0" goto mainEnd

:fail
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
rem the _cmd.exe /c_ return code!
if  not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
exit /b 1

:mainEnd
if "%OS%"=="Windows_NT" endlocal

:omega


================================================
FILE: XRetrofit/install.gradle
================================================
// backup of [https://raw.githubusercontent.com/nuuneoi/JCenter/master/installv1.gradle]

apply plugin: 'com.github.dcendents.android-maven'

group = publishedGroupId                               // Maven Group ID for the artifact

install {
    repositories.mavenInstaller {
        // This generates POM.xml with proper parameters
        pom {
            project {
                packaging 'aar'
                groupId publishedGroupId
                artifactId artifact

                // Add your description here
                name libraryName
                description libraryDescription
                url siteUrl

                // Set your license
                licenses {
                    license {
                        name 'The Apache Software License, Version 2.0'
                        url 'http://www.apache.org/licenses/LICENSE-2.0.txt'
                    }
                }
                developers {
                    developer {
                        id developerId
                        name developerName
                        email developerEmail
                    }
                }
                scm {
                    connection gitUrl
                    developerConnection gitUrl
                    url siteUrl

                }
            }
        }
    }
}

================================================
FILE: XRetrofit/jitpack.gradle
================================================
apply plugin: 'com.github.dcendents.android-maven'

group = 'com.github.yanxuwen'


================================================
FILE: XRetrofit/settings.gradle
================================================
include ':annotations'
include ':app', ':xretrofit', ':compiler'


================================================
FILE: XRetrofit/versions.gradle
================================================
/**
 * Shared file between builds so that they can all use the same dependencies and
 * maven repositories.
 **/
ext.deps = [:]
ext.support_version = '23.1.1'
ext.kotlin_version = '1.3.0'
ext.anko_version = '0.8.2'
ext.butterknife_version = '8.8.1'

def build_versions = [:]
build_versions.min_sdk = 16
build_versions.target_sdk = 28
build_versions.build_tools = "28.0.3"
ext.build_versions = build_versions

def versions = [:]
versions.support = "28.0.0"

def support = [:]
support.app_compat = "androidx.appcompat:appcompat:1.0.0"
support.design = "com.google.android.material:material:1.0.0"
support.recyclerview = "androidx.recyclerview:recyclerview:1.0.0"
support.constraintlayout = 'androidx.constraintlayout:constraintlayout:1.1.3'
ext.support = support

def other = [:]
other.okhttp = 'com.squareup.okhttp3:okhttp:4.1.0'
other.fastjson = 'com.alibaba:fastjson:1.2.57'
other.rxpermissions = 'com.github.tbruyelle:rxpermissions:0.10.2'
other.rxandroid = 'io.reactivex.rxjava2:rxandroid:2.1.1'
other.rxjava = 'io.reactivex.rxjava2:rxjava:2.2.19'
other.autoDispose = 'com.uber.autodispose:autodispose-android-archcomponents:1.0.0-RC2'
other.guava = 'com.google.guava:guava:27.0.1-jre'

ext.other = other




================================================
FILE: XRetrofit/xretrofit/.gitignore
================================================
/build


================================================
FILE: XRetrofit/xretrofit/build.gradle
================================================
apply plugin: 'com.android.library'
ext {
    bintrayName = 'xretrofit'
    artifact = bintrayName
    libraryName = 'xretrofit api'
    libraryDescription = 'xretrofit'
    libraryVersion = main_version
}

android {
    compileSdkVersion 28
    buildToolsVersion "28.0.3"
    defaultConfig {
        minSdkVersion 15
        targetSdkVersion 28
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
        javaCompileOptions {
            annotationProcessorOptions {
                includeCompileClasspath true
            }
        }
        buildTypes {
            release {
                minifyEnabled false
                proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
            }
        }
    }
}
dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    api other.okhttp
    api other.guava
    api project(path: ':annotations')
}

//apply from: '../install.gradle'
//apply from: '../bintray.gradle'
apply from: '../jitpack.gradle'


================================================
FILE: XRetrofit/xretrofit/proguard-rules.pro
================================================
# Add project specific ProGuard rules here.
# You can control the set of applied configuration files using the
# proguardFiles setting in build.gradle.
#
# For more details, see
#   http://developer.android.com/guide/developing/tools/proguard.html

# If your project uses WebView with JS, uncomment the following
# and specify the fully qualified class name to the JavaScript interface
# class:
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
#   public *;
#}

# Uncomment this to preserve the line number information for
# debugging stack traces.
#-keepattributes SourceFile,LineNumberTable

# If you keep the line number information, uncomment this to
# hide the original source file name.
#-renamesourcefileattribute SourceFile


================================================
FILE: XRetrofit/xretrofit/src/main/AndroidManifest.xml
================================================
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.xretrofit" >

    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
</manifest>


================================================
FILE: XRetrofit/xretrofit/src/main/java/com/xretrofit/CallAdapter/CallAdapter.java
================================================
package com.xretrofit.CallAdapter;

import com.xretrofit.call.Call;
import com.xretrofit.utils.Utils;

import org.jetbrains.annotations.Nullable;

import java.lang.reflect.Type;

/**
 * @author bsnl_yanxuwen
 * @date 2021/2/4 16:02
 * Description :
 * 适配器
 *
 * R  为  封装后的类型。
 * T  为接口返回类型
 */
public interface CallAdapter<R, T>{
    R adapt(Call<T> call);

    /**
     * 接口数据 类型
     */
    Type responseType();

    abstract class Factory {
        /**
         * 封装转换器,如封装Observable
         */
        public abstract @Nullable CallAdapter<?, ?> get(Type returnType);

        protected static Class<?> getRawType(Type type) {
            return Utils.getRawType(type);
        }
    }
}


================================================
FILE: XRetrofit/xretrofit/src/main/java/com/xretrofit/CallAdapter/MCallAdapter.java
================================================
package com.xretrofit.CallAdapter;

import com.xretrofit.call.Call;

import java.lang.reflect.Type;

/**
 * @author bsnl_yanxuwen
 * @date 2021/2/4 17:49
 * Description :
 * 返回类型为Call<> 的适配器
 */
public class MCallAdapter<T> implements CallAdapter<Call,T> {

    private Type responseType;

    protected MCallAdapter(Type responseType){
        this.responseType = responseType;
    }


    @Override
    public Type responseType() {
        return responseType;
    }


    @Override
    public Call adapt(Call<T> call) {
        return call;
    }

}


================================================
FILE: XRetrofit/xretrofit/src/main/java/com/xretrofit/CallAdapter/ObjectCallAdapter.java
================================================
package com.xretrofit.CallAdapter;

import com.xretrofit.call.Call;

import java.lang.reflect.Type;

/**
 * @author bsnl_yanxuwen
 * @date 2021/2/4 17:49
 * Description :
 * 同步
 * Object 适配器,
 */
public class ObjectCallAdapter<T> implements CallAdapter<Object,T> {

    private Type responseType;

    protected ObjectCallAdapter(Type responseType){
        this.responseType = responseType;
    }

    @Override
    public Type responseType() {
        return responseType;
    }

    @Override
    public Object adapt(Call call) {
        try {
            return call.execute().body();
        } catch (Exception e) {
            return null;
        }
    }

}


================================================
FILE: XRetrofit/xretrofit/src/main/java/com/xretrofit/CallAdapter/ObjectCallAdapterFactory.java
================================================
package com.xretrofit.CallAdapter;

import com.xretrofit.call.Call;
import com.xretrofit.call.ProgressCall;
import com.xretrofit.utils.Utils;

import org.jetbrains.annotations.Nullable;

import java.lang.reflect.Type;

/**
 * @author bsnl_yanxuwen
 * @date 2021/2/4 17:47
 * Description :
 * 适配器Factory
 */
public class ObjectCallAdapterFactory extends CallAdapter.Factory {

    public static ObjectCallAdapterFactory create() {
        return new ObjectCallAdapterFactory();
    }


    @Nullable
    @Override
    public CallAdapter<?, ?> get(Type returnType) {
        Class<?> rawType = getRawType(returnType);
        final Type responseType = Utils.getCallResponseType(returnType);
        if (rawType == ProgressCall.class) {
            return new ProgressCallAdapter(responseType);
        } else if (rawType == Call.class) {
            return new MCallAdapter<>(responseType);
        }
        return new ObjectCallAdapter(responseType);
    }
}


================================================
FILE: XRetrofit/xretrofit/src/main/java/com/xretrofit/CallAdapter/ProgressCallAdapter.java
================================================
package com.xretrofit.CallAdapter;

import com.xretrofit.call.Call;
import com.xretrofit.call.ProgressCall;

import java.lang.reflect.Type;

/**
 * @author bsnl_yanxuwen
 * @date 2021/2/4 17:49
 * Description :
 * 返回类型为{@link ProgressCall<> 的适配器  带进度的
 */
public class ProgressCallAdapter<T> implements CallAdapter<ProgressCall,T> {

    private Type responseType;

    protected ProgressCallAdapter(Type responseType){
        this.responseType = responseType;
    }

    @Override
    public ProgressCall adapt(Call<T> call) {
        if (call != null){
            return (ProgressCall) call;
        }
        return null;
    }

    @Override
    public Type responseType() {
        return responseType;
    }



}


================================================
FILE: XRetrofit/xretrofit/src/main/java/com/xretrofit/HttpException.java
================================================
/*
 * Copyright (C) 2016 Square, Inc.
 *
 * 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
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.xretrofit;


import static com.xretrofit.utils.Utils.checkNotNull;

/** Exception for an unexpected, non-2xx HTTP response. */
public class HttpException extends RuntimeException {
    private static String getMessage(Response<?> response) {
        checkNotNull(response, "response == null");
        return "HTTP " + response.code() + " " + response.message();
    }

    private final int code;
    private final String message;
    private final transient Response<?> response;

    public HttpException(Response<?> response) {
        super(getMessage(response));
        this.code = response.code();
        this.message = response.message();
        this.response = response;
    }

    /** HTTP status code. */
    public int code() {
        return code;
    }

    /** HTTP status message. */
    public String message() {
        return message;
    }

    /**
     * The full HTTP response. This may be null if the exception was serialized.
     */
    public Response<?> response() {
        return response;
    }
}


================================================
FILE: XRetrofit/xretrofit/src/main/java/com/xretrofit/HttpManager.java
================================================
package com.xretrofit;

import com.xretrofit.CallAdapter.CallAdapter;
import com.xretrofit.CallAdapter.ObjectCallAdapterFactory;
import com.xretrofit.converter.Converter;
import com.xretrofit.converter.DownloadConverterFactories;
import com.xretrofit.converter.StringConverterFactories;
import com.xretrofit.okhttp.SslUtils;

import org.jetbrains.annotations.Nullable;

import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.TimeUnit;

import okhttp3.Call;
import okhttp3.Interceptor;
import okhttp3.OkHttpClient;

import static com.xretrofit.utils.Utils.checkNotNull;

/**
 * @author bsnl_yanxuwen
 * @date 2021/2/4 14:00
 * Description :
 * 配置
 */
public final class HttpManager {
    private static volatile HttpManager instance;
    public List<Converter.Factory> converterFactories = new ArrayList<>();
    public List<CallAdapter.Factory> callAdapterFactories = new ArrayList<>();
    public String baseUrl;
    okhttp3.Call.Factory callFactory;

    public static HttpManager getInstance() {
        if (instance == null) {
            synchronized (HttpManager.class) {
                if (instance == null) {
                    instance = new HttpManager();
                }
            }
        }

        return instance;
    }

    HttpManager() {

    }

    public okhttp3.Call.Factory callFactory() {
        if (callFactory == null) {
            return callFactory = getOkHttpClient();
        }
        return callFactory;

    }

    /**
     * 文件下载用的,不能跟其他共享,避免其他错误。
     */
    public OkHttpClient getOkHttpDownloadClient(Interceptor interceptor) {
        OkHttpClient client = new OkHttpClient
                .Builder()
                .connectTimeout(15, TimeUnit.SECONDS)//连接超时时间
                .readTimeout(15, TimeUnit.SECONDS)//读取超时时间
                .writeTimeout(15, TimeUnit.SECONDS)//写入超时时间
                .retryOnConnectionFailure(false)//连接不上是否重连,false不重连
                .sslSocketFactory(SslUtils.getSslSocketFactory().sSLSocketFactory, SslUtils.getSslSocketFactory().trustManager)
                .addNetworkInterceptor(interceptor)
                .build();
        return client;
    }

    /**
     * 默认OkHttpClient
     */
    public OkHttpClient getOkHttpClient() {
        OkHttpClient client = new OkHttpClient
                .Builder()
                .connectTimeout(15, TimeUnit.SECONDS)//连接超时时间
                .readTimeout(15, TimeUnit.SECONDS)//读取超时时间
                .writeTimeout(15, TimeUnit.SECONDS)//写入超时时间
                .retryOnConnectionFailure(false)//连接不上是否重连,false不重连
                .sslSocketFactory(SslUtils.getSslSocketFactory().sSLSocketFactory, SslUtils.getSslSocketFactory().trustManager)
                .build();
        return client;
    }

    void setData(@Nullable Call.Factory callFactory, String baseUrl,
                 List<Converter.Factory> converterFactories,
                 List<CallAdapter.Factory> callAdapterFactories) {

        //默认添加一个字符串转换器、下载转换器
        converterFactories.add(0, DownloadConverterFactories.create());
        converterFactories.add(StringConverterFactories.create());

        //添加适配器
        callAdapterFactories.add(ObjectCallAdapterFactory.create());

        this.baseUrl = baseUrl;
        this.converterFactories = converterFactories;
        this.callAdapterFactories = callAdapterFactories;
        this.callFactory = callFactory;

    }

    public static Builder Builder() {
        return new Builder();
    }

    public static final class Builder {
        private List<Converter.Factory> converterFactories = new ArrayList<>();
        private List<CallAdapter.Factory> callAdapterFactories = new ArrayList<>();
        private String baseUrl;
        private @Nullable
        okhttp3.Call.Factory callFactory;

        public Builder() {
        }

        public Builder baseUrl(String baseUrl) {
            this.baseUrl = checkNotNull(baseUrl, "baseUrl == null");
            return this;
        }

        public Builder addConverterFactory(Converter.Factory factory) {
            converterFactories.add(checkNotNull(factory, "factory == null"));
            return this;
        }

        public Builder addCallAdapterFactory(CallAdapter.Factory factory) {
            callAdapterFactories.add(checkNotNull(factory, "factory == null"));
            return this;
        }

        public Builder client(OkHttpClient client) {
            return callFactory(checkNotNull(client, "client == null"));
        }

        public Builder callFactory(okhttp3.Call.Factory factory) {
            this.callFactory = checkNotNull(factory, "factory == null");
            return this;
        }

        public void build() {
            HttpManager.getInstance().setData(callFactory, baseUrl, converterFactories, callAdapterFactories);
        }
    }


    public static String packageName = "com.http";

    /**
     * 照抄ElementUtils
     */
    public static String getImplName(Class<?> clazz) {
        return packageName + "." + clazz.getSimpleName() + "$Impl";
    }
}


================================================
FILE: XRetrofit/xretrofit/src/main/java/com/xretrofit/Interceptor/DownloadResponseBody.java
================================================
package com.xretrofit.Interceptor;


import java.io.File;
import java.io.IOException;
import java.text.DecimalFormat;

import okhttp3.MediaType;
import okhttp3.Response;
import okhttp3.ResponseBody;
import okio.Buffer;
import okio.BufferedSource;
import okio.ForwardingSource;
import okio.Okio;

/**
 * 下载
 */
public class DownloadResponseBody extends ResponseBody {

    private Response originalResponse;
    private long startsPoint = 0;
    private long maxProgress = 0;
    private File file;
    DecimalFormat df = new DecimalFormat("#.00");

    private ProgressListener progressListener;

    public void setProgressListener(ProgressListener progressListener) {
        this.progressListener = progressListener;
    }

    public DownloadResponseBody(Response originalResponse, long startsPoint, File file) {
        this.originalResponse = originalResponse;
        this.startsPoint = startsPoint;
        this.file = file;
    }

    @Override
    public MediaType contentType() {
        return originalResponse.body().contentType();
    }

    @Override
    public long contentLength() {
        return originalResponse.body().contentLength();
    }

    public void setMaxProgress(long maxProgress) {
        this.maxProgress = maxProgress;
    }

    @Override
    public BufferedSource source() {
        return Okio.buffer(new ForwardingSource(originalResponse.body().source()) {
            private long bytesReaded = 0;

            @Override
            public long read(Buffer sink, long byteCount) throws IOException {
                long bytesRead = super.read(sink, byteCount);
                bytesReaded += bytesRead == -1 ? 0 : bytesRead;
                if (progressListener != null) {
                    progressListener.setProgress(Float.valueOf(df.format((Float.valueOf(bytesReaded+startsPoint) / maxProgress) * 100)));
                }
                return bytesRead;
            }
        });
    }

    public File getFile() {
        return file;
    }

    public void setFile(File file) {
        this.file = file;
    }

    public long getStartsPoint() {
        return startsPoint;
    }
}

================================================
FILE: XRetrofit/xretrofit/src/main/java/com/xretrofit/Interceptor/ProgressListener.java
================================================
package com.xretrofit.Interceptor;

/**
 * @author bsnl_yanxuwen
 * @date 2021/2/8 9:45
 * Description :
 */
public class ProgressListener {
    public void setProgress(float progress) {
        if (listener != null) {
            listener.progress(progress);
        }
    }

    public interface Listener {
        public void progress(float progress);
    }

    private Listener listener;

    public void setProgressListener(Listener listener) {
        this.listener = listener;
    }

}


================================================
FILE: XRetrofit/xretrofit/src/main/java/com/xretrofit/Interceptor/UploadRequestBodyBody.java
================================================
package com.xretrofit.Interceptor;

import java.io.IOException;
import java.text.DecimalFormat;

import okhttp3.MediaType;
import okhttp3.RequestBody;
import okio.Buffer;
import okio.BufferedSink;
import okio.ForwardingSink;
import okio.Okio;
import okio.Sink;

/**
 * 上传
 */
public class UploadRequestBodyBody extends RequestBody {
    private RequestBody mRequestBody;
    private long mContentLength;
    final DecimalFormat df = new DecimalFormat("#.00");

    private ProgressListener progressListener;

    public void setProgressListener(ProgressListener progressListener) {
        this.progressListener = progressListener;
    }

    public UploadRequestBodyBody(RequestBody requestBody) {
        mRequestBody = requestBody;
    }

    //文件的总长度
    @Override
    public long contentLength() {
        try {
            if (mContentLength == 0)
                mContentLength = mRequestBody.contentLength();
            return mContentLength;
        } catch (IOException e) {
            e.printStackTrace();
        }
        return -1;
    }

    @Override
    public MediaType contentType() {
        return mRequestBody.contentType();
    }

    @Override
    public void writeTo(BufferedSink sink) throws IOException {
        ByteSink byteSink = new ByteSink(sink);
        BufferedSink mBufferedSink = Okio.buffer(byteSink);
        mRequestBody.writeTo(mBufferedSink);
        mBufferedSink.flush();
    }


    private final class ByteSink extends ForwardingSink {
        //已经上传的长度
        private long mByteLength = 0L;

        ByteSink(Sink delegate) {
            super(delegate);
        }

        @Override
        public void write(Buffer source, long byteCount) throws IOException {
            super.write(source, byteCount);
            mByteLength += byteCount;
            if (progressListener != null){
                progressListener.setProgress(Float.valueOf(df.format((Float.valueOf(mByteLength) /  contentLength()) * 100)));
            }
        }
    }
}

================================================
FILE: XRetrofit/xretrofit/src/main/java/com/xretrofit/Response.java
================================================
package com.xretrofit;


import org.jetbrains.annotations.Nullable;

import okhttp3.Headers;
import okhttp3.ResponseBody;

import static com.xretrofit.utils.Utils.checkNotNull;


/**
 * @author bsnl_yanxuwen
 * @date 2021/2/4 11:11
 * Description :
 * 自己定义的Response,里面嵌套 okhttp的Response,可供后续替换
 */
public final class Response<T> {
    private okhttp3.Response rawResponse;
    private @Nullable
    T body;
    private @Nullable
    ResponseBody errorBody;

    private Response(okhttp3.Response rawResponse, @Nullable T body,
                     @Nullable ResponseBody errorBody) {
        this.rawResponse = rawResponse;
        this.body = body;
        this.errorBody = errorBody;
    }


    public static <T> Response<T> success(@Nullable T body, okhttp3.Response rawResponse) {
        checkNotNull(rawResponse, "rawResponse == null");
        if (!rawResponse.isSuccessful()) {
            throw new IllegalArgumentException("rawResponse must be successful response");
        }
        return new Response<>(rawResponse, body, null);
    }


    /**
     * Create an error response from {@code rawResponse} with {@code body} as the error body.
     */
    public static <T> Response<T> error(ResponseBody body, okhttp3.Response rawResponse) {
        checkNotNull(body, "body == null");
        checkNotNull(rawResponse, "rawResponse == null");
        if (rawResponse.isSuccessful()) {
            throw new IllegalArgumentException("rawResponse should not be successful response");
        }
        return new Response<>(rawResponse, null, body);
    }

    /** The raw response from the HTTP client. */
    public okhttp3.Response raw() {
        return rawResponse;
    }

    /** HTTP status code. */
    public int code() {
        return rawResponse.code();
    }

    /** HTTP status message or null if unknown. */
    public String message() {
        return rawResponse.message();
    }

    /** HTTP headers. */
    public Headers headers() {
        return rawResponse.headers();
    }

    /** Returns true if {@link #code()} is in the range [200..300). */
    public boolean isSuccessful() {
        return rawResponse.isSuccessful();
    }

    /** The deserialized response body of a {@linkplain #isSuccessful() successful} response. */
    public @Nullable T body() {
        return body;
    }

    /** The raw response body of an {@linkplain #isSuccessful() unsuccessful} response. */
    public @Nullable ResponseBody errorBody() {
        return errorBody;
    }

    @Override public String toString() {
        return rawResponse.toString();
    }
}


================================================
FILE: XRetrofit/xretrofit/src/main/java/com/xretrofit/bean/RequestParams.java
================================================
package com.xretrofit.bean;

import java.util.HashMap;
import java.util.Map;

/**
 * 自动生成用的请求参数
 */
public class RequestParams {
    private String url;
    private boolean isForm;//是否是表单提交
    private Map<String, Object> params;
    private Map<String, String> headers;

    public String getUrl() {
        return url;
    }

    public void setUrl(String url) {
        this.url = url;
    }


    public Map<String, Object> getParams() {
        if (params == null){
            return new HashMap<>();
        }
        return params;
    }

    public void setParams(Map<String, Object> params) {
        this.params = params;
    }


    public Map<String, String> getHeaders() {
        if (headers == null){
            return new HashMap<>();
        }
        return headers;
    }


    public void setHeaders(Map<String, String> headers) {
        this.headers = headers;
    }

    public void addParams(String key, String value) {
        getParams().put(key, value);
    }

    public void addHeader(String key, String value) {
        getHeaders().put(key, value);
    }

    public boolean isForm() {
        return isForm;
    }

    public void setForm(boolean form) {
        isForm = form;
    }
}


================================================
FILE: XRetrofit/xretrofit/src/main/java/com/xretrofit/call/Call.java
================================================
package com.xretrofit.call;

import com.xretrofit.Response;
import com.xretrofit.callback.CallBack;
import com.xretrofit.converter.Converter;

import okhttp3.ResponseBody;


/**
 * @author bsnl_yanxuwen
 * @date 2021/2/4 11:02
 * Description :
 *
 */
public interface Call<T> {

    /**
     * 初始化接口返回类型
     */
    void init(Converter<ResponseBody, T> responseConverter);

    /**
     * 执行请求,异步
     */
    void enqueue(CallBack<T> callback);


    /**
     * 执行请求同步
     */
    Response<T> execute() throws Exception;


    void cancel();

    boolean isCanceled();

    Call<T> clone();

}


================================================
FILE: XRetrofit/xretrofit/src/main/java/com/xretrofit/call/OkHttpCall.java
================================================
package com.xretrofit.call;

import android.os.Handler;
import android.os.Looper;

import com.xretrofit.Response;
import com.xretrofit.callback.CallBack;
import com.xretrofit.converter.Converter;
import com.xretrofit.utils.Utils;

import org.jetbrains.annotations.NotNull;

import java.io.IOException;

import okhttp3.Callback;
import okhttp3.MediaType;
import okhttp3.ResponseBody;
import okio.BufferedSource;

/**
 * @author bsnl_yanxuwen
 * @date 2021/2/4 11:17
 * Description :
 */
public class OkHttpCall<T> implements Call<T> {
    protected Converter<ResponseBody, T> responseConverter;//结果转换器
    protected okhttp3.Call call;
    private volatile boolean canceled;
    final Handler mHandler = new Handler(Looper.getMainLooper());

    public OkHttpCall(okhttp3.Call call) {
        this.call = call;
    }

    @Override
    public void init(Converter<ResponseBody, T> responseConverter) {
        this.responseConverter = responseConverter;
    }

    /**
     * 执行请求,异步
     */
    @Override
    public void enqueue(final CallBack<T> callback) {
        call.enqueue(new Callback() {
            @Override
            public void onFailure(@NotNull okhttp3.Call call, @NotNull final IOException e) {
                if (callback == null) {
                    return;
                }
                mHandler.post(new Runnable() {
                    @Override
                    public void run() {
                        callback.onFail(OkHttpCall.this, e);
                    }
                });
            }

            @Override
            public void onResponse(@NotNull okhttp3.Call call, @NotNull final okhttp3.Response response) throws IOException {
                if (callback == null) {
                    return;
                }
                final Response<T> tResponse;
                try {
                    if (canceled) {
                        return;
                    }
                    tResponse = parseResponse(response);
                } catch (final Exception e) {
                    mHandler.post(new Runnable() {
                        @Override
                        public void run() {
                            callback.onFail(OkHttpCall.this, e);
                        }
                    });
                    return;
                }
                mHandler.post(new Runnable() {
                    @Override
                    public void run() {
                        callback.onSuccess(OkHttpCall.this, tResponse);
                    }
                });
            }
        });
        mHandler.post(new Runnable() {
            @Override
            public void run() {
                callback.onStart(OkHttpCall.this);
            }
        });
    }

    /**
     * 执行请求,同步
     */
    @Override
    public Response<T> execute() throws Exception {
        okhttp3.Response rawResponse = call.execute();
        if (canceled) {
            return null;
        }
        return parseResponse(rawResponse);
    }

    @Override
    public void cancel() {
        canceled = true;
        if (call != null) {
            call.cancel();
        }
    }

    @Override public boolean isCanceled() {
        if (canceled) {
            return true;
        }
        synchronized (this) {
            return call != null && call.isCanceled();
        }
    }

    @Override
    public Call<T> clone() {
        OkHttpCall okHttpCall = new OkHttpCall(call);
        okHttpCall.init(responseConverter);
        return okHttpCall;
    }

    /**
     * 结果请求,数据处理
     */
    protected Response<T> parseResponse(okhttp3.Response rawResponse) throws Exception {
        ResponseBody rawBody = rawResponse.body();
        // Remove the body's source (the only stateful object) so we can pass the response along.
        //删除主体的源(唯一有状态的对象),这样我们就可以传递响应。
        //抄袭 retrofit的
        rawResponse = rawResponse.newBuilder()
                .body(new NoContentResponseBody(rawBody.contentType(), rawBody.contentLength()))
                .build();

        //不是200的则错误信息
        int code = rawResponse.code();
        if (code < 200 || code >= 300) {
            try {
                // Buffer the entire body to avoid future I/O.
                // 缓冲整个主体以避免将来的I/O。
                ResponseBody bufferedBody = Utils.buffer(rawBody);
                return Response.error(bufferedBody, rawResponse);
            } finally {
                rawBody.close();
            }
        }
        //HTTP 204(no content)表示响应执行成功,但没有数据返回,浏览器不用刷新,不用导向新页面。
        //HTTP 205(reset content) 表示响应执行成功,重置页面(Form表单),方便用户下次输入。
        if (code == 204 || code == 205) {
            rawBody.close();
            return Response.success(null, rawResponse);
        }
        //使用转换器转换
        T body = null;
        if (responseConverter != null) {
            body = responseConverter.convert(rawBody);
        }
        rawBody.close();
        return Response.success(body, rawResponse);
    }


    static final class NoContentResponseBody extends ResponseBody {
        private final MediaType contentType;
        private final long contentLength;

        NoContentResponseBody(MediaType contentType, long contentLength) {
            this.contentType = contentType;
            this.contentLength = contentLength;
        }

        @Override
        public MediaType contentType() {
            return contentType;
        }

        @Override
        public long contentLength() {
            return contentLength;
        }

        @Override
        public BufferedSource source() {
            throw new IllegalStateException("Cannot read raw response body of a converted body.");
        }
    }
}


================================================
FILE: XRetrofit/xretrofit/src/main/java/com/xretrofit/call/ProgressCall.java
================================================
package com.xretrofit.call;

import com.xretrofit.Interceptor.ProgressListener;
import com.xretrofit.callback.CallBack;
import com.xretrofit.callback.ProgressCallBack;

import java.text.DecimalFormat;

import okhttp3.Call;

/**
 * @author bsnl_yanxuwen
 * @date 2021/2/7 17:05
 * Description :
 * 下载
 */
public class ProgressCall<T> extends OkHttpCall<T> {

    final DecimalFormat df = new DecimalFormat("#.00");

    private ProgressListener[] listeners;

    /**
     * @param listeners 用于监听上传跟下载的时候用的
     */
    public ProgressCall(Call call, ProgressListener... listeners) {
        super(call);
        this.listeners = listeners;
    }

    @Override
    public void enqueue(final CallBack<T> callback) {
        super.enqueue(callback);
        if (callback instanceof ProgressCallBack) {
            final ProgressCallBack progressCallBack = (ProgressCallBack) callback;
            if (listeners != null) {
                final float[] totalProgress = new float[listeners.length];
                for (int i = 0; i < listeners.length; i++) {
                    final int finalI = i;
                    listeners[i].setProgressListener(new ProgressListener.Listener() {
                        @Override
                        public void progress(float progress) {
                            totalProgress[finalI] = progress;
                            double total = 0;
                            for (double mProcess : totalProgress) {
                                total += mProcess;
                            }
                            progressCallBack.onProgress(Float.valueOf(df.format(total / listeners.length)));
                        }
                    });
                }
            }
        }
    }
}


================================================
FILE: XRetrofit/xretrofit/src/main/java/com/xretrofit/callback/CallBack.java
================================================
package com.xretrofit.callback;

import com.xretrofit.call.Call;
import com.xretrofit.Response;


public interface CallBack<T> {

    void onStart(Call<T> call);

    void onSuccess(Call<T> call, Response<T> response);

    void onFail(Call<T> call, final Throwable e);
}

================================================
FILE: XRetrofit/xretrofit/src/main/java/com/xretrofit/callback/ProgressCallBack.java
================================================
package com.xretrofit.callback;

public abstract class ProgressCallBack<T> implements CallBack<T> {

    /**
     * 进度
     */
    public abstract void onProgress(float progress);
}


================================================
FILE: XRetrofit/xretrofit/src/main/java/com/xretrofit/converter/Converter.java
================================================
package com.xretrofit.converter;

import com.xretrofit.utils.Utils;
import com.yanxuwen.xretrofit_annotations.annotation.param.Body;
import com.yanxuwen.xretrofit_annotations.annotation.param.FilePath;
import com.yanxuwen.xretrofit_annotations.annotation.param.Header;
import com.yanxuwen.xretrofit_annotations.annotation.param.Param;
import com.yanxuwen.xretrofit_annotations.annotation.param.Path;
import com.yanxuwen.xretrofit_annotations.annotation.param.Query;

import org.jetbrains.annotations.Nullable;

import java.lang.reflect.Type;

import okhttp3.RequestBody;
import okhttp3.ResponseBody;

/**
 * @author bsnl_yanxuwen
 * @date 2021/2/4 14:07
 * Description :
 * 如果是请求
 */
public interface Converter<F, T> {
    T convert(F value) throws Exception;

    abstract class Factory {

        /**
         * 请求转换器,目前只支持{@link Body @Body} 注解
         * @param request get post
         * @param requestParamType  请求的参数类型
         * @return
         */
        public @Nullable Converter<?, RequestBody> requestBodyConverter(Type request, Type requestParamType) {
            return null;
        }

        /**
         * 请求转换器 ,支持
         * {@link Header @Header}
         * {@link Query @Query}
         * {@link Path @Path}
         * {@link FilePath @FilePath}
         * {@link Param @FilePath}
         * @param request  get post
         * @param requestParamType 请求的参数类型
         * @return
         */
        public @Nullable Converter<?, String> stringConverter(Type request,Type requestParamType) {
            return null;
        }

        /**
         * 结果转换器
         * @param request    get post
         * @param responseType 结果返回的参数类型
         * @return
         */
        public @Nullable Converter<ResponseBody, ?> responseBodyConverter(Type request,Type responseType) {
            return null;
        }

        protected static Class<?> getRawType(Type type) {
            return Utils.getRawType(type);
        }
    }
}


================================================
FILE: XRetrofit/xretrofit/src/main/java/com/xretrofit/converter/DownloadConverterFactories.java
================================================
package com.xretrofit.converter;

import com.yanxuwen.xretrofit_annotations.annotation.method.DOWNLOAD;

import org.jetbrains.annotations.Nullable;

import java.lang.reflect.Type;

import okhttp3.ResponseBody;

/**
 * @author bsnl_yanxuwen
 * @date 2021/2/7 16:32
 * 接口数据转换器
 * 下载转换器
 */
public class DownloadConverterFactories extends Converter.Factory {

    public static DownloadConverterFactories create() {
        return new DownloadConverterFactories();
    }


    @Nullable
    @Override
    public Converter<ResponseBody, ?> responseBodyConverter(Type request, Type responseType) {
        if (request == DOWNLOAD.class) {
            return new DownloadResponseConverter();
        }
        return null;
    }
}


================================================
FILE: XRetrofit/xretrofit/src/main/java/com/xretrofit/converter/DownloadResponseConverter.java
================================================
package com.xretrofit.converter;

import com.xretrofit.Interceptor.DownloadResponseBody;

import java.io.BufferedInputStream;
import java.io.InputStream;
import java.io.RandomAccessFile;

import okhttp3.ResponseBody;

/**
 * @author bsnl_yanxuwen
 * @date 2021/2/4 17:09
 * Description :
 * 接口数据转换
 * 返回接口的   下载操作
 */
public class DownloadResponseConverter<T> implements Converter<ResponseBody, T> {

    @Override
    public T convert(ResponseBody value) throws Exception {

        DownloadResponseBody responseBody = null;
        if (value instanceof DownloadResponseBody) {
            responseBody = (DownloadResponseBody) value;
        }
        if (responseBody == null) {
            return null;
        }
        long length = responseBody.contentLength();
        if (length == 0 || length == 1) {
            // 说明文件已经下载完,直接跳转安装就好
            return (T) String.valueOf(responseBody.getFile().getAbsoluteFile());
        }
        if (responseBody instanceof DownloadResponseBody) {
            responseBody.setMaxProgress(length + responseBody.getStartsPoint());
        }
        // 保存文件到本地
        InputStream is = null;
        RandomAccessFile randomAccessFile = null;
        BufferedInputStream bis = null;

        byte[] buff = new byte[2048];
        int len = 0;
        try {
            is = responseBody.byteStream();
            bis = new BufferedInputStream(is);

            // 随机访问文件,可以指定断点续传的起始位置
            randomAccessFile = new RandomAccessFile(responseBody.getFile(), "rwd");
            randomAccessFile.seek( responseBody.getStartsPoint());
            while ((len = bis.read(buff)) != -1) {
                randomAccessFile.write(buff, 0, len);
            }

            // 下载完成
            return (T) String.valueOf(responseBody.getFile().getAbsoluteFile());
        } catch (Exception e) {
//                    postUIFail(e, requestParams);
        } finally {
            try {
                if (is != null) {
                    is.close();
                }
                if (bis != null) {
                    bis.close();
                }
                if (randomAccessFile != null) {
                    randomAccessFile.close();
                }
            } catch (Exception e) {

            }
        }
        return null;
    }
}


================================================
FILE: XRetrofit/xretrofit/src/main/java/com/xretrofit/converter/StringConverterFactories.java
================================================
package com.xretrofit.converter;

import org.jetbrains.annotations.Nullable;

import java.lang.reflect.Type;

import okhttp3.ResponseBody;

/**
 * @author bsnl_yanxuwen
 * @date 2021/2/4 15:46
 * Description :
 * 接口数据转换器
 * 字符串转换器
 */
public class StringConverterFactories extends Converter.Factory {

    public static StringConverterFactories create() {
        return new StringConverterFactories();
    }


    @Nullable
    @Override
    public Converter<ResponseBody, ?> responseBodyConverter(Type request,Type responseType) {
        Class<?> rawType = getRawType(responseType);
        if (rawType == String.class) {
            return new StringResponseConverter();
        }
        return null;
    }
}


================================================
FILE: XRetrofit/xretrofit/src/main/java/com/xretrofit/converter/StringResponseConverter.java
================================================
package com.xretrofit.converter;

import okhttp3.ResponseBody;

/**
 * @author bsnl_yanxuwen
 * @date 2021/2/4 17:09
 * Description :
 * 接口数据转换
 * 返回接口的   字符串操作
 */
public class StringResponseConverter<T> implements Converter<ResponseBody, T> {


    @Override
    public T convert(ResponseBody value) throws Exception {
        String responseStr = value.string();
        return (T) responseStr;
    }
}


================================================
FILE: XRetrofit/xretrofit/src/main/java/com/xretrofit/converter/UploadConverterFactories.java
================================================
package com.xretrofit.converter;

import com.yanxuwen.xretrofit_annotations.annotation.method.UPLOAD;

import org.jetbrains.annotations.Nullable;

import java.lang.reflect.Type;

import okhttp3.RequestBody;

/**
 * @author bsnl_yanxuwen
 * @date 2021/2/7 16:32
 * 接口数据转换器
 * 转换器
 */
public class UploadConverterFactories extends Converter.Factory {

    public static UploadConverterFactories create() {
        return new UploadConverterFactories();
    }

    @Nullable
    @Override
    public Converter<?, RequestBody> requestBodyConverter(Type request, Type requestParamType) {
        if (request == UPLOAD.class) {
            return new UploadRequestConverter<>();
        }
        return null;
    }
}


================================================
FILE: XRetrofit/xretrofit/src/main/java/com/xretrofit/converter/UploadRequestConverter.java
================================================
package com.xretrofit.converter;

import okhttp3.RequestBody;

/**
 * @author bsnl_yanxuwen
 * @date 2021/2/8 9:25
 * Description :
 * * 接口数据转换
 * * 返回接口的   上次操作
 */
public class UploadRequestConverter<T> implements Converter<T, RequestBody> {

    @Override
    public RequestBody convert(T value) throws Exception {
        return null;
    }
}


================================================
FILE: XRetrofit/xretrofit/src/main/java/com/xretrofit/method/MethodAnnotation.java
================================================
package com.xretrofit.method;

import java.util.List;

/**
 * @author bsnl_yanxuwen
 * @date 2021/2/4 14:00
 * Description :
 * 方法注解,就是那些get post
 */
public class MethodAnnotation {
    private Class annotation;//注解类型
    private List<Object> key;//注解key

    public MethodAnnotation(Class annotation , List<Object> key){
        this.annotation = annotation;
        this.key = key;

    }

    public Class getAnnotation() {
        return annotation;
    }

    /**
     * key虽然可以多个,但是这个基本都显示1个,并且为String
     */
    public String getKey() {
        if (key == null || key.isEmpty()){
            return null;
        }
        if (key.get(0) instanceof String){
            return (String) key.get(0);
        }
        return null;
    }

    /**
     * @Headers 使用
     */
    public List<Object> getKeys() {
        return key;
    }
}


================================================
FILE: XRetrofit/xretrofit/src/main/java/com/xretrofit/method/ParamAnnotation.java
================================================
package com.xretrofit.method;

import java.util.List;

/**
 * @author bsnl_yanxuwen
 * @date 2021/2/4 14:00
 * Description :
 * 参数注解, Queue,Path
 */
public class ParamAnnotation {
    private Class annotation;//注解类型
    private List<Object> key;//注解key ,会存在第一个key
    private Object value;//注解字段,会存在为空问题

    public ParamAnnotation(Class annotation, List<Object> key, Object value) {
        this.annotation = annotation;
        this.key = key;
        this.value = value;
    }

    public Class getAnnotation() {
        return annotation;
    }

    /**
     * key虽然可以多个,但是这个基本都显示1个,并且为String
     */
    public String getKey() {
        if (key == null || key.isEmpty()){
            return null;
        }
        if (key.get(0) instanceof String){
            return (String) key.get(0);
        }
        return null;
    }

    public Object getValue() {
        return value;
    }

    public void setValue(Object value) {
        this.value = value;
    }
}


================================================
FILE: XRetrofit/xretrofit/src/main/java/com/xretrofit/method/ServiceMethod.java
================================================
package com.xretrofit.method;

import android.util.Log;
import android.util.Patterns;

import com.xretrofit.CallAdapter.CallAdapter;
import com.xretrofit.HttpManager;
import com.xretrofit.Interceptor.DownloadResponseBody;
import com.xretrofit.Interceptor.ProgressListener;
import com.xretrofit.Interceptor.UploadRequestBodyBody;
import com.xretrofit.bean.RequestParams;
import com.xretrofit.call.Call;
import com.xretrofit.call.OkHttpCall;
import com.xretrofit.call.ProgressCall;
import com.xretrofit.converter.Converter;
import com.xretrofit.utils.UrlUtils;
import com.xretrofit.utils.Utils;
import com.yanxuwen.xretrofit_annotations.annotation.method.DELETE;
import com.yanxuwen.xretrofit_annotations.annotation.method.DOWNLOAD;
import com.yanxuwen.xretrofit_annotations.annotation.method.FORM;
import com.yanxuwen.xretrofit_annotations.annotation.method.GET;
import com.yanxuwen.xretrofit_annotations.annotation.method.Headers;
import com.yanxuwen.xretrofit_annotations.annotation.method.POST;
import com.yanxuwen.xretrofit_annotations.annotation.method.PUT;
import com.yanxuwen.xretrofit_annotations.annotation.method.UPLOAD;
import com.yanxuwen.xretrofit_annotations.annotation.param.Body;
import com.yanxuwen.xretrofit_annotations.annotation.param.FilePath;
import com.yanxuwen.xretrofit_annotations.annotation.param.Header;
import com.yanxuwen.xretrofit_annotations.annotation.param.Param;
import com.yanxuwen.xretrofit_annotations.annotation.param.Path;
import com.yanxuwen.xretrofit_annotations.annotation.param.Query;

import org.json.JSONException;
import org.json.JSONObject;

import java.io.File;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.lang.reflect.Type;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import okhttp3.FormBody;
import okhttp3.Interceptor;
import okhttp3.MediaType;
import okhttp3.MultipartBody;
import okhttp3.Request;
import okhttp3.RequestBody;
import okhttp3.Response;
import okhttp3.ResponseBody;

public class ServiceMethod {

    //提交json数据
    private static final MediaType JSON = MediaType.parse("application/json;charset=utf-8");
    //提交字符串数据
    private static final MediaType MEDIA_TYPE_MARKDOWN = MediaType.parse("text/x-markdown;charset=utf-8");

    private RequestParams requestParams = new RequestParams();

    /**
     * 头部暂时未处理
     */
    public <R> R request(Map<Class, MethodAnnotation> mapMa, List<ParamAnnotation> listPA, Type returnType) {
        if (listPA == null) {
            return null;
        }
        buildHeaders(mapMa,listPA);
        Call<Object> myCall = null;
        Type requestType = null;
        if (mapMa.containsKey(GET.class)) {
            Class annotation = GET.class;
            requestType = annotation;
            buildUrl(mapMa.get(annotation).getKey(), listPA);
            final Request request = buildRequest(annotation, null);
            okhttp3.Call call = HttpManager.getInstance().callFactory().newCall(request);
            myCall = new OkHttpCall<>(call);
        } else if ((mapMa.containsKey(POST.class) || mapMa.containsKey(PUT.class) || mapMa.containsKey(DELETE.class)) && mapMa.containsKey(FORM.class)) {
            Class annotation = POST.class;
            if (mapMa.containsKey(POST.class)) {
                annotation = mapMa.get(POST.class).getAnnotation();
            } else if (mapMa.containsKey(PUT.class)) {
                annotation = mapMa.get(PUT.class).getAnnotation();
            }
            if (mapMa.containsKey(DELETE.class)) {
                annotation = mapMa.get(DELETE.class).getAnnotation();
            }
            requestType = annotation;
            //表单提交
            buildUrl(mapMa.get(annotation).getKey(), listPA);
            Map<String, Object> params = new HashMap<>();
            for (ParamAnnotation paramAnnotation : listPA) {
                if (Param.class == paramAnnotation.getAnnotation()) {
                    params.put(paramAnnotation.getKey(), paramAnnotation.getValue());
                }
            }
            FormBody.Builder builder = new FormBody.Builder();
            addMapParmsToFromBody(params, builder);
            Request request = buildRequest(annotation, builder.build());
            okhttp3.Call call = HttpManager.getInstance().callFactory().newCall(request);
            myCall = new OkHttpCall<>(call);
        } else if (mapMa.containsKey(POST.class) || mapMa.containsKey(PUT.class) || mapMa.containsKey(DELETE.class)) {
            Class annotation = POST.class;
            if (mapMa.containsKey(POST.class)) {
                annotation = mapMa.get(POST.class).getAnnotation();
            } else if (mapMa.containsKey(PUT.class)) {
                annotation = mapMa.get(PUT.class).getAnnotation();
            }
            if (mapMa.containsKey(DELETE.class)) {
                annotation = mapMa.get(DELETE.class).getAnnotation();
            }
            requestType = annotation;
            //json提交
            buildUrl(mapMa.get(annotation).getKey(), listPA);
            String json;
            JSONObject jb = new JSONObject();
            RequestBody requestBody = null;
            for (ParamAnnotation paramAnnotation : listPA) {
                if (Param.class == paramAnnotation.getAnnotation()) {
                    try {
                        jb.put(paramAnnotation.getKey(), paramAnnotation.getValue());
                    } catch (JSONException e) {
                        e.printStackTrace();
                    }
                    json = jb.toString();
                    requestBody = RequestBody.create(JSON, json);
                } else if (Body.class == paramAnnotation.getAnnotation() && paramAnnotation.getValue() instanceof String) {
                    requestBody = RequestBody.create(JSON, (String) paramAnnotation.getValue());
                } else {
                    Converter<Object, RequestBody> converter = createRequestConverter(annotation, paramAnnotation.getValue().getClass());
                    try {
                        requestBody = converter.convert(paramAnnotation.getValue());
                    } catch (Exception e) {
                        //实体转换,使用转换器
                        throw new IllegalStateException("@Body 没有定义该" + paramAnnotation.getValue().getClass().getSimpleName() + "的转换器,请使用addConverterFactory添加转换器");
                    }
                }
            }
            if (requestBody == null) {
                throw new NullPointerException("requestBody 为空");
            }
            Request request = buildRequest(annotation, requestBody);
            okhttp3.Call call = HttpManager.getInstance().callFactory().newCall(request);
            myCall = new OkHttpCall<>(call);
        } else if (mapMa.containsKey(DOWNLOAD.class)) {
            Class annotation = DOWNLOAD.class;
            requestType = annotation;
            buildUrl(mapMa.get(annotation).getKey(), listPA);
            String filePath = null;
            for (ParamAnnotation paramAnnotation : listPA) {
                //下载只支持String,File类型,因为他还支持List,后续看下是不是支持跟@body一样可以自定义
                if (FilePath.class == paramAnnotation.getAnnotation()) {
                    if (paramAnnotation.getValue() instanceof String) {
                        filePath = (String) paramAnnotation.getValue();
                    } else if (paramAnnotation.getValue() instanceof File) {
                        filePath = ((File) paramAnnotation.getValue()).getAbsolutePath();
                    }
                }
            }
            if (filePath == null || filePath.equals("")) {
                throw new IllegalStateException("文件路径不存在");
            }
            final File file = new File(filePath);
            File folder = file.getParentFile();
            if (!folder.exists()) {
                try {
                    boolean isMkdirs = folder.mkdirs();
                    if (!isMkdirs) {
                        throw new FileNotFoundException("java.io.FileNotFoundException: " + folder + ": open failed: ENOENT (No such file or directory)");
                    }
                } catch (Exception e) {
                    throw new IllegalStateException("文件创建失败");
                }
            }
            final long startsPoint = file.length() > 0 ? file.length() - 1 : file.length();
            requestParams.addHeader("RANGE", "bytes=" + startsPoint + "-");//断点续传
            Request request = buildRequest(annotation, null);
            final ProgressListener listener = new ProgressListener();

            // 重写ResponseBody监听请求
            Interceptor interceptor = new Interceptor() {
                @Override
                public Response intercept(Chain chain) throws IOException {
                    Response originalResponse = chain.proceed(chain.request());
                    DownloadResponseBody responseBody = new DownloadResponseBody(originalResponse, startsPoint, file);
                    responseBody.setProgressListener(listener);
                    return originalResponse.newBuilder()
                            .body(responseBody)
                            .build();
                }
            };
            okhttp3.Call call = HttpManager.getInstance().getOkHttpDownloadClient(interceptor).newCall(request);
            myCall = new ProgressCall<>(call, listener);
        } else if (mapMa.containsKey(UPLOAD.class)) {
            Class annotation = UPLOAD.class;
            requestType = annotation;
            buildUrl(mapMa.get(annotation).getKey(), listPA);
            List<File> listPath = new ArrayList<>();
            for (ParamAnnotation paramAnnotation : listPA) {
                if (FilePath.class == paramAnnotation.getAnnotation()) {
                    if (paramAnnotation.getValue() instanceof String) {
                        listPath.add(new File((String) paramAnnotation.getValue()));
                    } else if (paramAnnotation.getValue() instanceof File) {
                        listPath.add(((File) paramAnnotation.getValue()));
                    } else if (paramAnnotation.getValue() instanceof List) {
                        for (Object o : (List) paramAnnotation.getValue()) {
                            if (o instanceof String) {
                                listPath.add(new File((String) o));
                            } else if (o instanceof File) {
                                listPath.add(((File) o));
                            }
                        }
                    }
                }
            }
            //1.构建MultipartBody
            MultipartBody.Builder multipartBody = new MultipartBody.Builder();
            multipartBody.setType(MultipartBody.FORM);
            //添加额外参数
            for (ParamAnnotation paramAnnotation : listPA) {
                if (Param.class == paramAnnotation.getAnnotation()) {
                    try {
                        multipartBody.addFormDataPart(paramAnnotation.getKey(), String.valueOf(paramAnnotation.getValue()));//后台接收文件流的参数名
                    } catch (Exception e) {
                        e.printStackTrace();
                    }
                }
            }
            //2.循环创建多个RequestBody
            RequestBody fileBody = null;
            ProgressListener[] listeners = new ProgressListener[listPath.size()];
            for (int i = 0; i < listPath.size(); i++) {
                File file = listPath.get(i);
                String fileName = file.getName();

                fileBody = RequestBody.create(MediaType.parse(Utils.guessMimeType(fileName)), file);
                UploadRequestBodyBody requestBody = new UploadRequestBodyBody(fileBody);
                listeners[i] = new ProgressListener();
                requestBody.setProgressListener(listeners[i]);
                //3.MultipartBody 添加Part 值
                multipartBody.addFormDataPart("file", fileName, requestBody);//后台接收文件流的参数名
            }
            final Request request = buildRequest(annotation, multipartBody.build());
            okhttp3.Call call = HttpManager.getInstance().callFactory().newCall(request);
            myCall = new ProgressCall<>(call, listeners);
        }


        return adapt(requestType, myCall, returnType);
    }

    private void buildHeaders(Map<Class, MethodAnnotation> mapMa, List<ParamAnnotation> listPA){
        Map<String,String> mapHeader = new HashMap<>();
         if (mapMa.containsKey(Headers.class)){
             List<Object> list = mapMa.get(Headers.class).getKeys();
             if (list != null) {
                 for (Object o: list){
                     String[] header = String.valueOf(o).split(":");
                     if (header == null || header.length<2){
                         continue;
                     }
                     mapHeader.put(header[0],header[1]);
                 }
             }
         }
         for (ParamAnnotation paramAnnotation : listPA){
             if (Header.class == paramAnnotation.getAnnotation()){
                 mapHeader.put(paramAnnotation.getKey(),String.valueOf(paramAnnotation.getValue()));
             }
         }
         requestParams.setHeaders(mapHeader);
    }

    /**
     * 编辑参数
     */
    private void buildUrl(String url, List<ParamAnnotation> listPA) {
        if (listPA == null) {
            return;
        }
        Map<String, Object> urlJoint = new HashMap<>();

        for (ParamAnnotation paramAnnotation : listPA) {
            if (Query.class == paramAnnotation.getAnnotation()) {
                urlJoint.put(paramAnnotation.getKey(), paramAnnotation.getValue());
            } else if (Path.class == paramAnnotation.getAnnotation() && paramAnnotation.getValue() instanceof String) {
                url = url.replace("{" + paramAnnotation.getKey() + "}", (String) paramAnnotation.getValue());
            }
        }

        url = UrlUtils.urlJoint(url, urlJoint);
        if (!Patterns.WEB_URL.matcher(url).matches() && HttpManager.getInstance().baseUrl != null) {
          url = HttpManager.getInstance().baseUrl + url;
        }
        requestParams.setUrl(url);
    }

    private void addMapParmsToFromBody(Map<String, Object> params, FormBody.Builder builder) {
        for (Map.Entry<String, Object> map : params.entrySet()) {
            String key = map.getKey();
            String value = "";
            /**
             * 判断值是否是空的
             */
            if (map.getValue() == null) {
                value = "";
            } else if (map.getValue() instanceof String) {
                value = (String) map.getValue();
            }
            /**
             * 把key和value添加到formbody中
             */
            builder.add(key, value);
        }
    }

    private Request buildRequest(Class annotation, RequestBody body) {
        Request.Builder builder = new Request.Builder();
        builder.url(requestParams.getUrl());
        if (body != null) {
            if (POST.class == annotation || UPLOAD.class == annotation) {
                builder.post(body);
            } else if (PUT.class == annotation) {
                builder.put(body);
            } else if (DELETE.class == annotation) {
                builder.delete(body);
            }
        } else if (GET.class == annotation) {
            builder.get();
        }
        if (requestParams.getHeaders() != null) {
            for (Map.Entry<String, String> entry : requestParams.getHeaders().entrySet()) {
                builder.addHeader(entry.getKey(), entry.getValue());
            }
        }
        return builder.build();
    }


    /**
     * 获取请求参数数据转换器
     */
    private <T> Converter<T, RequestBody> createRequestConverter(Type request, Type requestParamType) {
        for (int i = 0; i < HttpManager.getInstance().converterFactories.size(); i++) {
            Converter<T, RequestBody> converter = (Converter<T, RequestBody>) HttpManager.getInstance().converterFactories.get(i).requestBodyConverter(request, requestParamType);
            if (converter != null) {
                return converter;
            }
        }
        return null;
    }

    /**
     * 获取结果数据转换器
     */
    public <T> Converter<ResponseBody, T> createResponseConverter(Type request, Type responseType) {
        for (int i = 0; i < HttpManager.getInstance().converterFactories.size(); i++) {
            Converter<ResponseBody, T> converter = (Converter<ResponseBody, T>) HttpManager.getInstance().converterFactories.get(i).responseBodyConverter(request, responseType);
            if (converter != null) {
                return converter;
            }
        }
        return null;
    }


    /**
     * 获取适配器
     */
    private CallAdapter<?, ?> createCallAdapter(Type type) {
        for (int i = 0; i < HttpManager.getInstance().callAdapterFactories.size(); i++) {
            CallAdapter<?, ?> converter = HttpManager.getInstance().callAdapterFactories.get(i).get(type);
            if (converter != null) {
                return converter;
            }
        }
        return null;
    }

    /**
     * 执行转化
     */
    private <R> R adapt(Type request, Call call, Type returnType) {
        CallAdapter<?, ?> callAdapter = createCallAdapter(returnType);
        call.init(createResponseConverter(request, callAdapter.responseType()));
        if (callAdapter != null) {
            return (R) callAdapter.adapt(call);
        }
        return null;
    }
}


================================================
FILE: XRetrofit/xretrofit/src/main/java/com/xretrofit/okhttp/SslUtils.java
================================================

package com.xretrofit.okhttp;

import java.io.IOException;
import java.io.InputStream;
import java.security.KeyManagementException;
import java.security.KeyStore;
import java.security.NoSuchAlgorithmException;
import java.security.cert.Certificate;
import java.security.cert.CertificateException;
import java.security.cert.CertificateFactory;
import java.security.cert.X509Certificate;

import javax.net.ssl.KeyManager;
import javax.net.ssl.KeyManagerFactory;
import javax.net.ssl.SSLContext;
import javax.net.ssl.SSLSocketFactory;
import javax.net.ssl.TrustManager;
import javax.net.ssl.TrustManagerFactory;
import javax.net.ssl.X509TrustManager;

public class SslUtils {

    public static class SSLParams {
        public SSLSocketFactory sSLSocketFactory;
        public X509TrustManager trustManager;
    }

    /**
     * 信任所有
     */
    public static SSLParams getSslSocketFactory() {
        return getSslSocketFactoryBase(null, null, null);
    }

    /**
     * https单向认证
     * 可以额外配置信任服务端的证书策略,否则默认是按CA证书去验证的,若不是CA可信任的证书,则无法通过验证
     */
    public static SSLParams getSslSocketFactory(X509TrustManager trustManager) {
        return getSslSocketFactoryBase(trustManager, null, null);
    }

    /**
     * https单向认证
     * 用含有服务端公钥的证书校验服务端证书
     */
    public static SSLParams getSslSocketFactory(InputStream... certificates) {
        return getSslSocketFactoryBase(null, null, null, certificates);
    }

    /**
     * https双向认证
     * bksFile 和 password -> 客户端使用bks证书校验服务端证书
     * certificates -> 用含有服务端公钥的证书校验服务端证书
     */
    public static SSLParams getSslSocketFactory(InputStream bksFile, String password, InputStream... certificates) {
        return getSslSocketFactoryBase(null, bksFile, password, certificates);
    }

    /**
     * https双向认证
     * bksFile 和 password -> 客户端使用bks证书校验服务端证书
     * X509TrustManager -> 如果需要自己校验,那么可以自己实现相关校验,如果不需要自己校验,那么传null即可
     */
    public static SSLParams getSslSocketFactory(InputStream bksFile, String password, X509TrustManager trustManager) {
        return getSslSocketFactoryBase(trustManager, bksFile, password);
    }

    private static SSLParams getSslSocketFactoryBase(X509TrustManager trustManager, InputStream bksFile, String password, InputStream... certificates) {
        SSLParams sslParams = new SSLParams();
        try {
            KeyManager[] keyManagers = prepareKeyManager(bksFile, password);
            TrustManager[] trustManagers = prepareTrustManager(certificates);
            X509TrustManager manager;
            if (trustManager != null) {
                //优先使用用户自定义的TrustManager
                manager = trustManager;
            } else if (trustManagers != null) {
                //然后使用默认的TrustManager
                manager = chooseTrustManager(trustManagers);
            } else {
                //否则使用不安全的TrustManager
                manager = UnSafeTrustManager;
            }
            // 创建TLS类型的SSLContext对象, that uses our TrustManager
            SSLContext sslContext = SSLContext.getInstance("TLS");
            // 用上面得到的trustManagers初始化SSLContext,这样sslContext就会信任keyStore中的证书
            // 第一个参数是授权的密钥管理器,用来授权验证,比如授权自签名的证书验证。第二个是被授权的证书管理器,用来验证服务器端的证书
            sslContext.init(keyManagers, new TrustManager[]{manager}, null);
            // 通过sslContext获取SSLSocketFactory对象
            sslParams.sSLSocketFactory = sslContext.getSocketFactory();
            sslParams.trustManager = manager;
            return sslParams;
        } catch (NoSuchAlgorithmException e) {
            throw new AssertionError(e);
        } catch (KeyManagementException e) {
            throw new AssertionError(e);
        }
    }

    private static KeyManager[] prepareKeyManager(InputStream bksFile, String password) {
        try {
            if (bksFile == null || password == null) return null;
            KeyStore clientKeyStore = KeyStore.getInstance("BKS");
            clientKeyStore.load(bksFile, password.toCharArray());
            KeyManagerFactory kmf = KeyManagerFactory.getInstance(KeyManagerFactory.getDefaultAlgorithm());
            kmf.init(clientKeyStore, password.toCharArray());
            return kmf.getKeyManagers();
        } catch (Exception e) {
        }
        return null;
    }

    private static TrustManager[] prepareTrustManager(InputStream... certificates) {
        if (certificates == null || certificates.length <= 0) return null;
        try {
            CertificateFactory certificateFactory = CertificateFactory.getInstance("X.509");
            // 创建一个默认类型的KeyStore,存储我们信任的证书
            KeyStore keyStore = KeyStore.getInstance(KeyStore.getDefaultType());
            keyStore.load(null);
            int index = 0;
            for (InputStream certStream : certificates) {
                String certificateAlias = Integer.toString(index++);
                // 证书工厂根据证书文件的流生成证书 cert
                Certificate cert = certificateFactory.generateCertificate(certStream);
                // 将 cert 作为可信证书放入到keyStore中
                keyStore.setCertificateEntry(certificateAlias, cert);
                try {
                    if (certStream != null) certStream.close();
                } catch (IOException e) {
                }
            }
            //我们创建一个默认类型的TrustManagerFactory
            TrustManagerFactory tmf = TrustManagerFactory.getInstance(TrustManagerFactory.getDefaultAlgorithm());
            //用我们之前的keyStore实例初始化TrustManagerFactory,这样tmf就会信任keyStore中的证书
            tmf.init(keyStore);
            //通过tmf获取TrustManager数组,TrustManager也会信任keyStore中的证书
            return tmf.getTrustManagers();
        } catch (Exception e) {
        }
        return null;
    }

    private static X509TrustManager chooseTrustManager(TrustManager[] trustManagers) {
        for (TrustManager trustManager : trustManagers) {
            if (trustManager instanceof X509TrustManager) {
                return (X509TrustManager) trustManager;
            }
        }
        return null;
    }

    /**
     * 为了解决客户端不信任服务器数字证书的问题,网络上大部分的解决方案都是让客户端不对证书做任何检查,
     * 这是一种有很大安全漏洞的办法
     */
    public static X509TrustManager UnSafeTrustManager = new X509TrustManager() {
        @Override
        public void checkClientTrusted(X509Certificate[] chain, String authType) throws CertificateException {
        }

        @Override
        public void checkServerTrusted(X509Certificate[] chain, String authType) throws CertificateException {
        }

        @Override
        public X509Certificate[] getAcceptedIssuers() {
            return new X509Certificate[]{};
        }
    };
}


================================================
FILE: XRetrofit/xretrofit/src/main/java/com/xretrofit/utils/UrlUtils.java
================================================
package com.xretrofit.utils;

import java.util.HashMap;
import java.util.Map;
import java.util.Set;

public class UrlUtils {
    /**
     * @param url    实际URL的path
     * @param params
     * @return
     */
    public static String urlJoint(String url, Map<String, Object> params) {
        StringBuilder realURL = new StringBuilder();
        realURL = realURL.append(url);
        boolean isFirst = true;
        if (params == null) {
            params = new HashMap<>();
        } else {
            Set<Map.Entry<String, Object>> entrySet = params.entrySet();
            for (Map.Entry<String, Object> entry : entrySet) {
                if (isFirst && !url.contains("?")) {
                    isFirst = false;
                    realURL.append("?");
                } else {
                    realURL.append("&");
                }
                realURL.append(entry.getKey());
                realURL.append("=");
                if (entry.getValue() == null) {
                    realURL.append(" ");
                } else {
                    realURL.append(entry.getValue());
                }

            }
        }

        return realURL.toString();
    }
}


================================================
FILE: XRetrofit/xretrofit/src/main/java/com/xretrofit/utils/Utils.java
================================================
package com.xretrofit.utils;

import org.jetbrains.annotations.Nullable;

import java.io.IOException;
import java.lang.reflect.Array;
import java.lang.reflect.GenericArrayType;
import java.lang.reflect.ParameterizedType;
import java.lang.reflect.Type;
import java.lang.reflect.TypeVariable;
import java.lang.reflect.WildcardType;
import java.net.FileNameMap;
import java.net.URLConnection;

import okhttp3.ResponseBody;
import okio.Buffer;

/**
 * @author bsnl_yanxuwen
 * @date 2021/2/4 11:14
 * Description :
 */
public final class Utils {
    public static <T> T checkNotNull(@Nullable T object, String message) {
        if (object == null) {
            throw new NullPointerException(message);
        }
        return object;
    }

    public static ResponseBody buffer(final ResponseBody body) throws IOException {
        Buffer buffer = new Buffer();
        body.source().readAll(buffer);
        return ResponseBody.create(body.contentType(), body.contentLength(), buffer);
    }

    /**
     * 获取接口返回的类型
     */
    public static Type getCallResponseType(Type returnType) {
        if (!(returnType instanceof ParameterizedType)) {
            return returnType;
//            throw new IllegalArgumentException(
//                    "Call return type must be parameterized as Call<Foo> or Call<? extends Foo>");
        }
        return getParameterUpperBound(0, (ParameterizedType) returnType);
    }


    /**
     * 应该是获取下一层的 泛型类型
     */
    public static Type getParameterUpperBound(int index, ParameterizedType type) {
        Type[] types = type.getActualTypeArguments();
        if (index < 0 || index >= types.length) {
            throw new IllegalArgumentException(
                    "Index " + index + " not in range [0," + types.length + ") for " + type);
        }
        Type paramType = types[index];
        if (paramType instanceof WildcardType) {
            return ((WildcardType) paramType).getUpperBounds()[0];
        }
        return paramType;
    }

    public static Class<?> getRawType(Type type) {
        checkNotNull(type, "type == null");

        if (type instanceof Class<?>) {
            // Type is a normal class.
            return (Class<?>) type;
        }
        if (type instanceof ParameterizedType) {
            ParameterizedType parameterizedType = (ParameterizedType) type;

            // I'm not exactly sure why getRawType() returns Type instead of Class. Neal isn't either but
            // suspects some pathological case related to nested classes exists.
            Type rawType = parameterizedType.getRawType();
            if (!(rawType instanceof Class)) throw new IllegalArgumentException();
            return (Class<?>) rawType;
        }
        if (type instanceof GenericArrayType) {
            Type componentType = ((GenericArrayType) type).getGenericComponentType();
            return Array.newInstance(getRawType(componentType), 0).getClass();
        }
        if (type instanceof TypeVariable) {
            // We could use the variable's bounds, but that won't work if there are multiple. Having a raw
            // type that's more general than necessary is okay.
            return Object.class;
        }
        if (type instanceof WildcardType) {
            return getRawType(((WildcardType) type).getUpperBounds()[0]);
        }

        throw new IllegalArgumentException("Expected a Class, ParameterizedType, or "
                + "GenericArrayType, but <" + type + "> is of type " + type.getClass().getName());
    }

    /**
     * 猜测MimeType,上传使用
     */
    public static String guessMimeType(String fileName) {
        FileNameMap fileNameMap = URLConnection.getFileNameMap();
        String contentTypeFor = fileNameMap.getContentTypeFor(fileName);
        if (contentTypeFor == null) {
            contentTypeFor = "application/octet-stream";
        }
        return contentTypeFor;
    }
}
Download .txt
gitextract_6p_2z26y/

├── README.md
└── XRetrofit/
    ├── .gitignore
    ├── Could
    ├── annotations/
    │   ├── .gitignore
    │   ├── build.gradle
    │   └── src/
    │       └── main/
    │           └── java/
    │               └── com/
    │                   └── yanxuwen/
    │                       └── xretrofit_annotations/
    │                           └── annotation/
    │                               ├── method/
    │                               │   ├── DELETE.java
    │                               │   ├── DOWNLOAD.java
    │                               │   ├── FORM.java
    │                               │   ├── GET.java
    │                               │   ├── Headers.java
    │                               │   ├── POST.java
    │                               │   ├── PUT.java
    │                               │   └── UPLOAD.java
    │                               ├── param/
    │                               │   ├── Body.java
    │                               │   ├── FilePath.java
    │                               │   ├── Header.java
    │                               │   ├── Param.java
    │                               │   ├── Path.java
    │                               │   └── Query.java
    │                               └── service/
    │                                   └── NetServiceClass.java
    ├── app/
    │   ├── .gitignore
    │   ├── build.gradle
    │   ├── proguard-rules.pro
    │   └── src/
    │       └── main/
    │           ├── AndroidManifest.xml
    │           ├── java/
    │           │   └── com/
    │           │       └── yanxuwen/
    │           │           └── xretrofit/
    │           │               ├── MainActivity.java
    │           │               ├── MyApplication.java
    │           │               ├── RxSchedulers.java
    │           │               ├── bean/
    │           │               │   ├── HomeInfoV5.java
    │           │               │   └── LoginBuild.java
    │           │               ├── callback/
    │           │               │   ├── MyCallBack.java
    │           │               │   ├── MyProgressCallBack.java
    │           │               │   └── ServerException.java
    │           │               ├── converter/
    │           │               │   ├── GsonConverterFactories.java
    │           │               │   ├── GsonRequestConverter.java
    │           │               │   ├── GsonResponseConverter.java
    │           │               │   ├── Rxjava2CallAdapter.java
    │           │               │   └── Rxjava2CallAdapterFactories.java
    │           │               └── http/
    │           │                   ├── HttpRequest.java
    │           │                   └── NetService.java
    │           └── res/
    │               ├── drawable/
    │               │   └── ic_launcher_background.xml
    │               ├── drawable-v24/
    │               │   └── ic_launcher_foreground.xml
    │               ├── layout/
    │               │   └── activity_main.xml
    │               ├── mipmap-anydpi-v26/
    │               │   ├── ic_launcher.xml
    │               │   └── ic_launcher_round.xml
    │               ├── values/
    │               │   ├── colors.xml
    │               │   ├── strings.xml
    │               │   └── styles.xml
    │               └── xml/
    │                   └── network_security_config.xml
    ├── bintray.gradle
    ├── build.gradle
    ├── compiler/
    │   ├── .gitignore
    │   ├── build.gradle
    │   └── src/
    │       └── main/
    │           └── java/
    │               └── com/
    │                   └── xretrofit/
    │                       └── compiler/
    │                           ├── ElementUtils.java
    │                           ├── HttpServiceProcessor2.java
    │                           └── create/
    │                               └── CreateClassUtils.java
    ├── gradle/
    │   └── wrapper/
    │       ├── gradle-wrapper.jar
    │       └── gradle-wrapper.properties
    ├── gradle.properties
    ├── gradlew
    ├── gradlew.bat
    ├── install.gradle
    ├── jitpack.gradle
    ├── settings.gradle
    ├── versions.gradle
    └── xretrofit/
        ├── .gitignore
        ├── build.gradle
        ├── proguard-rules.pro
        └── src/
            └── main/
                ├── AndroidManifest.xml
                └── java/
                    └── com/
                        └── xretrofit/
                            ├── CallAdapter/
                            │   ├── CallAdapter.java
                            │   ├── MCallAdapter.java
                            │   ├── ObjectCallAdapter.java
                            │   ├── ObjectCallAdapterFactory.java
                            │   └── ProgressCallAdapter.java
                            ├── HttpException.java
                            ├── HttpManager.java
                            ├── Interceptor/
                            │   ├── DownloadResponseBody.java
                            │   ├── ProgressListener.java
                            │   └── UploadRequestBodyBody.java
                            ├── Response.java
                            ├── bean/
                            │   └── RequestParams.java
                            ├── call/
                            │   ├── Call.java
                            │   ├── OkHttpCall.java
                            │   └── ProgressCall.java
                            ├── callback/
                            │   ├── CallBack.java
                            │   └── ProgressCallBack.java
                            ├── converter/
                            │   ├── Converter.java
                            │   ├── DownloadConverterFactories.java
                            │   ├── DownloadResponseConverter.java
                            │   ├── StringConverterFactories.java
                            │   ├── StringResponseConverter.java
                            │   ├── UploadConverterFactories.java
                            │   └── UploadRequestConverter.java
                            ├── method/
                            │   ├── MethodAnnotation.java
                            │   ├── ParamAnnotation.java
                            │   └── ServiceMethod.java
                            ├── okhttp/
                            │   └── SslUtils.java
                            └── utils/
                                ├── UrlUtils.java
                                └── Utils.java
Download .txt
SYMBOL INDEX (282 symbols across 48 files)

FILE: XRetrofit/app/src/main/java/com/yanxuwen/xretrofit/MainActivity.java
  class MainActivity (line 35) | public class MainActivity extends AppCompatActivity {
    method onCreate (line 37) | @Override
    method isMainThread (line 43) | public boolean isMainThread() {
    method onGet (line 50) | public void onGet(View view) {
    method onGet2 (line 81) | public void onGet2(View view) {
    method postForm (line 106) | public void postForm(View view) {
    method postJson (line 124) | public void postJson(View view) {
    method postJson2 (line 143) | public void postJson2(View view) {
    method postJson3 (line 164) | public void postJson3(View view) {
    method onPut (line 184) | public void onPut(View view) {
    method onDelete (line 202) | public void onDelete(View view) {
    method onDownload (line 217) | public void onDownload(View v) {
    method onUpload (line 251) | public void onUpload(View v) {

FILE: XRetrofit/app/src/main/java/com/yanxuwen/xretrofit/MyApplication.java
  class MyApplication (line 17) | public class MyApplication extends Application {
    method onCreate (line 18) | @Override
    method init (line 24) | public void init() {
    class TrustAllHostnameVerifier (line 46) | private static class TrustAllHostnameVerifier implements HostnameVerif...
      method verify (line 47) | @Override

FILE: XRetrofit/app/src/main/java/com/yanxuwen/xretrofit/RxSchedulers.java
  class RxSchedulers (line 21) | public class RxSchedulers {
    method applySchedulers (line 22) | public static <T> ObservableConverter<T, ObservableSubscribeProxy> app...

FILE: XRetrofit/app/src/main/java/com/yanxuwen/xretrofit/bean/HomeInfoV5.java
  class HomeInfoV5 (line 8) | public class HomeInfoV5 {
    method getMsg (line 12) | public String getMsg() {
    method setMsg (line 16) | public void setMsg(String msg) {

FILE: XRetrofit/app/src/main/java/com/yanxuwen/xretrofit/bean/LoginBuild.java
  class LoginBuild (line 3) | public class LoginBuild {
    method getUserId (line 13) | public String getUserId() {
    method setUserId (line 17) | public void setUserId(String userId) {
    method getMsg (line 21) | public String getMsg() {
    method setMsg (line 25) | public void setMsg(String msg) {

FILE: XRetrofit/app/src/main/java/com/yanxuwen/xretrofit/callback/MyCallBack.java
  class MyCallBack (line 19) | public abstract class MyCallBack<T> implements CallBack<T> {
    method MyCallBack (line 23) | public MyCallBack() {
    method MyCallBack (line 26) | public MyCallBack(FragmentActivity activity) {
    method onStart (line 30) | @Override
    method onSuccess (line 44) | @Override
    method onFail (line 54) | @Override
    method success (line 64) | public abstract void success(T t);
    method fail (line 66) | public abstract void fail(String msg);
    method cancel (line 68) | public void cancel(){

FILE: XRetrofit/app/src/main/java/com/yanxuwen/xretrofit/callback/MyProgressCallBack.java
  class MyProgressCallBack (line 7) | public abstract class MyProgressCallBack<T> extends ProgressCallBack<T> {
    method onStart (line 9) | @Override
    method onSuccess (line 14) | @Override
    method onFail (line 24) | @Override
    method success (line 30) | public abstract void success(T t);
    method fail (line 32) | public abstract void fail(String msg);

FILE: XRetrofit/app/src/main/java/com/yanxuwen/xretrofit/callback/ServerException.java
  class ServerException (line 12) | public class ServerException {
    method handleException (line 14) | public static  String handleException(Throwable e) {

FILE: XRetrofit/app/src/main/java/com/yanxuwen/xretrofit/converter/GsonConverterFactories.java
  class GsonConverterFactories (line 19) | public class GsonConverterFactories extends Converter.Factory {
    method create (line 21) | public static GsonConverterFactories create() {
    method requestBodyConverter (line 25) | @Nullable
    method responseBodyConverter (line 34) | @Nullable

FILE: XRetrofit/app/src/main/java/com/yanxuwen/xretrofit/converter/GsonRequestConverter.java
  class GsonRequestConverter (line 15) | class GsonRequestConverter<T> implements Converter<T, RequestBody> {
    method convert (line 19) | @Override

FILE: XRetrofit/app/src/main/java/com/yanxuwen/xretrofit/converter/GsonResponseConverter.java
  class GsonResponseConverter (line 17) | public class GsonResponseConverter<T> implements Converter<ResponseBody,...
    method GsonResponseConverter (line 21) | protected GsonResponseConverter(Type responseType){
    method convert (line 26) | @Override

FILE: XRetrofit/app/src/main/java/com/yanxuwen/xretrofit/converter/Rxjava2CallAdapter.java
  class Rxjava2CallAdapter (line 24) | class Rxjava2CallAdapter<T> implements CallAdapter<Observable, T> {
    method Rxjava2CallAdapter (line 28) | protected Rxjava2CallAdapter(Type responseType) {
    method responseType (line 33) | @Override
    method adapt (line 39) | @Override
    class CallExecuteObservable (line 45) | final class CallExecuteObservable<T> extends Observable<T> {
      method CallExecuteObservable (line 49) | CallExecuteObservable(Call<T> call) {
      method subscribeActual (line 54) | @Override
    class CallDisposable (line 89) | private static final class CallDisposable implements Disposable {
      method CallDisposable (line 93) | CallDisposable(Call<?> call) {
      method dispose (line 98) | @Override
      method isDisposed (line 106) | @Override

FILE: XRetrofit/app/src/main/java/com/yanxuwen/xretrofit/converter/Rxjava2CallAdapterFactories.java
  class Rxjava2CallAdapterFactories (line 18) | public class Rxjava2CallAdapterFactories<T> extends CallAdapter.Factory {
    method create (line 20) | public static Rxjava2CallAdapterFactories create() {
    method get (line 25) | @Nullable

FILE: XRetrofit/app/src/main/java/com/yanxuwen/xretrofit/http/HttpRequest.java
  class HttpRequest (line 5) | public class HttpRequest {
    method getNetService (line 9) | public static NetService getNetService() {

FILE: XRetrofit/app/src/main/java/com/yanxuwen/xretrofit/http/NetService.java
  type NetService (line 24) | @NetServiceClass
    method get (line 29) | @GET("api/manage-home/v5/home/detail-v2")
    method get (line 35) | @GET("api/manage-home/v5/home/{version}")
    method postForm (line 41) | @FORM
    method postJson (line 48) | @POST("https://bx-co-uat-appgateway.bsnlco.com/api/customer/v1/open/us...
    method postJson2 (line 54) | @POST("https://bx-co-uat-appgateway.bsnlco.com/api/customer/v1/open/us...
    method postJson (line 60) | @POST("https://bx-co-uat-appgateway.bsnlco.com/api/customer/v1/open/us...
    method put (line 66) | @PUT("http://api.sdwhcn.com:5056/v1/member")
    method delete (line 72) | @DELETE("http://api.sdwhcn.com:5056/v1/member_collect_article/{id}")
    method download (line 78) | @DOWNLOAD("https://ztjyupdate.ztjy61.com/333897c77ec9a86605006679c7a4b...
    method upload (line 84) | @UPLOAD("https://bxuatapi.bisinuolan.cn/api/bsnl-oss/appUploadShot")

FILE: XRetrofit/compiler/src/main/java/com/xretrofit/compiler/ElementUtils.java
  class ElementUtils (line 6) | @SuppressWarnings("unchecked")
    method getImplName (line 10) | public static String getImplName(Class<?> clazz) {

FILE: XRetrofit/compiler/src/main/java/com/xretrofit/compiler/HttpServiceProcessor2.java
  class HttpServiceProcessor2 (line 33) | @AutoService(Processor.class)
    method init (line 41) | @Override
    method getSupportedAnnotationTypes (line 52) | @Override
    method getSupportedSourceVersion (line 62) | @Override
    method process (line 69) | @Override
    method getKey (line 122) | public String getKey(TypeElement classElement) {

FILE: XRetrofit/compiler/src/main/java/com/xretrofit/compiler/create/CreateClassUtils.java
  class CreateClassUtils (line 32) | public class CreateClassUtils {
    method CreateClassUtils (line 43) | public CreateClassUtils(Elements elementUtils, TypeElement classElemen...
    method generateJavaCode (line 60) | public TypeSpec generateJavaCode() {
    method addMethod (line 82) | private List<MethodSpec> addMethod() {
    method addParameters (line 110) | private List<ParameterSpec> addParameters(ExecutableElement executable...
    method addStatement (line 134) | private void addStatement(MethodSpec.Builder builder, ExecutableElemen...

FILE: XRetrofit/xretrofit/src/main/java/com/xretrofit/CallAdapter/CallAdapter.java
  type CallAdapter (line 19) | public interface CallAdapter<R, T>{
    method adapt (line 20) | R adapt(Call<T> call);
    method responseType (line 25) | Type responseType();
    class Factory (line 27) | abstract class Factory {
      method get (line 31) | public abstract @Nullable CallAdapter<?, ?> get(Type returnType);
      method getRawType (line 33) | protected static Class<?> getRawType(Type type) {

FILE: XRetrofit/xretrofit/src/main/java/com/xretrofit/CallAdapter/MCallAdapter.java
  class MCallAdapter (line 13) | public class MCallAdapter<T> implements CallAdapter<Call,T> {
    method MCallAdapter (line 17) | protected MCallAdapter(Type responseType){
    method responseType (line 22) | @Override
    method adapt (line 28) | @Override

FILE: XRetrofit/xretrofit/src/main/java/com/xretrofit/CallAdapter/ObjectCallAdapter.java
  class ObjectCallAdapter (line 14) | public class ObjectCallAdapter<T> implements CallAdapter<Object,T> {
    method ObjectCallAdapter (line 18) | protected ObjectCallAdapter(Type responseType){
    method responseType (line 22) | @Override
    method adapt (line 27) | @Override

FILE: XRetrofit/xretrofit/src/main/java/com/xretrofit/CallAdapter/ObjectCallAdapterFactory.java
  class ObjectCallAdapterFactory (line 17) | public class ObjectCallAdapterFactory extends CallAdapter.Factory {
    method create (line 19) | public static ObjectCallAdapterFactory create() {
    method get (line 24) | @Nullable

FILE: XRetrofit/xretrofit/src/main/java/com/xretrofit/CallAdapter/ProgressCallAdapter.java
  class ProgressCallAdapter (line 14) | public class ProgressCallAdapter<T> implements CallAdapter<ProgressCall,...
    method ProgressCallAdapter (line 18) | protected ProgressCallAdapter(Type responseType){
    method adapt (line 22) | @Override
    method responseType (line 30) | @Override

FILE: XRetrofit/xretrofit/src/main/java/com/xretrofit/HttpException.java
  class HttpException (line 22) | public class HttpException extends RuntimeException {
    method getMessage (line 23) | private static String getMessage(Response<?> response) {
    method HttpException (line 32) | public HttpException(Response<?> response) {
    method code (line 40) | public int code() {
    method message (line 45) | public String message() {
    method response (line 52) | public Response<?> response() {

FILE: XRetrofit/xretrofit/src/main/java/com/xretrofit/HttpManager.java
  class HttpManager (line 28) | public final class HttpManager {
    method getInstance (line 35) | public static HttpManager getInstance() {
    method HttpManager (line 47) | HttpManager() {
    method callFactory (line 51) | public okhttp3.Call.Factory callFactory() {
    method getOkHttpDownloadClient (line 62) | public OkHttpClient getOkHttpDownloadClient(Interceptor interceptor) {
    method getOkHttpClient (line 78) | public OkHttpClient getOkHttpClient() {
    method setData (line 90) | void setData(@Nullable Call.Factory callFactory, String baseUrl,
    method Builder (line 108) | public static Builder Builder() {
      method Builder (line 119) | public Builder() {
      method baseUrl (line 122) | public Builder baseUrl(String baseUrl) {
      method addConverterFactory (line 127) | public Builder addConverterFactory(Converter.Factory factory) {
      method addCallAdapterFactory (line 132) | public Builder addCallAdapterFactory(CallAdapter.Factory factory) {
      method client (line 137) | public Builder client(OkHttpClient client) {
      method callFactory (line 141) | public Builder callFactory(okhttp3.Call.Factory factory) {
      method build (line 146) | public void build() {
    class Builder (line 112) | public static final class Builder {
      method Builder (line 119) | public Builder() {
      method baseUrl (line 122) | public Builder baseUrl(String baseUrl) {
      method addConverterFactory (line 127) | public Builder addConverterFactory(Converter.Factory factory) {
      method addCallAdapterFactory (line 132) | public Builder addCallAdapterFactory(CallAdapter.Factory factory) {
      method client (line 137) | public Builder client(OkHttpClient client) {
      method callFactory (line 141) | public Builder callFactory(okhttp3.Call.Factory factory) {
      method build (line 146) | public void build() {
    method getImplName (line 157) | public static String getImplName(Class<?> clazz) {

FILE: XRetrofit/xretrofit/src/main/java/com/xretrofit/Interceptor/DownloadResponseBody.java
  class DownloadResponseBody (line 19) | public class DownloadResponseBody extends ResponseBody {
    method setProgressListener (line 29) | public void setProgressListener(ProgressListener progressListener) {
    method DownloadResponseBody (line 33) | public DownloadResponseBody(Response originalResponse, long startsPoin...
    method contentType (line 39) | @Override
    method contentLength (line 44) | @Override
    method setMaxProgress (line 49) | public void setMaxProgress(long maxProgress) {
    method source (line 53) | @Override
    method getFile (line 70) | public File getFile() {
    method setFile (line 74) | public void setFile(File file) {
    method getStartsPoint (line 78) | public long getStartsPoint() {

FILE: XRetrofit/xretrofit/src/main/java/com/xretrofit/Interceptor/ProgressListener.java
  class ProgressListener (line 8) | public class ProgressListener {
    method setProgress (line 9) | public void setProgress(float progress) {
    type Listener (line 15) | public interface Listener {
      method progress (line 16) | public void progress(float progress);
    method setProgressListener (line 21) | public void setProgressListener(Listener listener) {

FILE: XRetrofit/xretrofit/src/main/java/com/xretrofit/Interceptor/UploadRequestBodyBody.java
  class UploadRequestBodyBody (line 17) | public class UploadRequestBodyBody extends RequestBody {
    method setProgressListener (line 24) | public void setProgressListener(ProgressListener progressListener) {
    method UploadRequestBodyBody (line 28) | public UploadRequestBodyBody(RequestBody requestBody) {
    method contentLength (line 33) | @Override
    method contentType (line 45) | @Override
    method writeTo (line 50) | @Override
    class ByteSink (line 59) | private final class ByteSink extends ForwardingSink {
      method ByteSink (line 63) | ByteSink(Sink delegate) {
      method write (line 67) | @Override

FILE: XRetrofit/xretrofit/src/main/java/com/xretrofit/Response.java
  class Response (line 18) | public final class Response<T> {
    method Response (line 25) | private Response(okhttp3.Response rawResponse, @Nullable T body,
    method success (line 33) | public static <T> Response<T> success(@Nullable T body, okhttp3.Respon...
    method error (line 45) | public static <T> Response<T> error(ResponseBody body, okhttp3.Respons...
    method raw (line 55) | public okhttp3.Response raw() {
    method code (line 60) | public int code() {
    method message (line 65) | public String message() {
    method headers (line 70) | public Headers headers() {
    method isSuccessful (line 75) | public boolean isSuccessful() {
    method body (line 80) | public @Nullable T body() {
    method errorBody (line 85) | public @Nullable ResponseBody errorBody() {
    method toString (line 89) | @Override public String toString() {

FILE: XRetrofit/xretrofit/src/main/java/com/xretrofit/bean/RequestParams.java
  class RequestParams (line 9) | public class RequestParams {
    method getUrl (line 15) | public String getUrl() {
    method setUrl (line 19) | public void setUrl(String url) {
    method getParams (line 24) | public Map<String, Object> getParams() {
    method setParams (line 31) | public void setParams(Map<String, Object> params) {
    method getHeaders (line 36) | public Map<String, String> getHeaders() {
    method setHeaders (line 44) | public void setHeaders(Map<String, String> headers) {
    method addParams (line 48) | public void addParams(String key, String value) {
    method addHeader (line 52) | public void addHeader(String key, String value) {
    method isForm (line 56) | public boolean isForm() {
    method setForm (line 60) | public void setForm(boolean form) {

FILE: XRetrofit/xretrofit/src/main/java/com/xretrofit/call/Call.java
  type Call (line 16) | public interface Call<T> {
    method init (line 21) | void init(Converter<ResponseBody, T> responseConverter);
    method enqueue (line 26) | void enqueue(CallBack<T> callback);
    method execute (line 32) | Response<T> execute() throws Exception;
    method cancel (line 35) | void cancel();
    method isCanceled (line 37) | boolean isCanceled();
    method clone (line 39) | Call<T> clone();

FILE: XRetrofit/xretrofit/src/main/java/com/xretrofit/call/OkHttpCall.java
  class OkHttpCall (line 25) | public class OkHttpCall<T> implements Call<T> {
    method OkHttpCall (line 31) | public OkHttpCall(okhttp3.Call call) {
    method init (line 35) | @Override
    method enqueue (line 43) | @Override
    method execute (line 98) | @Override
    method cancel (line 107) | @Override
    method isCanceled (line 115) | @Override public boolean isCanceled() {
    method clone (line 124) | @Override
    method parseResponse (line 134) | protected Response<T> parseResponse(okhttp3.Response rawResponse) thro...
    class NoContentResponseBody (line 171) | static final class NoContentResponseBody extends ResponseBody {
      method NoContentResponseBody (line 175) | NoContentResponseBody(MediaType contentType, long contentLength) {
      method contentType (line 180) | @Override
      method contentLength (line 185) | @Override
      method source (line 190) | @Override

FILE: XRetrofit/xretrofit/src/main/java/com/xretrofit/call/ProgressCall.java
  class ProgressCall (line 17) | public class ProgressCall<T> extends OkHttpCall<T> {
    method ProgressCall (line 26) | public ProgressCall(Call call, ProgressListener... listeners) {
    method enqueue (line 31) | @Override

FILE: XRetrofit/xretrofit/src/main/java/com/xretrofit/callback/CallBack.java
  type CallBack (line 7) | public interface CallBack<T> {
    method onStart (line 9) | void onStart(Call<T> call);
    method onSuccess (line 11) | void onSuccess(Call<T> call, Response<T> response);
    method onFail (line 13) | void onFail(Call<T> call, final Throwable e);

FILE: XRetrofit/xretrofit/src/main/java/com/xretrofit/callback/ProgressCallBack.java
  class ProgressCallBack (line 3) | public abstract class ProgressCallBack<T> implements CallBack<T> {
    method onProgress (line 8) | public abstract void onProgress(float progress);

FILE: XRetrofit/xretrofit/src/main/java/com/xretrofit/converter/Converter.java
  type Converter (line 24) | public interface Converter<F, T> {
    method convert (line 25) | T convert(F value) throws Exception;
    class Factory (line 27) | abstract class Factory {
      method requestBodyConverter (line 35) | public @Nullable Converter<?, RequestBody> requestBodyConverter(Type...
      method stringConverter (line 50) | public @Nullable Converter<?, String> stringConverter(Type request,T...
      method responseBodyConverter (line 60) | public @Nullable Converter<ResponseBody, ?> responseBodyConverter(Ty...
      method getRawType (line 64) | protected static Class<?> getRawType(Type type) {

FILE: XRetrofit/xretrofit/src/main/java/com/xretrofit/converter/DownloadConverterFactories.java
  class DownloadConverterFactories (line 17) | public class DownloadConverterFactories extends Converter.Factory {
    method create (line 19) | public static DownloadConverterFactories create() {
    method responseBodyConverter (line 24) | @Nullable

FILE: XRetrofit/xretrofit/src/main/java/com/xretrofit/converter/DownloadResponseConverter.java
  class DownloadResponseConverter (line 18) | public class DownloadResponseConverter<T> implements Converter<ResponseB...
    method convert (line 20) | @Override

FILE: XRetrofit/xretrofit/src/main/java/com/xretrofit/converter/StringConverterFactories.java
  class StringConverterFactories (line 16) | public class StringConverterFactories extends Converter.Factory {
    method create (line 18) | public static StringConverterFactories create() {
    method responseBodyConverter (line 23) | @Nullable

FILE: XRetrofit/xretrofit/src/main/java/com/xretrofit/converter/StringResponseConverter.java
  class StringResponseConverter (line 12) | public class StringResponseConverter<T> implements Converter<ResponseBod...
    method convert (line 15) | @Override

FILE: XRetrofit/xretrofit/src/main/java/com/xretrofit/converter/UploadConverterFactories.java
  class UploadConverterFactories (line 17) | public class UploadConverterFactories extends Converter.Factory {
    method create (line 19) | public static UploadConverterFactories create() {
    method requestBodyConverter (line 23) | @Nullable

FILE: XRetrofit/xretrofit/src/main/java/com/xretrofit/converter/UploadRequestConverter.java
  class UploadRequestConverter (line 12) | public class UploadRequestConverter<T> implements Converter<T, RequestBo...
    method convert (line 14) | @Override

FILE: XRetrofit/xretrofit/src/main/java/com/xretrofit/method/MethodAnnotation.java
  class MethodAnnotation (line 11) | public class MethodAnnotation {
    method MethodAnnotation (line 15) | public MethodAnnotation(Class annotation , List<Object> key){
    method getAnnotation (line 21) | public Class getAnnotation() {
    method getKey (line 28) | public String getKey() {
    method getKeys (line 41) | public List<Object> getKeys() {

FILE: XRetrofit/xretrofit/src/main/java/com/xretrofit/method/ParamAnnotation.java
  class ParamAnnotation (line 11) | public class ParamAnnotation {
    method ParamAnnotation (line 16) | public ParamAnnotation(Class annotation, List<Object> key, Object valu...
    method getAnnotation (line 22) | public Class getAnnotation() {
    method getKey (line 29) | public String getKey() {
    method getValue (line 39) | public Object getValue() {
    method setValue (line 43) | public void setValue(Object value) {

FILE: XRetrofit/xretrofit/src/main/java/com/xretrofit/method/ServiceMethod.java
  class ServiceMethod (line 54) | public class ServiceMethod {
    method request (line 66) | public <R> R request(Map<Class, MethodAnnotation> mapMa, List<ParamAnn...
    method buildHeaders (line 254) | private void buildHeaders(Map<Class, MethodAnnotation> mapMa, List<Par...
    method buildUrl (line 279) | private void buildUrl(String url, List<ParamAnnotation> listPA) {
    method addMapParmsToFromBody (line 300) | private void addMapParmsToFromBody(Map<String, Object> params, FormBod...
    method buildRequest (line 319) | private Request buildRequest(Class annotation, RequestBody body) {
    method createRequestConverter (line 345) | private <T> Converter<T, RequestBody> createRequestConverter(Type requ...
    method createResponseConverter (line 358) | public <T> Converter<ResponseBody, T> createResponseConverter(Type req...
    method createCallAdapter (line 372) | private CallAdapter<?, ?> createCallAdapter(Type type) {
    method adapt (line 385) | private <R> R adapt(Type request, Call call, Type returnType) {

FILE: XRetrofit/xretrofit/src/main/java/com/xretrofit/okhttp/SslUtils.java
  class SslUtils (line 22) | public class SslUtils {
    class SSLParams (line 24) | public static class SSLParams {
    method getSslSocketFactory (line 32) | public static SSLParams getSslSocketFactory() {
    method getSslSocketFactory (line 40) | public static SSLParams getSslSocketFactory(X509TrustManager trustMana...
    method getSslSocketFactory (line 48) | public static SSLParams getSslSocketFactory(InputStream... certificate...
    method getSslSocketFactory (line 57) | public static SSLParams getSslSocketFactory(InputStream bksFile, Strin...
    method getSslSocketFactory (line 66) | public static SSLParams getSslSocketFactory(InputStream bksFile, Strin...
    method getSslSocketFactoryBase (line 70) | private static SSLParams getSslSocketFactoryBase(X509TrustManager trus...
    method prepareKeyManager (line 102) | private static KeyManager[] prepareKeyManager(InputStream bksFile, Str...
    method prepareTrustManager (line 115) | private static TrustManager[] prepareTrustManager(InputStream... certi...
    method chooseTrustManager (line 145) | private static X509TrustManager chooseTrustManager(TrustManager[] trus...
    method checkClientTrusted (line 159) | @Override
    method checkServerTrusted (line 163) | @Override
    method getAcceptedIssuers (line 167) | @Override

FILE: XRetrofit/xretrofit/src/main/java/com/xretrofit/utils/UrlUtils.java
  class UrlUtils (line 7) | public class UrlUtils {
    method urlJoint (line 13) | public static String urlJoint(String url, Map<String, Object> params) {

FILE: XRetrofit/xretrofit/src/main/java/com/xretrofit/utils/Utils.java
  class Utils (line 23) | public final class Utils {
    method checkNotNull (line 24) | public static <T> T checkNotNull(@Nullable T object, String message) {
    method buffer (line 31) | public static ResponseBody buffer(final ResponseBody body) throws IOEx...
    method getCallResponseType (line 40) | public static Type getCallResponseType(Type returnType) {
    method getParameterUpperBound (line 53) | public static Type getParameterUpperBound(int index, ParameterizedType...
    method getRawType (line 66) | public static Class<?> getRawType(Type type) {
    method guessMimeType (line 102) | public static String guessMimeType(String fileName) {
Condensed preview — 98 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (174K chars).
[
  {
    "path": "README.md",
    "chars": 6393,
    "preview": "#### 介绍\nXRetrofit   是一个极致模仿Retrofit 的风格代码,代码没有Retrofit 复杂,简单易懂。\n####\n 支持`get`、`post`、`put`、`delete` 请求,这些使用都一样。\n简化文件上传,跟"
  },
  {
    "path": "XRetrofit/.gitignore",
    "chars": 546,
    "preview": "# Built application files\n*.apk\n*.ap_\n\n# Files for the ART/Dalvik VM\n*.dex\n\n# Java class files\n*.class\n\n# Generated file"
  },
  {
    "path": "XRetrofit/Could",
    "chars": 0,
    "preview": ""
  },
  {
    "path": "XRetrofit/annotations/.gitignore",
    "chars": 6,
    "preview": "/build"
  },
  {
    "path": "XRetrofit/annotations/build.gradle",
    "chars": 424,
    "preview": "apply plugin: 'java'\n\next {\n    bintrayName = 'annotations'\n    artifact = bintrayName\n    libraryName = 'xretrofit-anno"
  },
  {
    "path": "XRetrofit/annotations/src/main/java/com/yanxuwen/xretrofit_annotations/annotation/method/DELETE.java",
    "chars": 507,
    "preview": "//\n// Source code recreated from a .class file by IntelliJ IDEA\n// (powered by Fernflower decompiler)\n//\n\npackage com.ya"
  },
  {
    "path": "XRetrofit/annotations/src/main/java/com/yanxuwen/xretrofit_annotations/annotation/method/DOWNLOAD.java",
    "chars": 509,
    "preview": "//\n// Source code recreated from a .class file by IntelliJ IDEA\n// (powered by Fernflower decompiler)\n//\n\npackage com.ya"
  },
  {
    "path": "XRetrofit/annotations/src/main/java/com/yanxuwen/xretrofit_annotations/annotation/method/FORM.java",
    "chars": 496,
    "preview": "//\n// Source code recreated from a .class file by IntelliJ IDEA\n// (powered by Fernflower decompiler)\n//\n\npackage com.ya"
  },
  {
    "path": "XRetrofit/annotations/src/main/java/com/yanxuwen/xretrofit_annotations/annotation/method/GET.java",
    "chars": 504,
    "preview": "//\n// Source code recreated from a .class file by IntelliJ IDEA\n// (powered by Fernflower decompiler)\n//\n\npackage com.ya"
  },
  {
    "path": "XRetrofit/annotations/src/main/java/com/yanxuwen/xretrofit_annotations/annotation/method/Headers.java",
    "chars": 536,
    "preview": "//\n// Source code recreated from a .class file by IntelliJ IDEA\n// (powered by Fernflower decompiler)\n//\n\npackage com.ya"
  },
  {
    "path": "XRetrofit/annotations/src/main/java/com/yanxuwen/xretrofit_annotations/annotation/method/POST.java",
    "chars": 506,
    "preview": "//\n// Source code recreated from a .class file by IntelliJ IDEA\n// (powered by Fernflower decompiler)\n//\n\npackage com.ya"
  },
  {
    "path": "XRetrofit/annotations/src/main/java/com/yanxuwen/xretrofit_annotations/annotation/method/PUT.java",
    "chars": 504,
    "preview": "//\n// Source code recreated from a .class file by IntelliJ IDEA\n// (powered by Fernflower decompiler)\n//\n\npackage com.ya"
  },
  {
    "path": "XRetrofit/annotations/src/main/java/com/yanxuwen/xretrofit_annotations/annotation/method/UPLOAD.java",
    "chars": 507,
    "preview": "//\n// Source code recreated from a .class file by IntelliJ IDEA\n// (powered by Fernflower decompiler)\n//\n\npackage com.ya"
  },
  {
    "path": "XRetrofit/annotations/src/main/java/com/yanxuwen/xretrofit_annotations/annotation/param/Body.java",
    "chars": 476,
    "preview": "//\n// Source code recreated from a .class file by IntelliJ IDEA\n// (powered by Fernflower decompiler)\n//\n\npackage com.ya"
  },
  {
    "path": "XRetrofit/annotations/src/main/java/com/yanxuwen/xretrofit_annotations/annotation/param/FilePath.java",
    "chars": 534,
    "preview": "//\n// Source code recreated from a .class file by IntelliJ IDEA\n// (powered by Fernflower decompiler)\n//\n\npackage com.ya"
  },
  {
    "path": "XRetrofit/annotations/src/main/java/com/yanxuwen/xretrofit_annotations/annotation/param/Header.java",
    "chars": 535,
    "preview": "//\n// Source code recreated from a .class file by IntelliJ IDEA\n// (powered by Fernflower decompiler)\n//\n\npackage com.ya"
  },
  {
    "path": "XRetrofit/annotations/src/main/java/com/yanxuwen/xretrofit_annotations/annotation/param/Param.java",
    "chars": 497,
    "preview": "//\n// Source code recreated from a .class file by IntelliJ IDEA\n// (powered by Fernflower decompiler)\n//\n\npackage com.ya"
  },
  {
    "path": "XRetrofit/annotations/src/main/java/com/yanxuwen/xretrofit_annotations/annotation/param/Path.java",
    "chars": 534,
    "preview": "//\n// Source code recreated from a .class file by IntelliJ IDEA\n// (powered by Fernflower decompiler)\n//\n\npackage com.ya"
  },
  {
    "path": "XRetrofit/annotations/src/main/java/com/yanxuwen/xretrofit_annotations/annotation/param/Query.java",
    "chars": 497,
    "preview": "//\n// Source code recreated from a .class file by IntelliJ IDEA\n// (powered by Fernflower decompiler)\n//\n\npackage com.ya"
  },
  {
    "path": "XRetrofit/annotations/src/main/java/com/yanxuwen/xretrofit_annotations/annotation/service/NetServiceClass.java",
    "chars": 357,
    "preview": "package com.yanxuwen.xretrofit_annotations.annotation.service;\n\nimport java.lang.annotation.ElementType;\nimport java.lan"
  },
  {
    "path": "XRetrofit/app/.gitignore",
    "chars": 7,
    "preview": "/build\n"
  },
  {
    "path": "XRetrofit/app/build.gradle",
    "chars": 1496,
    "preview": "apply plugin: 'com.android.application'\n\nandroid {\n    compileSdkVersion build_versions.target_sdk\n    buildToolsVersion"
  },
  {
    "path": "XRetrofit/app/proguard-rules.pro",
    "chars": 751,
    "preview": "# Add project specific ProGuard rules here.\n# You can control the set of applied configuration files using the\n# proguar"
  },
  {
    "path": "XRetrofit/app/src/main/AndroidManifest.xml",
    "chars": 1049,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<manifest xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    package="
  },
  {
    "path": "XRetrofit/app/src/main/java/com/yanxuwen/xretrofit/MainActivity.java",
    "chars": 9752,
    "preview": "package com.yanxuwen.xretrofit;\n\nimport android.Manifest;\nimport android.os.Bundle;\nimport android.os.Environment;\nimpor"
  },
  {
    "path": "XRetrofit/app/src/main/java/com/yanxuwen/xretrofit/MyApplication.java",
    "chars": 1757,
    "preview": "package com.yanxuwen.xretrofit;\n\nimport android.app.Application;\n\nimport com.xretrofit.HttpManager;\nimport com.xretrofit"
  },
  {
    "path": "XRetrofit/app/src/main/java/com/yanxuwen/xretrofit/RxSchedulers.java",
    "chars": 1263,
    "preview": "package com.yanxuwen.xretrofit;\n\nimport androidx.lifecycle.Lifecycle;\nimport androidx.lifecycle.LifecycleOwner;\n\nimport "
  },
  {
    "path": "XRetrofit/app/src/main/java/com/yanxuwen/xretrofit/bean/HomeInfoV5.java",
    "chars": 289,
    "preview": "package com.yanxuwen.xretrofit.bean;\n\n/**\n * @author bsnl_yanxuwen\n * @date 2021/2/19 9:21\n * Description :\n */\npublic c"
  },
  {
    "path": "XRetrofit/app/src/main/java/com/yanxuwen/xretrofit/bean/LoginBuild.java",
    "chars": 458,
    "preview": "package com.yanxuwen.xretrofit.bean;\n\npublic class LoginBuild {\n\n    /**\n     * password : “123456”\n     * mobile : “150"
  },
  {
    "path": "XRetrofit/app/src/main/java/com/yanxuwen/xretrofit/callback/MyCallBack.java",
    "chars": 1605,
    "preview": "package com.yanxuwen.xretrofit.callback;\n\nimport android.util.Log;\n\nimport androidx.fragment.app.FragmentActivity;\nimpor"
  },
  {
    "path": "XRetrofit/app/src/main/java/com/yanxuwen/xretrofit/callback/MyProgressCallBack.java",
    "chars": 733,
    "preview": "package com.yanxuwen.xretrofit.callback;\n\nimport com.xretrofit.Response;\nimport com.xretrofit.call.Call;\nimport com.xret"
  },
  {
    "path": "XRetrofit/app/src/main/java/com/yanxuwen/xretrofit/callback/ServerException.java",
    "chars": 1440,
    "preview": "package com.yanxuwen.xretrofit.callback;\n\nimport org.apache.http.conn.ConnectTimeoutException;\nimport org.json.JSONExcep"
  },
  {
    "path": "XRetrofit/app/src/main/java/com/yanxuwen/xretrofit/converter/GsonConverterFactories.java",
    "chars": 1065,
    "preview": "package com.yanxuwen.xretrofit.converter;\n\nimport com.xretrofit.converter.Converter;\n\nimport org.jetbrains.annotations.N"
  },
  {
    "path": "XRetrofit/app/src/main/java/com/yanxuwen/xretrofit/converter/GsonRequestConverter.java",
    "chars": 632,
    "preview": "package com.yanxuwen.xretrofit.converter;\n\nimport com.alibaba.fastjson.JSONObject;\nimport com.xretrofit.converter.Conver"
  },
  {
    "path": "XRetrofit/app/src/main/java/com/yanxuwen/xretrofit/converter/GsonResponseConverter.java",
    "chars": 697,
    "preview": "package com.yanxuwen.xretrofit.converter;\n\nimport com.alibaba.fastjson.JSONObject;\nimport com.xretrofit.converter.Conver"
  },
  {
    "path": "XRetrofit/app/src/main/java/com/yanxuwen/xretrofit/converter/Rxjava2CallAdapter.java",
    "chars": 3054,
    "preview": "package com.yanxuwen.xretrofit.converter;\n\nimport com.xretrofit.CallAdapter.CallAdapter;\nimport com.xretrofit.HttpExcept"
  },
  {
    "path": "XRetrofit/app/src/main/java/com/yanxuwen/xretrofit/converter/Rxjava2CallAdapterFactories.java",
    "chars": 867,
    "preview": "package com.yanxuwen.xretrofit.converter;\n\nimport com.xretrofit.CallAdapter.CallAdapter;\nimport com.xretrofit.utils.Util"
  },
  {
    "path": "XRetrofit/app/src/main/java/com/yanxuwen/xretrofit/http/HttpRequest.java",
    "chars": 676,
    "preview": "package com.yanxuwen.xretrofit.http;\n\nimport com.xretrofit.HttpManager;\n\npublic class HttpRequest {\n\n    private static "
  },
  {
    "path": "XRetrofit/app/src/main/java/com/yanxuwen/xretrofit/http/NetService.java",
    "chars": 3091,
    "preview": "package com.yanxuwen.xretrofit.http;\n\nimport com.xretrofit.call.Call;\nimport com.xretrofit.call.ProgressCall;\nimport com"
  },
  {
    "path": "XRetrofit/app/src/main/res/drawable/ic_launcher_background.xml",
    "chars": 5606,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<vector xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    android:wi"
  },
  {
    "path": "XRetrofit/app/src/main/res/drawable-v24/ic_launcher_foreground.xml",
    "chars": 1880,
    "preview": "<vector xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    xmlns:aapt=\"http://schemas.android.com/aapt\"\n    "
  },
  {
    "path": "XRetrofit/app/src/main/res/layout/activity_main.xml",
    "chars": 2601,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<LinearLayout\n    xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    "
  },
  {
    "path": "XRetrofit/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml",
    "chars": 272,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<adaptive-icon xmlns:android=\"http://schemas.android.com/apk/res/android\">\n    <b"
  },
  {
    "path": "XRetrofit/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml",
    "chars": 272,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<adaptive-icon xmlns:android=\"http://schemas.android.com/apk/res/android\">\n    <b"
  },
  {
    "path": "XRetrofit/app/src/main/res/values/colors.xml",
    "chars": 208,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<resources>\n    <color name=\"colorPrimary\">#008577</color>\n    <color name=\"color"
  },
  {
    "path": "XRetrofit/app/src/main/res/values/strings.xml",
    "chars": 72,
    "preview": "<resources>\n    <string name=\"app_name\">XRetrofit</string>\n</resources>\n"
  },
  {
    "path": "XRetrofit/app/src/main/res/values/styles.xml",
    "chars": 383,
    "preview": "<resources>\n\n    <!-- Base application theme. -->\n    <style name=\"AppTheme\" parent=\"Theme.AppCompat.Light.DarkActionBar"
  },
  {
    "path": "XRetrofit/app/src/main/res/xml/network_security_config.xml",
    "chars": 254,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!--解决安卓P 没有使用https的话会报 CLEARTEXT communication to api.sdwhcn.com not permitted b"
  },
  {
    "path": "XRetrofit/bintray.gradle",
    "chars": 1905,
    "preview": "// backup of [https://raw.githubusercontent.com/nuuneoi/JCenter/master/bintrayv1.gradle]\n\napply plugin: 'com.jfrog.bintr"
  },
  {
    "path": "XRetrofit/build.gradle",
    "chars": 774,
    "preview": "// Top-level build file where you can add configuration options common to all sub-projects/modules.\n\nbuildscript {\n    a"
  },
  {
    "path": "XRetrofit/compiler/.gitignore",
    "chars": 7,
    "preview": "/build\n"
  },
  {
    "path": "XRetrofit/compiler/build.gradle",
    "chars": 652,
    "preview": "apply plugin: 'java'\next {\n    bintrayName = 'compiler'\n    artifact = bintrayName\n    libraryName = 'xretrofit compiler"
  },
  {
    "path": "XRetrofit/compiler/src/main/java/com/xretrofit/compiler/ElementUtils.java",
    "chars": 326,
    "preview": "package com.xretrofit.compiler;\n\n/**\n * 这个类改版的话,HttpManager里面的getImplName 也需要改变\n */\n@SuppressWarnings(\"unchecked\")\npubli"
  },
  {
    "path": "XRetrofit/compiler/src/main/java/com/xretrofit/compiler/HttpServiceProcessor2.java",
    "chars": 4346,
    "preview": "package com.xretrofit.compiler;\n\nimport com.google.auto.service.AutoService;\nimport com.xretrofit.compiler.create.Create"
  },
  {
    "path": "XRetrofit/compiler/src/main/java/com/xretrofit/compiler/create/CreateClassUtils.java",
    "chars": 9016,
    "preview": "package com.xretrofit.compiler.create;\n\nimport com.squareup.javapoet.ClassName;\nimport com.squareup.javapoet.FieldSpec;\n"
  },
  {
    "path": "XRetrofit/gradle/wrapper/gradle-wrapper.properties",
    "chars": 232,
    "preview": "#Tue Apr 16 17:53:26 CST 2019\ndistributionBase=GRADLE_USER_HOME\ndistributionPath=wrapper/dists\nzipStoreBase=GRADLE_USER_"
  },
  {
    "path": "XRetrofit/gradle.properties",
    "chars": 1186,
    "preview": "# Project-wide Gradle settings.\n# IDE (e.g. Android Studio) users:\n# Gradle settings configured through the IDE *will ov"
  },
  {
    "path": "XRetrofit/gradlew",
    "chars": 5296,
    "preview": "#!/usr/bin/env sh\n\n##############################################################################\n##\n##  Gradle start up"
  },
  {
    "path": "XRetrofit/gradlew.bat",
    "chars": 2176,
    "preview": "@if \"%DEBUG%\" == \"\" @echo off\n@rem ##########################################################################\n@rem\n@rem "
  },
  {
    "path": "XRetrofit/install.gradle",
    "chars": 1333,
    "preview": "// backup of [https://raw.githubusercontent.com/nuuneoi/JCenter/master/installv1.gradle]\n\napply plugin: 'com.github.dcen"
  },
  {
    "path": "XRetrofit/jitpack.gradle",
    "chars": 82,
    "preview": "apply plugin: 'com.github.dcendents.android-maven'\n\ngroup = 'com.github.yanxuwen'\n"
  },
  {
    "path": "XRetrofit/settings.gradle",
    "chars": 65,
    "preview": "include ':annotations'\ninclude ':app', ':xretrofit', ':compiler'\n"
  },
  {
    "path": "XRetrofit/versions.gradle",
    "chars": 1210,
    "preview": "/**\n * Shared file between builds so that they can all use the same dependencies and\n * maven repositories.\n **/\next.dep"
  },
  {
    "path": "XRetrofit/xretrofit/.gitignore",
    "chars": 7,
    "preview": "/build\n"
  },
  {
    "path": "XRetrofit/xretrofit/build.gradle",
    "chars": 1084,
    "preview": "apply plugin: 'com.android.library'\next {\n    bintrayName = 'xretrofit'\n    artifact = bintrayName\n    libraryName = 'xr"
  },
  {
    "path": "XRetrofit/xretrofit/proguard-rules.pro",
    "chars": 751,
    "preview": "# Add project specific ProGuard rules here.\n# You can control the set of applied configuration files using the\n# proguar"
  },
  {
    "path": "XRetrofit/xretrofit/src/main/AndroidManifest.xml",
    "chars": 191,
    "preview": "<manifest xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    package=\"com.xretrofit\" >\n\n    <uses-permission"
  },
  {
    "path": "XRetrofit/xretrofit/src/main/java/com/xretrofit/CallAdapter/CallAdapter.java",
    "chars": 693,
    "preview": "package com.xretrofit.CallAdapter;\n\nimport com.xretrofit.call.Call;\nimport com.xretrofit.utils.Utils;\n\nimport org.jetbra"
  },
  {
    "path": "XRetrofit/xretrofit/src/main/java/com/xretrofit/CallAdapter/MCallAdapter.java",
    "chars": 553,
    "preview": "package com.xretrofit.CallAdapter;\n\nimport com.xretrofit.call.Call;\n\nimport java.lang.reflect.Type;\n\n/**\n * @author bsnl"
  },
  {
    "path": "XRetrofit/xretrofit/src/main/java/com/xretrofit/CallAdapter/ObjectCallAdapter.java",
    "chars": 665,
    "preview": "package com.xretrofit.CallAdapter;\n\nimport com.xretrofit.call.Call;\n\nimport java.lang.reflect.Type;\n\n/**\n * @author bsnl"
  },
  {
    "path": "XRetrofit/xretrofit/src/main/java/com/xretrofit/CallAdapter/ObjectCallAdapterFactory.java",
    "chars": 959,
    "preview": "package com.xretrofit.CallAdapter;\n\nimport com.xretrofit.call.Call;\nimport com.xretrofit.call.ProgressCall;\nimport com.x"
  },
  {
    "path": "XRetrofit/xretrofit/src/main/java/com/xretrofit/CallAdapter/ProgressCallAdapter.java",
    "chars": 721,
    "preview": "package com.xretrofit.CallAdapter;\n\nimport com.xretrofit.call.Call;\nimport com.xretrofit.call.ProgressCall;\n\nimport java"
  },
  {
    "path": "XRetrofit/xretrofit/src/main/java/com/xretrofit/HttpException.java",
    "chars": 1643,
    "preview": "/*\n * Copyright (C) 2016 Square, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may n"
  },
  {
    "path": "XRetrofit/xretrofit/src/main/java/com/xretrofit/HttpManager.java",
    "chars": 5032,
    "preview": "package com.xretrofit;\n\nimport com.xretrofit.CallAdapter.CallAdapter;\nimport com.xretrofit.CallAdapter.ObjectCallAdapter"
  },
  {
    "path": "XRetrofit/xretrofit/src/main/java/com/xretrofit/Interceptor/DownloadResponseBody.java",
    "chars": 2133,
    "preview": "package com.xretrofit.Interceptor;\n\n\nimport java.io.File;\nimport java.io.IOException;\nimport java.text.DecimalFormat;\n\ni"
  },
  {
    "path": "XRetrofit/xretrofit/src/main/java/com/xretrofit/Interceptor/ProgressListener.java",
    "chars": 494,
    "preview": "package com.xretrofit.Interceptor;\n\n/**\n * @author bsnl_yanxuwen\n * @date 2021/2/8 9:45\n * Description :\n */\npublic clas"
  },
  {
    "path": "XRetrofit/xretrofit/src/main/java/com/xretrofit/Interceptor/UploadRequestBodyBody.java",
    "chars": 1995,
    "preview": "package com.xretrofit.Interceptor;\n\nimport java.io.IOException;\nimport java.text.DecimalFormat;\n\nimport okhttp3.MediaTyp"
  },
  {
    "path": "XRetrofit/xretrofit/src/main/java/com/xretrofit/Response.java",
    "chars": 2584,
    "preview": "package com.xretrofit;\n\n\nimport org.jetbrains.annotations.Nullable;\n\nimport okhttp3.Headers;\nimport okhttp3.ResponseBody"
  },
  {
    "path": "XRetrofit/xretrofit/src/main/java/com/xretrofit/bean/RequestParams.java",
    "chars": 1220,
    "preview": "package com.xretrofit.bean;\n\nimport java.util.HashMap;\nimport java.util.Map;\n\n/**\n * 自动生成用的请求参数\n */\npublic class Request"
  },
  {
    "path": "XRetrofit/xretrofit/src/main/java/com/xretrofit/call/Call.java",
    "chars": 594,
    "preview": "package com.xretrofit.call;\n\nimport com.xretrofit.Response;\nimport com.xretrofit.callback.CallBack;\nimport com.xretrofit"
  },
  {
    "path": "XRetrofit/xretrofit/src/main/java/com/xretrofit/call/OkHttpCall.java",
    "chars": 5678,
    "preview": "package com.xretrofit.call;\n\nimport android.os.Handler;\nimport android.os.Looper;\n\nimport com.xretrofit.Response;\nimport"
  },
  {
    "path": "XRetrofit/xretrofit/src/main/java/com/xretrofit/call/ProgressCall.java",
    "chars": 1746,
    "preview": "package com.xretrofit.call;\n\nimport com.xretrofit.Interceptor.ProgressListener;\nimport com.xretrofit.callback.CallBack;\n"
  },
  {
    "path": "XRetrofit/xretrofit/src/main/java/com/xretrofit/callback/CallBack.java",
    "chars": 271,
    "preview": "package com.xretrofit.callback;\n\nimport com.xretrofit.call.Call;\nimport com.xretrofit.Response;\n\n\npublic interface CallB"
  },
  {
    "path": "XRetrofit/xretrofit/src/main/java/com/xretrofit/callback/ProgressCallBack.java",
    "chars": 182,
    "preview": "package com.xretrofit.callback;\n\npublic abstract class ProgressCallBack<T> implements CallBack<T> {\n\n    /**\n     * 进度\n "
  },
  {
    "path": "XRetrofit/xretrofit/src/main/java/com/xretrofit/converter/Converter.java",
    "chars": 1954,
    "preview": "package com.xretrofit.converter;\n\nimport com.xretrofit.utils.Utils;\nimport com.yanxuwen.xretrofit_annotations.annotation"
  },
  {
    "path": "XRetrofit/xretrofit/src/main/java/com/xretrofit/converter/DownloadConverterFactories.java",
    "chars": 725,
    "preview": "package com.xretrofit.converter;\n\nimport com.yanxuwen.xretrofit_annotations.annotation.method.DOWNLOAD;\n\nimport org.jetb"
  },
  {
    "path": "XRetrofit/xretrofit/src/main/java/com/xretrofit/converter/DownloadResponseConverter.java",
    "chars": 2295,
    "preview": "package com.xretrofit.converter;\n\nimport com.xretrofit.Interceptor.DownloadResponseBody;\n\nimport java.io.BufferedInputSt"
  },
  {
    "path": "XRetrofit/xretrofit/src/main/java/com/xretrofit/converter/StringConverterFactories.java",
    "chars": 714,
    "preview": "package com.xretrofit.converter;\n\nimport org.jetbrains.annotations.Nullable;\n\nimport java.lang.reflect.Type;\n\nimport okh"
  },
  {
    "path": "XRetrofit/xretrofit/src/main/java/com/xretrofit/converter/StringResponseConverter.java",
    "chars": 406,
    "preview": "package com.xretrofit.converter;\n\nimport okhttp3.ResponseBody;\n\n/**\n * @author bsnl_yanxuwen\n * @date 2021/2/4 17:09\n * "
  },
  {
    "path": "XRetrofit/xretrofit/src/main/java/com/xretrofit/converter/UploadConverterFactories.java",
    "chars": 712,
    "preview": "package com.xretrofit.converter;\n\nimport com.yanxuwen.xretrofit_annotations.annotation.method.UPLOAD;\n\nimport org.jetbra"
  },
  {
    "path": "XRetrofit/xretrofit/src/main/java/com/xretrofit/converter/UploadRequestConverter.java",
    "chars": 347,
    "preview": "package com.xretrofit.converter;\n\nimport okhttp3.RequestBody;\n\n/**\n * @author bsnl_yanxuwen\n * @date 2021/2/8 9:25\n * De"
  },
  {
    "path": "XRetrofit/xretrofit/src/main/java/com/xretrofit/method/MethodAnnotation.java",
    "chars": 843,
    "preview": "package com.xretrofit.method;\n\nimport java.util.List;\n\n/**\n * @author bsnl_yanxuwen\n * @date 2021/2/4 14:00\n * Descripti"
  },
  {
    "path": "XRetrofit/xretrofit/src/main/java/com/xretrofit/method/ParamAnnotation.java",
    "chars": 970,
    "preview": "package com.xretrofit.method;\n\nimport java.util.List;\n\n/**\n * @author bsnl_yanxuwen\n * @date 2021/2/4 14:00\n * Descripti"
  },
  {
    "path": "XRetrofit/xretrofit/src/main/java/com/xretrofit/method/ServiceMethod.java",
    "chars": 17427,
    "preview": "package com.xretrofit.method;\n\nimport android.util.Log;\nimport android.util.Patterns;\n\nimport com.xretrofit.CallAdapter."
  },
  {
    "path": "XRetrofit/xretrofit/src/main/java/com/xretrofit/okhttp/SslUtils.java",
    "chars": 6552,
    "preview": "\npackage com.xretrofit.okhttp;\n\nimport java.io.IOException;\nimport java.io.InputStream;\nimport java.security.KeyManageme"
  },
  {
    "path": "XRetrofit/xretrofit/src/main/java/com/xretrofit/utils/UrlUtils.java",
    "chars": 1185,
    "preview": "package com.xretrofit.utils;\n\nimport java.util.HashMap;\nimport java.util.Map;\nimport java.util.Set;\n\npublic class UrlUti"
  },
  {
    "path": "XRetrofit/xretrofit/src/main/java/com/xretrofit/utils/Utils.java",
    "chars": 3903,
    "preview": "package com.xretrofit.utils;\n\nimport org.jetbrains.annotations.Nullable;\n\nimport java.io.IOException;\nimport java.lang.r"
  }
]

// ... and 1 more files (download for full content)

About this extraction

This page contains the full source code of the yanxuwen/okhttp GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 98 files (149.3 KB), approximately 39.1k tokens, and a symbol index with 282 extracted functions, classes, methods, constants, and types. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.

Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.

Copied to clipboard!