├── XRetrofit
├── Could
├── annotations
│ ├── .gitignore
│ ├── src
│ │ └── main
│ │ │ └── java
│ │ │ └── com
│ │ │ └── yanxuwen
│ │ │ └── xretrofit_annotations
│ │ │ └── annotation
│ │ │ ├── service
│ │ │ └── NetServiceClass.java
│ │ │ ├── param
│ │ │ ├── Body.java
│ │ │ ├── Param.java
│ │ │ ├── Query.java
│ │ │ ├── FilePath.java
│ │ │ ├── Header.java
│ │ │ └── Path.java
│ │ │ └── method
│ │ │ ├── GET.java
│ │ │ ├── PUT.java
│ │ │ ├── DELETE.java
│ │ │ ├── FORM.java
│ │ │ ├── UPLOAD.java
│ │ │ ├── DOWNLOAD.java
│ │ │ ├── POST.java
│ │ │ └── Headers.java
│ └── build.gradle
├── app
│ ├── .gitignore
│ ├── src
│ │ └── main
│ │ │ ├── res
│ │ │ ├── values
│ │ │ │ ├── strings.xml
│ │ │ │ ├── colors.xml
│ │ │ │ └── styles.xml
│ │ │ ├── mipmap-hdpi
│ │ │ │ ├── ic_launcher.png
│ │ │ │ └── ic_launcher_round.png
│ │ │ ├── mipmap-mdpi
│ │ │ │ ├── ic_launcher.png
│ │ │ │ └── ic_launcher_round.png
│ │ │ ├── mipmap-xhdpi
│ │ │ │ ├── ic_launcher.png
│ │ │ │ └── ic_launcher_round.png
│ │ │ ├── mipmap-xxhdpi
│ │ │ │ ├── ic_launcher.png
│ │ │ │ └── ic_launcher_round.png
│ │ │ ├── mipmap-xxxhdpi
│ │ │ │ ├── ic_launcher.png
│ │ │ │ └── ic_launcher_round.png
│ │ │ ├── xml
│ │ │ │ └── network_security_config.xml
│ │ │ ├── mipmap-anydpi-v26
│ │ │ │ ├── ic_launcher.xml
│ │ │ │ └── ic_launcher_round.xml
│ │ │ ├── drawable-v24
│ │ │ │ └── ic_launcher_foreground.xml
│ │ │ ├── layout
│ │ │ │ └── activity_main.xml
│ │ │ └── drawable
│ │ │ │ └── ic_launcher_background.xml
│ │ │ ├── java
│ │ │ └── com
│ │ │ │ └── yanxuwen
│ │ │ │ └── xretrofit
│ │ │ │ ├── bean
│ │ │ │ ├── HomeInfoV5.java
│ │ │ │ └── LoginBuild.java
│ │ │ │ ├── converter
│ │ │ │ ├── GsonRequestConverter.java
│ │ │ │ ├── GsonResponseConverter.java
│ │ │ │ ├── Rxjava2CallAdapterFactories.java
│ │ │ │ ├── GsonConverterFactories.java
│ │ │ │ └── Rxjava2CallAdapter.java
│ │ │ │ ├── http
│ │ │ │ ├── HttpRequest.java
│ │ │ │ └── NetService.java
│ │ │ │ ├── callback
│ │ │ │ ├── MyProgressCallBack.java
│ │ │ │ ├── ServerException.java
│ │ │ │ └── MyCallBack.java
│ │ │ │ ├── RxSchedulers.java
│ │ │ │ ├── MyApplication.java
│ │ │ │ └── MainActivity.java
│ │ │ └── AndroidManifest.xml
│ ├── proguard-rules.pro
│ └── build.gradle
├── compiler
│ ├── .gitignore
│ ├── src
│ │ └── main
│ │ │ └── java
│ │ │ └── com
│ │ │ └── xretrofit
│ │ │ └── compiler
│ │ │ ├── ElementUtils.java
│ │ │ ├── HttpServiceProcessor2.java
│ │ │ └── create
│ │ │ └── CreateClassUtils.java
│ └── build.gradle
├── xretrofit
│ ├── .gitignore
│ ├── src
│ │ └── main
│ │ │ ├── AndroidManifest.xml
│ │ │ └── java
│ │ │ └── com
│ │ │ └── xretrofit
│ │ │ ├── callback
│ │ │ ├── ProgressCallBack.java
│ │ │ └── CallBack.java
│ │ │ ├── converter
│ │ │ ├── UploadRequestConverter.java
│ │ │ ├── StringResponseConverter.java
│ │ │ ├── UploadConverterFactories.java
│ │ │ ├── StringConverterFactories.java
│ │ │ ├── DownloadConverterFactories.java
│ │ │ ├── Converter.java
│ │ │ └── DownloadResponseConverter.java
│ │ │ ├── Interceptor
│ │ │ ├── ProgressListener.java
│ │ │ ├── UploadRequestBodyBody.java
│ │ │ └── DownloadResponseBody.java
│ │ │ ├── CallAdapter
│ │ │ ├── MCallAdapter.java
│ │ │ ├── ObjectCallAdapter.java
│ │ │ ├── CallAdapter.java
│ │ │ ├── ProgressCallAdapter.java
│ │ │ └── ObjectCallAdapterFactory.java
│ │ │ ├── call
│ │ │ ├── Call.java
│ │ │ ├── ProgressCall.java
│ │ │ └── OkHttpCall.java
│ │ │ ├── method
│ │ │ ├── MethodAnnotation.java
│ │ │ ├── ParamAnnotation.java
│ │ │ └── ServiceMethod.java
│ │ │ ├── utils
│ │ │ ├── UrlUtils.java
│ │ │ └── Utils.java
│ │ │ ├── bean
│ │ │ └── RequestParams.java
│ │ │ ├── HttpException.java
│ │ │ ├── Response.java
│ │ │ ├── HttpManager.java
│ │ │ └── okhttp
│ │ │ └── SslUtils.java
│ ├── proguard-rules.pro
│ └── build.gradle
├── settings.gradle
├── jitpack.gradle
├── gradle
│ └── wrapper
│ │ ├── gradle-wrapper.jar
│ │ └── gradle-wrapper.properties
├── .gitignore
├── build.gradle
├── gradle.properties
├── versions.gradle
├── install.gradle
├── bintray.gradle
├── gradlew.bat
└── gradlew
└── README.md
/XRetrofit/Could:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/XRetrofit/annotations/.gitignore:
--------------------------------------------------------------------------------
1 | /build
--------------------------------------------------------------------------------
/XRetrofit/app/.gitignore:
--------------------------------------------------------------------------------
1 | /build
2 |
--------------------------------------------------------------------------------
/XRetrofit/compiler/.gitignore:
--------------------------------------------------------------------------------
1 | /build
2 |
--------------------------------------------------------------------------------
/XRetrofit/xretrofit/.gitignore:
--------------------------------------------------------------------------------
1 | /build
2 |
--------------------------------------------------------------------------------
/XRetrofit/settings.gradle:
--------------------------------------------------------------------------------
1 | include ':annotations'
2 | include ':app', ':xretrofit', ':compiler'
3 |
--------------------------------------------------------------------------------
/XRetrofit/jitpack.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: 'com.github.dcendents.android-maven'
2 |
3 | group = 'com.github.yanxuwen'
4 |
--------------------------------------------------------------------------------
/XRetrofit/app/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | XRetrofit
3 |
4 |
--------------------------------------------------------------------------------
/XRetrofit/gradle/wrapper/gradle-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yanxuwen/XRetrofit/HEAD/XRetrofit/gradle/wrapper/gradle-wrapper.jar
--------------------------------------------------------------------------------
/XRetrofit/app/src/main/res/mipmap-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yanxuwen/XRetrofit/HEAD/XRetrofit/app/src/main/res/mipmap-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/XRetrofit/app/src/main/res/mipmap-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yanxuwen/XRetrofit/HEAD/XRetrofit/app/src/main/res/mipmap-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/XRetrofit/app/src/main/res/mipmap-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yanxuwen/XRetrofit/HEAD/XRetrofit/app/src/main/res/mipmap-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/XRetrofit/app/src/main/res/mipmap-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yanxuwen/XRetrofit/HEAD/XRetrofit/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/XRetrofit/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yanxuwen/XRetrofit/HEAD/XRetrofit/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/XRetrofit/app/src/main/res/mipmap-hdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yanxuwen/XRetrofit/HEAD/XRetrofit/app/src/main/res/mipmap-hdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/XRetrofit/app/src/main/res/mipmap-mdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yanxuwen/XRetrofit/HEAD/XRetrofit/app/src/main/res/mipmap-mdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/XRetrofit/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yanxuwen/XRetrofit/HEAD/XRetrofit/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/XRetrofit/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yanxuwen/XRetrofit/HEAD/XRetrofit/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/XRetrofit/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yanxuwen/XRetrofit/HEAD/XRetrofit/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/XRetrofit/xretrofit/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/XRetrofit/app/src/main/res/values/colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | #008577
4 | #00574B
5 | #D81B60
6 |
7 |
--------------------------------------------------------------------------------
/XRetrofit/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | #Tue Apr 16 17:53:26 CST 2019
2 | distributionBase=GRADLE_USER_HOME
3 | distributionPath=wrapper/dists
4 | zipStoreBase=GRADLE_USER_HOME
5 | zipStorePath=wrapper/dists
6 | distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.4-all.zip
7 |
--------------------------------------------------------------------------------
/XRetrofit/xretrofit/src/main/java/com/xretrofit/callback/ProgressCallBack.java:
--------------------------------------------------------------------------------
1 | package com.xretrofit.callback;
2 |
3 | public abstract class ProgressCallBack implements CallBack {
4 |
5 | /**
6 | * 进度
7 | */
8 | public abstract void onProgress(float progress);
9 | }
10 |
--------------------------------------------------------------------------------
/XRetrofit/app/src/main/res/xml/network_security_config.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/XRetrofit/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/XRetrofit/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/XRetrofit/xretrofit/src/main/java/com/xretrofit/callback/CallBack.java:
--------------------------------------------------------------------------------
1 | package com.xretrofit.callback;
2 |
3 | import com.xretrofit.call.Call;
4 | import com.xretrofit.Response;
5 |
6 |
7 | public interface CallBack {
8 |
9 | void onStart(Call call);
10 |
11 | void onSuccess(Call call, Response response);
12 |
13 | void onFail(Call call, final Throwable e);
14 | }
--------------------------------------------------------------------------------
/XRetrofit/app/src/main/java/com/yanxuwen/xretrofit/bean/HomeInfoV5.java:
--------------------------------------------------------------------------------
1 | package com.yanxuwen.xretrofit.bean;
2 |
3 | /**
4 | * @author bsnl_yanxuwen
5 | * @date 2021/2/19 9:21
6 | * Description :
7 | */
8 | public class HomeInfoV5 {
9 |
10 | private String msg;
11 |
12 | public String getMsg() {
13 | return msg;
14 | }
15 |
16 | public void setMsg(String msg) {
17 | this.msg = msg;
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/XRetrofit/compiler/src/main/java/com/xretrofit/compiler/ElementUtils.java:
--------------------------------------------------------------------------------
1 | package com.xretrofit.compiler;
2 |
3 | /**
4 | * 这个类改版的话,HttpManager里面的getImplName 也需要改变
5 | */
6 | @SuppressWarnings("unchecked")
7 | public class ElementUtils {
8 | public static String packageName = "com.http";
9 |
10 | public static String getImplName(Class> clazz) {
11 | return packageName + "." + clazz.getSimpleName() + "$Impl";
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/XRetrofit/app/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/XRetrofit/xretrofit/src/main/java/com/xretrofit/converter/UploadRequestConverter.java:
--------------------------------------------------------------------------------
1 | package com.xretrofit.converter;
2 |
3 | import okhttp3.RequestBody;
4 |
5 | /**
6 | * @author bsnl_yanxuwen
7 | * @date 2021/2/8 9:25
8 | * Description :
9 | * * 接口数据转换
10 | * * 返回接口的 上次操作
11 | */
12 | public class UploadRequestConverter implements Converter {
13 |
14 | @Override
15 | public RequestBody convert(T value) throws Exception {
16 | return null;
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/XRetrofit/annotations/src/main/java/com/yanxuwen/xretrofit_annotations/annotation/service/NetServiceClass.java:
--------------------------------------------------------------------------------
1 | package com.yanxuwen.xretrofit_annotations.annotation.service;
2 |
3 | import java.lang.annotation.ElementType;
4 | import java.lang.annotation.Retention;
5 | import java.lang.annotation.RetentionPolicy;
6 | import java.lang.annotation.Target;
7 |
8 | @Target({ElementType.TYPE})
9 | @Retention(RetentionPolicy.CLASS)
10 | public @interface NetServiceClass {
11 | String value() default "";
12 | }
13 |
--------------------------------------------------------------------------------
/XRetrofit/annotations/build.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: 'java'
2 |
3 | ext {
4 | bintrayName = 'annotations'
5 | artifact = bintrayName
6 | libraryName = 'xretrofit-annotations'
7 | libraryDescription = 'this is a xretrofit-annotations'
8 | libraryVersion = main_version
9 | }
10 | compileJava {
11 | sourceCompatibility = '1.8'
12 | targetCompatibility = '1.8'
13 | }
14 |
15 | dependencies {
16 | }
17 |
18 | //apply from: '../install.gradle'
19 | //apply from: '../bintray.gradle'
20 | apply from: '../jitpack.gradle'
21 |
--------------------------------------------------------------------------------
/XRetrofit/xretrofit/src/main/java/com/xretrofit/converter/StringResponseConverter.java:
--------------------------------------------------------------------------------
1 | package com.xretrofit.converter;
2 |
3 | import okhttp3.ResponseBody;
4 |
5 | /**
6 | * @author bsnl_yanxuwen
7 | * @date 2021/2/4 17:09
8 | * Description :
9 | * 接口数据转换
10 | * 返回接口的 字符串操作
11 | */
12 | public class StringResponseConverter implements Converter {
13 |
14 |
15 | @Override
16 | public T convert(ResponseBody value) throws Exception {
17 | String responseStr = value.string();
18 | return (T) responseStr;
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/XRetrofit/annotations/src/main/java/com/yanxuwen/xretrofit_annotations/annotation/param/Body.java:
--------------------------------------------------------------------------------
1 | //
2 | // Source code recreated from a .class file by IntelliJ IDEA
3 | // (powered by Fernflower decompiler)
4 | //
5 |
6 | package com.yanxuwen.xretrofit_annotations.annotation.param;
7 |
8 | import java.lang.annotation.Documented;
9 | import java.lang.annotation.ElementType;
10 | import java.lang.annotation.Retention;
11 | import java.lang.annotation.RetentionPolicy;
12 | import java.lang.annotation.Target;
13 |
14 | @Documented
15 | @Target({ElementType.PARAMETER})
16 | @Retention(RetentionPolicy.CLASS)
17 | public @interface Body {
18 | }
19 |
--------------------------------------------------------------------------------
/XRetrofit/app/src/main/java/com/yanxuwen/xretrofit/bean/LoginBuild.java:
--------------------------------------------------------------------------------
1 | package com.yanxuwen.xretrofit.bean;
2 |
3 | public class LoginBuild {
4 |
5 | /**
6 | * password : “123456”
7 | * mobile : “15060568265”
8 | */
9 |
10 | private String userId;
11 | private String msg;
12 |
13 | public String getUserId() {
14 | return userId;
15 | }
16 |
17 | public void setUserId(String userId) {
18 | this.userId = userId;
19 | }
20 |
21 | public String getMsg() {
22 | return msg;
23 | }
24 |
25 | public void setMsg(String msg) {
26 | this.msg = msg;
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/XRetrofit/annotations/src/main/java/com/yanxuwen/xretrofit_annotations/annotation/param/Param.java:
--------------------------------------------------------------------------------
1 | //
2 | // Source code recreated from a .class file by IntelliJ IDEA
3 | // (powered by Fernflower decompiler)
4 | //
5 |
6 | package com.yanxuwen.xretrofit_annotations.annotation.param;
7 |
8 | import java.lang.annotation.Documented;
9 | import java.lang.annotation.ElementType;
10 | import java.lang.annotation.Retention;
11 | import java.lang.annotation.RetentionPolicy;
12 | import java.lang.annotation.Target;
13 |
14 | @Documented
15 | @Target({ElementType.PARAMETER})
16 | @Retention(RetentionPolicy.CLASS)
17 | public @interface Param {
18 | String value();
19 | }
20 |
--------------------------------------------------------------------------------
/XRetrofit/annotations/src/main/java/com/yanxuwen/xretrofit_annotations/annotation/param/Query.java:
--------------------------------------------------------------------------------
1 | //
2 | // Source code recreated from a .class file by IntelliJ IDEA
3 | // (powered by Fernflower decompiler)
4 | //
5 |
6 | package com.yanxuwen.xretrofit_annotations.annotation.param;
7 |
8 | import java.lang.annotation.Documented;
9 | import java.lang.annotation.ElementType;
10 | import java.lang.annotation.Retention;
11 | import java.lang.annotation.RetentionPolicy;
12 | import java.lang.annotation.Target;
13 |
14 | @Documented
15 | @Target({ElementType.PARAMETER})
16 | @Retention(RetentionPolicy.CLASS)
17 | public @interface Query {
18 | String value();
19 | }
20 |
--------------------------------------------------------------------------------
/XRetrofit/annotations/src/main/java/com/yanxuwen/xretrofit_annotations/annotation/method/GET.java:
--------------------------------------------------------------------------------
1 | //
2 | // Source code recreated from a .class file by IntelliJ IDEA
3 | // (powered by Fernflower decompiler)
4 | //
5 |
6 | package com.yanxuwen.xretrofit_annotations.annotation.method;
7 |
8 | import java.lang.annotation.Documented;
9 | import java.lang.annotation.ElementType;
10 | import java.lang.annotation.Retention;
11 | import java.lang.annotation.RetentionPolicy;
12 | import java.lang.annotation.Target;
13 |
14 | @Documented
15 | @Target({ElementType.METHOD})
16 | @Retention(RetentionPolicy.CLASS)
17 | public @interface GET {
18 | String value() default "";
19 | }
20 |
--------------------------------------------------------------------------------
/XRetrofit/annotations/src/main/java/com/yanxuwen/xretrofit_annotations/annotation/method/PUT.java:
--------------------------------------------------------------------------------
1 | //
2 | // Source code recreated from a .class file by IntelliJ IDEA
3 | // (powered by Fernflower decompiler)
4 | //
5 |
6 | package com.yanxuwen.xretrofit_annotations.annotation.method;
7 |
8 | import java.lang.annotation.Documented;
9 | import java.lang.annotation.ElementType;
10 | import java.lang.annotation.Retention;
11 | import java.lang.annotation.RetentionPolicy;
12 | import java.lang.annotation.Target;
13 |
14 | @Documented
15 | @Target({ElementType.METHOD})
16 | @Retention(RetentionPolicy.CLASS)
17 | public @interface PUT {
18 | String value() default "";
19 | }
20 |
--------------------------------------------------------------------------------
/XRetrofit/annotations/src/main/java/com/yanxuwen/xretrofit_annotations/annotation/method/DELETE.java:
--------------------------------------------------------------------------------
1 | //
2 | // Source code recreated from a .class file by IntelliJ IDEA
3 | // (powered by Fernflower decompiler)
4 | //
5 |
6 | package com.yanxuwen.xretrofit_annotations.annotation.method;
7 |
8 | import java.lang.annotation.Documented;
9 | import java.lang.annotation.ElementType;
10 | import java.lang.annotation.Retention;
11 | import java.lang.annotation.RetentionPolicy;
12 | import java.lang.annotation.Target;
13 |
14 | @Documented
15 | @Target({ElementType.METHOD})
16 | @Retention(RetentionPolicy.CLASS)
17 | public @interface DELETE {
18 | String value() default "";
19 | }
20 |
--------------------------------------------------------------------------------
/XRetrofit/annotations/src/main/java/com/yanxuwen/xretrofit_annotations/annotation/method/FORM.java:
--------------------------------------------------------------------------------
1 | //
2 | // Source code recreated from a .class file by IntelliJ IDEA
3 | // (powered by Fernflower decompiler)
4 | //
5 |
6 | package com.yanxuwen.xretrofit_annotations.annotation.method;
7 |
8 | import java.lang.annotation.Documented;
9 | import java.lang.annotation.ElementType;
10 | import java.lang.annotation.Retention;
11 | import java.lang.annotation.RetentionPolicy;
12 | import java.lang.annotation.Target;
13 |
14 | /**
15 | * 标记是否是表单提交
16 | */
17 | @Documented
18 | @Target({ElementType.METHOD})
19 | @Retention(RetentionPolicy.CLASS)
20 | public @interface FORM {
21 | }
22 |
--------------------------------------------------------------------------------
/XRetrofit/annotations/src/main/java/com/yanxuwen/xretrofit_annotations/annotation/method/UPLOAD.java:
--------------------------------------------------------------------------------
1 | //
2 | // Source code recreated from a .class file by IntelliJ IDEA
3 | // (powered by Fernflower decompiler)
4 | //
5 |
6 | package com.yanxuwen.xretrofit_annotations.annotation.method;
7 |
8 | import java.lang.annotation.Documented;
9 | import java.lang.annotation.ElementType;
10 | import java.lang.annotation.Retention;
11 | import java.lang.annotation.RetentionPolicy;
12 | import java.lang.annotation.Target;
13 |
14 | @Documented
15 | @Target({ElementType.METHOD})
16 | @Retention(RetentionPolicy.CLASS)
17 | public @interface UPLOAD {
18 | String value() default "";
19 | }
20 |
--------------------------------------------------------------------------------
/XRetrofit/xretrofit/src/main/java/com/xretrofit/Interceptor/ProgressListener.java:
--------------------------------------------------------------------------------
1 | package com.xretrofit.Interceptor;
2 |
3 | /**
4 | * @author bsnl_yanxuwen
5 | * @date 2021/2/8 9:45
6 | * Description :
7 | */
8 | public class ProgressListener {
9 | public void setProgress(float progress) {
10 | if (listener != null) {
11 | listener.progress(progress);
12 | }
13 | }
14 |
15 | public interface Listener {
16 | public void progress(float progress);
17 | }
18 |
19 | private Listener listener;
20 |
21 | public void setProgressListener(Listener listener) {
22 | this.listener = listener;
23 | }
24 |
25 | }
26 |
--------------------------------------------------------------------------------
/XRetrofit/annotations/src/main/java/com/yanxuwen/xretrofit_annotations/annotation/method/DOWNLOAD.java:
--------------------------------------------------------------------------------
1 | //
2 | // Source code recreated from a .class file by IntelliJ IDEA
3 | // (powered by Fernflower decompiler)
4 | //
5 |
6 | package com.yanxuwen.xretrofit_annotations.annotation.method;
7 |
8 | import java.lang.annotation.Documented;
9 | import java.lang.annotation.ElementType;
10 | import java.lang.annotation.Retention;
11 | import java.lang.annotation.RetentionPolicy;
12 | import java.lang.annotation.Target;
13 |
14 | @Documented
15 | @Target({ElementType.METHOD})
16 | @Retention(RetentionPolicy.CLASS)
17 | public @interface DOWNLOAD {
18 | String value() default "";
19 | }
20 |
--------------------------------------------------------------------------------
/XRetrofit/annotations/src/main/java/com/yanxuwen/xretrofit_annotations/annotation/method/POST.java:
--------------------------------------------------------------------------------
1 | //
2 | // Source code recreated from a .class file by IntelliJ IDEA
3 | // (powered by Fernflower decompiler)
4 | //
5 |
6 | package com.yanxuwen.xretrofit_annotations.annotation.method;
7 |
8 | import java.lang.annotation.Documented;
9 | import java.lang.annotation.ElementType;
10 | import java.lang.annotation.Retention;
11 | import java.lang.annotation.RetentionPolicy;
12 | import java.lang.annotation.Target;
13 |
14 | @Documented
15 | @Target({ElementType.METHOD})
16 | @Retention(RetentionPolicy.CLASS)
17 | public @interface POST {
18 | String value() default "";
19 |
20 | }
21 |
--------------------------------------------------------------------------------
/XRetrofit/annotations/src/main/java/com/yanxuwen/xretrofit_annotations/annotation/method/Headers.java:
--------------------------------------------------------------------------------
1 | //
2 | // Source code recreated from a .class file by IntelliJ IDEA
3 | // (powered by Fernflower decompiler)
4 | //
5 |
6 | package com.yanxuwen.xretrofit_annotations.annotation.method;
7 |
8 | import java.lang.annotation.Documented;
9 | import java.lang.annotation.ElementType;
10 | import java.lang.annotation.Retention;
11 | import java.lang.annotation.RetentionPolicy;
12 | import java.lang.annotation.Target;
13 |
14 | @Documented
15 | @Target({ElementType.METHOD})
16 | @Retention(RetentionPolicy.CLASS)
17 | public @interface Headers {
18 | String[] value();
19 | boolean encoded() default false;
20 | }
21 |
--------------------------------------------------------------------------------
/XRetrofit/annotations/src/main/java/com/yanxuwen/xretrofit_annotations/annotation/param/FilePath.java:
--------------------------------------------------------------------------------
1 | //
2 | // Source code recreated from a .class file by IntelliJ IDEA
3 | // (powered by Fernflower decompiler)
4 | //
5 |
6 | package com.yanxuwen.xretrofit_annotations.annotation.param;
7 |
8 | import java.lang.annotation.Documented;
9 | import java.lang.annotation.ElementType;
10 | import java.lang.annotation.Retention;
11 | import java.lang.annotation.RetentionPolicy;
12 | import java.lang.annotation.Target;
13 |
14 | //用于文件上传用的路径
15 | //支持 File String List List
16 | @Documented
17 | @Target({ElementType.PARAMETER})
18 | @Retention(RetentionPolicy.CLASS)
19 | public @interface FilePath {
20 | }
21 |
--------------------------------------------------------------------------------
/XRetrofit/annotations/src/main/java/com/yanxuwen/xretrofit_annotations/annotation/param/Header.java:
--------------------------------------------------------------------------------
1 | //
2 | // Source code recreated from a .class file by IntelliJ IDEA
3 | // (powered by Fernflower decompiler)
4 | //
5 |
6 | package com.yanxuwen.xretrofit_annotations.annotation.param;
7 |
8 | import java.lang.annotation.Documented;
9 | import java.lang.annotation.ElementType;
10 | import java.lang.annotation.Retention;
11 | import java.lang.annotation.RetentionPolicy;
12 | import java.lang.annotation.Target;
13 |
14 | @Documented
15 | @Retention(RetentionPolicy.CLASS)
16 | @Target({ElementType.PARAMETER})
17 | public @interface Header {
18 | String value();
19 | boolean encoded() default false;
20 | }
21 |
--------------------------------------------------------------------------------
/XRetrofit/annotations/src/main/java/com/yanxuwen/xretrofit_annotations/annotation/param/Path.java:
--------------------------------------------------------------------------------
1 | //
2 | // Source code recreated from a .class file by IntelliJ IDEA
3 | // (powered by Fernflower decompiler)
4 | //
5 |
6 | package com.yanxuwen.xretrofit_annotations.annotation.param;
7 |
8 | import java.lang.annotation.Documented;
9 | import java.lang.annotation.ElementType;
10 | import java.lang.annotation.Retention;
11 | import java.lang.annotation.RetentionPolicy;
12 | import java.lang.annotation.Target;
13 |
14 | @Documented
15 | @Retention(RetentionPolicy.CLASS)
16 | @Target({ElementType.PARAMETER})
17 | public @interface Path {
18 | String value();
19 |
20 | boolean encoded() default false;
21 | }
22 |
--------------------------------------------------------------------------------
/XRetrofit/.gitignore:
--------------------------------------------------------------------------------
1 | # Built application files
2 | *.apk
3 | *.ap_
4 |
5 | # Files for the ART/Dalvik VM
6 | *.dex
7 |
8 | # Java class files
9 | *.class
10 |
11 | # Generated files
12 | bin/
13 | gen/
14 | out/
15 |
16 | # Gradle files
17 | .gradle/
18 | build/
19 |
20 | # Local configuration file (sdk path, etc)
21 | local.properties
22 |
23 | # Proguard folder generated by Eclipse
24 | proguard/
25 |
26 | # Log Files
27 | *.log
28 |
29 | # Android Studio Navigation editor temp files
30 | .navigation/
31 |
32 | # Android Studio captures folder
33 | captures/
34 |
35 | # Intellij
36 | *.iml
37 | .idea/
38 |
39 | # Keystore files
40 | *.jks
41 |
42 | # External native build folder generated in Android Studio 2.2 and later
43 | .externalNativeBuild
--------------------------------------------------------------------------------
/XRetrofit/xretrofit/src/main/java/com/xretrofit/CallAdapter/MCallAdapter.java:
--------------------------------------------------------------------------------
1 | package com.xretrofit.CallAdapter;
2 |
3 | import com.xretrofit.call.Call;
4 |
5 | import java.lang.reflect.Type;
6 |
7 | /**
8 | * @author bsnl_yanxuwen
9 | * @date 2021/2/4 17:49
10 | * Description :
11 | * 返回类型为Call<> 的适配器
12 | */
13 | public class MCallAdapter implements CallAdapter {
14 |
15 | private Type responseType;
16 |
17 | protected MCallAdapter(Type responseType){
18 | this.responseType = responseType;
19 | }
20 |
21 |
22 | @Override
23 | public Type responseType() {
24 | return responseType;
25 | }
26 |
27 |
28 | @Override
29 | public Call adapt(Call call) {
30 | return call;
31 | }
32 |
33 | }
34 |
--------------------------------------------------------------------------------
/XRetrofit/compiler/build.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: 'java'
2 | ext {
3 | bintrayName = 'compiler'
4 | artifact = bintrayName
5 | libraryName = 'xretrofit compiler'
6 | libraryDescription = 'this is a xretrofit-compiler'
7 | libraryVersion = main_version
8 | }
9 | compileJava {
10 | sourceCompatibility = '1.8'
11 | targetCompatibility = '1.8'
12 | }
13 |
14 | dependencies {
15 | implementation 'com.google.auto.service:auto-service:1.0-rc6'
16 | annotationProcessor 'com.google.auto.service:auto-service:1.0-rc6'
17 |
18 | implementation 'com.squareup:javapoet:1.10.0'
19 |
20 | implementation project(path: ':annotations')
21 | }
22 |
23 | //apply from: '../install.gradle'
24 | //apply from: '../bintray.gradle'
25 | apply from: '../jitpack.gradle'
26 |
--------------------------------------------------------------------------------
/XRetrofit/app/src/main/java/com/yanxuwen/xretrofit/converter/GsonRequestConverter.java:
--------------------------------------------------------------------------------
1 | package com.yanxuwen.xretrofit.converter;
2 |
3 | import com.alibaba.fastjson.JSONObject;
4 | import com.xretrofit.converter.Converter;
5 |
6 | import okhttp3.MediaType;
7 | import okhttp3.RequestBody;
8 |
9 | /**
10 | * @author bsnl_yanxuwen
11 | * @date 2021/2/5 16:00
12 | * Description :
13 | * 请求参数数据转换
14 | */
15 | class GsonRequestConverter implements Converter {
16 | private static final MediaType JSON = MediaType.parse("application/json;charset=utf-8");
17 |
18 |
19 | @Override
20 | public RequestBody convert(T value) throws Exception {
21 | RequestBody requestBody = RequestBody.create(JSON, JSONObject.toJSONString(value));
22 | return requestBody;
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/XRetrofit/xretrofit/src/main/java/com/xretrofit/call/Call.java:
--------------------------------------------------------------------------------
1 | package com.xretrofit.call;
2 |
3 | import com.xretrofit.Response;
4 | import com.xretrofit.callback.CallBack;
5 | import com.xretrofit.converter.Converter;
6 |
7 | import okhttp3.ResponseBody;
8 |
9 |
10 | /**
11 | * @author bsnl_yanxuwen
12 | * @date 2021/2/4 11:02
13 | * Description :
14 | *
15 | */
16 | public interface Call {
17 |
18 | /**
19 | * 初始化接口返回类型
20 | */
21 | void init(Converter responseConverter);
22 |
23 | /**
24 | * 执行请求,异步
25 | */
26 | void enqueue(CallBack callback);
27 |
28 |
29 | /**
30 | * 执行请求同步
31 | */
32 | Response execute() throws Exception;
33 |
34 |
35 | void cancel();
36 |
37 | boolean isCanceled();
38 |
39 | Call clone();
40 |
41 | }
42 |
--------------------------------------------------------------------------------
/XRetrofit/app/src/main/java/com/yanxuwen/xretrofit/http/HttpRequest.java:
--------------------------------------------------------------------------------
1 | package com.yanxuwen.xretrofit.http;
2 |
3 | import com.xretrofit.HttpManager;
4 |
5 | public class HttpRequest {
6 |
7 | private static NetService netService;
8 |
9 | public static NetService getNetService() {
10 | try {
11 | if (netService == null) {
12 | synchronized (HttpRequest.class) {
13 | if (netService == null) {
14 | netService = (NetService) Class.forName(HttpManager.getImplName(NetService.class))
15 | .getConstructor().newInstance();
16 | }
17 | }
18 | }
19 | } catch (Exception e) {
20 | e.printStackTrace();
21 | }
22 | return netService;
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/XRetrofit/app/proguard-rules.pro:
--------------------------------------------------------------------------------
1 | # Add project specific ProGuard rules here.
2 | # You can control the set of applied configuration files using the
3 | # proguardFiles setting in build.gradle.
4 | #
5 | # For more details, see
6 | # http://developer.android.com/guide/developing/tools/proguard.html
7 |
8 | # If your project uses WebView with JS, uncomment the following
9 | # and specify the fully qualified class name to the JavaScript interface
10 | # class:
11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
12 | # public *;
13 | #}
14 |
15 | # Uncomment this to preserve the line number information for
16 | # debugging stack traces.
17 | #-keepattributes SourceFile,LineNumberTable
18 |
19 | # If you keep the line number information, uncomment this to
20 | # hide the original source file name.
21 | #-renamesourcefileattribute SourceFile
22 |
--------------------------------------------------------------------------------
/XRetrofit/xretrofit/proguard-rules.pro:
--------------------------------------------------------------------------------
1 | # Add project specific ProGuard rules here.
2 | # You can control the set of applied configuration files using the
3 | # proguardFiles setting in build.gradle.
4 | #
5 | # For more details, see
6 | # http://developer.android.com/guide/developing/tools/proguard.html
7 |
8 | # If your project uses WebView with JS, uncomment the following
9 | # and specify the fully qualified class name to the JavaScript interface
10 | # class:
11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
12 | # public *;
13 | #}
14 |
15 | # Uncomment this to preserve the line number information for
16 | # debugging stack traces.
17 | #-keepattributes SourceFile,LineNumberTable
18 |
19 | # If you keep the line number information, uncomment this to
20 | # hide the original source file name.
21 | #-renamesourcefileattribute SourceFile
22 |
--------------------------------------------------------------------------------
/XRetrofit/xretrofit/src/main/java/com/xretrofit/CallAdapter/ObjectCallAdapter.java:
--------------------------------------------------------------------------------
1 | package com.xretrofit.CallAdapter;
2 |
3 | import com.xretrofit.call.Call;
4 |
5 | import java.lang.reflect.Type;
6 |
7 | /**
8 | * @author bsnl_yanxuwen
9 | * @date 2021/2/4 17:49
10 | * Description :
11 | * 同步
12 | * Object 适配器,
13 | */
14 | public class ObjectCallAdapter implements CallAdapter