Browse Source

添加张伟对应的build variants,设置他的服务器不用加密

zengjiebin 8 years ago
parent
commit
70cdf09cdc

+ 21 - 3
app/build.gradle

@@ -65,6 +65,25 @@ android {
         ]
     }
     productFlavors {
+        sheepzhangwei {
+            applicationId "com.sheep.jiuyan.samllsheep"
+            manifestPlaceholders = [UMENG_CHANNEL_VALUE: "sheeptest",
+                                    DUANDUAN_GRAPH     : "sheeptest",
+                                    DUANDUAN_DATASHARE : "sheeptest",
+                                    UMENG_APPKEY       : "58edcfeb310c93091c000be2"
+            ]
+            buildConfigField "String", "DUANDUAN_DATASHARE", '"sheeptest"'
+            buildConfigField "String", "DUANDUAN_GRAPH", '"sheeptest"'
+            buildConfigField "boolean", "XXTEA_ENCRYPT", 'false'//不用加密
+//            buildConfigField "String", "API_DOMAIN", '"10.8.210.229:8081"'
+            buildConfigField "String", "API_DOMAIN", '"test.bdmapp.kfzs.com"'
+            buildConfigField "String", "APP_URL", '"http://10.8.220.5:8080/"'//张伟
+//            buildConfigField "String", "API_DOMAIN", '"10.8.210.229:8081"'
+            buildConfigField "String", "JFSC_DOMAIN", '"http://10.8.210.190:8080/"'//积分商城
+            buildConfigField "String", "CAPTCHA_DOMAIN", '"captcha.kuaifazs.com"'
+            buildConfigField "String", "umeng_appkey", '"58dc9509aed17959a3001bff"'
+            signingConfig signingConfigs.config
+        }
         sheeptest {
             applicationId "com.sheep.jiuyan.samllsheep"
             manifestPlaceholders = [UMENG_CHANNEL_VALUE: "sheeptest",
@@ -74,10 +93,9 @@ android {
             ]
             buildConfigField "String", "DUANDUAN_DATASHARE", '"sheeptest"'
             buildConfigField "String", "DUANDUAN_GRAPH", '"sheeptest"'
-            buildConfigField "boolean", "KF_DEBUG", 'true'
+            buildConfigField "boolean", "XXTEA_ENCRYPT", 'true'
 //            buildConfigField "String", "API_DOMAIN", '"10.8.210.229:8081"'
             buildConfigField "String", "API_DOMAIN", '"test.bdmapp.kfzs.com"'
-//            buildConfigField "String", "APP_URL", '"http://10.8.220.5:8080/"'//张伟
             buildConfigField "String", "APP_URL", '"http://test.sheep.kfzs.com/"'
 //            buildConfigField "String", "API_DOMAIN", '"10.8.210.229:8081"'
             buildConfigField "String", "JFSC_DOMAIN", '"http://10.8.210.190:8080/"'//积分商城
@@ -95,7 +113,7 @@ android {
             ]
             buildConfigField "String", "DUANDUAN_DATASHARE", '"sheep"'
             buildConfigField "String", "DUANDUAN_GRAPH", '"sheep"'
-            buildConfigField "boolean", "KF_DEBUG", 'false'
+            buildConfigField "boolean", "XXTEA_ENCRYPT", 'false'
             buildConfigField "String", "API_DOMAIN", '"app.bandai.yunduanzs.cn"'
             buildConfigField "String", "APP_URL", '"http://ss.kfzs.com/"'
 //            buildConfigField "String", "APP_URL", '"http://10.8.220.5:8080/"'//张伟

+ 1 - 1
app/src/main/java/com/kfzs/duanduan/KFZSApp.java

@@ -45,7 +45,7 @@ import java.util.Map;
  */
 public class KFZSApp extends MultiDexApplication {
 
-    public static final boolean DEBUG = BuildConfig.KF_DEBUG;
+    public static final boolean DEBUG = BuildConfig.DEBUG;
 
     public static final String SD_PATH_EXTERNAL = Environment.getExternalStorageDirectory()
             .getAbsolutePath();

+ 20 - 0
app/src/main/java/com/kfzs/duanduan/fragment/FgtSmallSheep.java

@@ -36,6 +36,7 @@ import com.sheep.gamegroup.event.UserNameChange;
 import com.sheep.gamegroup.model.entity.BaseMessage;
 import com.sheep.gamegroup.model.entity.MoreDataEntity;
 import com.sheep.gamegroup.model.entity.UserEntity;
+import com.sheep.gamegroup.model.util.SheepSubscriber;
 import com.sheep.gamegroup.presenter.SmallSheepContract;
 import com.sheep.gamegroup.presenter.SmallSheepPresenter;
 import com.sheep.gamegroup.util.AppUtil;
@@ -67,6 +68,8 @@ import butterknife.ButterKnife;
 import butterknife.OnClick;
 import butterknife.Unbinder;
 import de.hdodenhof.circleimageview.CircleImageView;
+import rx.android.schedulers.AndroidSchedulers;
+import rx.schedulers.Schedulers;
 
 public class FgtSmallSheep extends BaseCompatFragment implements SmallSheepContract.View {
 
@@ -258,6 +261,23 @@ public class FgtSmallSheep extends BaseCompatFragment implements SmallSheepContr
                 .load(AppUtil.getQRLink(userEntity.getShare_link(), 800))
                 .apply(new RequestOptions().diskCacheStrategy(DiskCacheStrategy.RESOURCE))
                 .preload(800, 800);
+        if(userEntity.getNewbie_task_status() < 16){//为16时代表已经完成所有新手任务,不是新手
+            SheepApp.getInstance().getNetComponent().getApiService().getNewbieTask()
+                            .subscribeOn(Schedulers.io())
+                            .observeOn(AndroidSchedulers.mainThread())
+                            .subscribe(new SheepSubscriber<BaseMessage>(getContext()) {
+                                @Override
+                                public void onNext(BaseMessage baseMessage) {
+                                    System.out.println(JSON.toJSONString(baseMessage));
+                                }
+
+                                @Override
+                                public void onError(BaseMessage baseMessage) {
+                                    System.out.println(JSON.toJSONString(baseMessage));
+                                }
+                            });
+
+        }
 
     }
 

+ 0 - 357
app/src/main/java/com/kfzs/duanduan/utils/net/UploadHttpURLConnectionUtils.java

@@ -1,357 +0,0 @@
-package com.kfzs.duanduan.utils.net;
-
-import android.text.TextUtils;
-import android.util.Log;
-
-import com.kfzs.appstore.utils.string.MD5Utils;
-import com.sheep.jiuyan.samllsheep.BuildConfig;
-
-import java.io.DataOutputStream;
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.net.HttpURLConnection;
-import java.net.URL;
-import java.util.Map;
-import java.util.UUID;
-import java.util.concurrent.ConcurrentHashMap;
-
-/**
- * this utils use {@link HttpURLConnection} and send file to new {@link Thread}
- * <br/><li/>must not be use at UI thread
- * <pre>
- *     sinlov
- *
- *     /\__/\
- *    /`    '\
- *  ≈≈≈ 0  0 ≈≈≈ Hello world!
- *    \  --  /
- *   /        \
- *  /          \
- * |            |
- *  \  ||  ||  /
- *   \_oo__oo_/≡≡≡≡≡≡≡≡o
- *
- * </pre>
- * Created by sinlov on 17/3/30.
- */
-public class UploadHttpURLConnectionUtils {
-
-    public static final boolean debug = BuildConfig.KF_DEBUG;
-    public static final int SET_DEFAULT_TIME_OUT = 30 * 1000;
-    public static final int SET_DEFAULT_PROGRESS_PERCENTAGE = 99;
-    public static final String SET_DEFAULT_CHARSET = "utf-8";
-    public static final String SET_DEFAULT_REQUEST_METHOD = "POST";
-
-    public static final String KEY_DEFAULT_SECURITY = "Authorization";
-    public static final String KEY_DEFAULT_FILE_NAME = "asset_name";
-    public static final String KEY_DEFAULT_MD5 = "md5_key";
-
-    public static final String MSG_DEFAULT_FILE_IS_EMPTY = "you want send file is empty";
-    public static final String MSG_DEFAULT_OUT_OF_TIME = "sending error, out of time";
-    public static final String MSG_DEFAULT_RESPONSE_IS_EMPTY = "response is empty";
-
-    private static final String TAG = "UploadFile";
-    private static final String LINE_END = "\r\n";
-    private static final String PREFIX = "--";
-    private static final String CONTENT_DISPOSITION_START = "Content-Disposition: form-data;";
-    private static final String CONTENT_DISPOSITION_FROM_START = " ";
-    private static final String CONTENT_DISPOSITION_FROM_MID = "=\"";
-    private static final String CONTENT_DISPOSITION_FROM_END = "\";";
-    private static final String CONTENT_TYPE_FORM_DATA_DEFAULT = "multipart/form-data";
-    private static final String CONTENT_TYPE_OCTET_STREAM_CHARSET = "Content-Type: image/jpeg; charset=";
-
-    private final String filenameKey;
-    private int newLen = 0;
-    private int fileMaxLen;
-    private int nowLen;
-    private ConcurrentHashMap<String, String> urlParams;
-    private ConcurrentHashMap<String, String> fromData;
-
-    private String requestMethod = SET_DEFAULT_REQUEST_METHOD;
-    private String charset = SET_DEFAULT_CHARSET;
-    private String contentType = CONTENT_TYPE_FORM_DATA_DEFAULT;
-    private int timeOut = SET_DEFAULT_TIME_OUT;
-    private String md5Key = KEY_DEFAULT_MD5;
-    private String securityKey = KEY_DEFAULT_SECURITY;
-    private int progressPercentage = SET_DEFAULT_PROGRESS_PERCENTAGE;
-
-    private String errorMsgFileEmpty = MSG_DEFAULT_FILE_IS_EMPTY;
-    private String errorMsgOutOfTime = MSG_DEFAULT_OUT_OF_TIME;
-    private String errorMsgResponseEmpty = MSG_DEFAULT_RESPONSE_IS_EMPTY;
-
-    private String securityValue;
-
-    private String sendingType;
-
-    private UploadFileCallBack uploadFileCallBack;
-
-    /**
-     * default percentage {@link #SET_DEFAULT_PROGRESS_PERCENTAGE}
-     *
-     * @param progressPercentage percentage
-     */
-    public void setProgressPercentage(int progressPercentage) {
-        this.progressPercentage = progressPercentage;
-    }
-
-    public void setSecurityValue(String securityValue) {
-        this.securityValue = securityValue;
-    }
-
-    public void setSecurityKey(String securityKey) {
-        this.securityKey = securityKey;
-    }
-
-    public void setErrorMsgFileEmpty(String errorMsgFileEmpty) {
-        this.errorMsgFileEmpty = errorMsgFileEmpty;
-    }
-
-    public void setErrorMsgOutOfTime(String errorMsgOutOfTime) {
-        this.errorMsgOutOfTime = errorMsgOutOfTime;
-    }
-
-    public void setErrorMsgResponseEmpty(String errorMsgResponseEmpty) {
-        this.errorMsgResponseEmpty = errorMsgResponseEmpty;
-    }
-
-    public void setUrlParams(ConcurrentHashMap<String, String> urlParams) {
-        this.urlParams = urlParams;
-    }
-
-    public void setFromData(ConcurrentHashMap<String, String> fromData) {
-        this.fromData = fromData;
-    }
-
-    public void setTimeOut(int timeOut) {
-        this.timeOut = timeOut;
-    }
-
-    public void setRequestMethod(String requestMethod) {
-        this.requestMethod = requestMethod;
-    }
-
-    public void setCharset(String charset) {
-        this.charset = charset;
-    }
-
-    public void setMd5Key(String md5Key) {
-        this.md5Key = md5Key;
-    }
-
-    public void setContentType(String contentType) {
-        this.contentType = contentType;
-    }
-
-    public void setUploadFileCallBack(UploadFileCallBack uploadFileCallBack) {
-        this.uploadFileCallBack = uploadFileCallBack;
-    }
-
-    public int getFileMaxLen() {
-        return fileMaxLen;
-    }
-
-    public void uploadFileByThread(final File file, final String requestURL) {
-        Thread uploadThread = new Thread() {
-            @Override
-            public void run() {
-                uploadFile(file, requestURL);
-            }
-        };
-        uploadThread.start();
-    }
-
-    /**
-     * upload file to services, and return http response code
-     * <ol>
-     * <li/> if out of time will return {@link HttpURLConnection#HTTP_INTERNAL_ERROR}
-     * </ol>
-     *
-     * @param file       for upload file object
-     * @param requestURL request full url
-     * @return http response
-     */
-    private int uploadFile(File file, String requestURL) {
-        int resCode = HttpURLConnection.HTTP_INTERNAL_ERROR;
-        try {
-            if (file != null) {
-
-                String BOUNDARY = UUID.randomUUID().toString(); // random UUID for boundary
-                ConcurrentHashMap<String, String> urlParesData = new ConcurrentHashMap<String, String>();
-                if (urlParams != null) {
-                    urlParesData.putAll(urlParams);
-                }
-                String md5Value = MD5Utils.md5CheckFileByFile(file, MD5Utils.TYPE_LOWER);
-                if (!TextUtils.isEmpty(md5Value)) {
-                    urlParesData.put(md5Key, md5Value);
-                } else {
-                    if (uploadFileCallBack != null) {
-                        uploadFileCallBack.responseUploadError(UploadFileCallBack.ERROR_FILE_MD5_HASH_ERROR, "file md5 hash error");
-                    }
-                    return UploadFileCallBack.ERROR_FILE_MD5_HASH_ERROR;
-                }
-                requestURL = matchURL(requestURL, urlParesData);
-                // fromMatchData
-                ConcurrentHashMap<String, String> fromMatchData = new ConcurrentHashMap<String, String>();
-                fromMatchData.put("name", filenameKey);
-                fromMatchData.put("filename", file.getName());
-                if (fromData != null) {
-                    fromMatchData.putAll(fromData);
-                }
-                // httpURLConnection setting
-                URL url = new URL(requestURL);
-                HttpURLConnection conn = (HttpURLConnection) url.openConnection();
-                conn.setReadTimeout(timeOut);
-                conn.setConnectTimeout(timeOut);
-                conn.setDoInput(true); // allow input
-                conn.setDoOutput(true); // allow output
-                conn.setUseCaches(false); // not allow user catch
-                conn.setRequestMethod(requestMethod); // request method
-                conn.setRequestProperty("Charset", charset); // set char
-                conn.setRequestProperty("connection", "keep-alive");// connection way
-                if (!TextUtils.isEmpty(securityValue)) {
-                    conn.setRequestProperty(securityKey, securityValue);
-                }
-                conn.setRequestProperty("Content-Type", contentType + ";boundary=" + BOUNDARY);// setting UUID for boundary
-                DataOutputStream dos = new DataOutputStream(conn.getOutputStream());
-
-                StringBuffer contentAppender = new StringBuffer();
-                contentAppender.append(PREFIX);
-                contentAppender.append(BOUNDARY);
-                contentAppender.append(LINE_END);
-
-                // match form data
-                matchFormData(contentAppender, fromMatchData);
-
-                // match stream head
-                contentAppender.append(CONTENT_TYPE_OCTET_STREAM_CHARSET)
-                        .append(charset)
-                        .append(LINE_END);
-                contentAppender.append(LINE_END);
-                // append file stream
-                dos.write(contentAppender.toString().getBytes());
-                InputStream is = new FileInputStream(file);
-                byte[] bytes = new byte[1024];
-                fileMaxLen = is.available();
-                int len;
-                while ((len = is.read(bytes)) != -1) {
-                    dos.write(bytes, 0, len);
-                    newLen = newLen + len;
-                    if (uploadFileCallBack != null) {
-                        int progress = (newLen * progressPercentage) / fileMaxLen;
-                        if (progress != nowLen) {
-                            nowLen = progress;
-                        }
-                        uploadFileCallBack.uploadProgress(nowLen);
-                    }
-                }
-                is.close();
-                dos.write(LINE_END.getBytes());
-                byte[] end_data = (PREFIX + BOUNDARY + PREFIX + LINE_END)
-                        .getBytes();
-                dos.write(end_data);
-                dos.flush();
-                // start get response
-                resCode = conn.getResponseCode();
-                InputStream input = conn.getInputStream();
-                StringBuffer responseAppender = new StringBuffer();
-                if (input != null) {
-                    int ss;
-                    while ((ss = input.read()) != -1) {
-                        responseAppender.append((char) ss);
-                    }
-                } else {
-                    responseAppender.append(errorMsgResponseEmpty);
-                }
-                if (resCode == 200) {
-                    if (uploadFileCallBack != null) {
-                        uploadFileCallBack.responseUploadSuccess(responseAppender.toString());
-                    }
-                } else {
-                    uploadFileCallBack.responseUploadError(resCode, responseAppender.toString());
-                    w("request error: " + responseAppender.toString());
-                }
-            } else {
-                if (uploadFileCallBack != null) {
-                    uploadFileCallBack.responseUploadError(UploadFileCallBack.ERROR_FILE_IS_EMPTY, errorMsgFileEmpty);
-                }
-            }
-        } catch (IOException e) {
-            e.printStackTrace();
-            uploadFileCallBack.responseUploadError(UploadFileCallBack.ERROR_OUT_OF_TIME, errorMsgOutOfTime);
-        }
-        return resCode;
-    }
-
-    private String matchURL(String head, ConcurrentHashMap<String, String> urlParams) {
-        if (null == urlParams) {
-            return head;
-        }
-        StringBuffer sb = new StringBuffer();
-        sb.append(head);
-        sb.append("?");
-        for (Map.Entry<String, String> param : urlParams.entrySet()) {
-            sb.append(param.getKey());
-            sb.append("=");
-            sb.append(param.getValue());
-            sb.append("&");
-        }
-        sb.setLength(sb.length() - 1);
-        return sb.toString();
-    }
-
-    private void matchFormData(StringBuffer strBuffer, ConcurrentHashMap<String, String> formData) {
-        strBuffer.append(CONTENT_DISPOSITION_START);
-        for (Map.Entry data : formData.entrySet()) {
-            strBuffer.append(CONTENT_DISPOSITION_FROM_START);
-            strBuffer.append(data.getKey());
-            strBuffer.append(CONTENT_DISPOSITION_FROM_MID);
-            strBuffer.append(data.getValue());
-            strBuffer.append(CONTENT_DISPOSITION_FROM_END);
-        }
-        strBuffer.append(LINE_END);
-    }
-
-    private void e(String msg) {
-        if (debug) {
-            Log.e(TAG, msg);
-        }
-    }
-
-    private void e(String msg, Throwable tr) {
-        if (debug) {
-            Log.e(TAG, msg, tr);
-        }
-    }
-
-    private void w(String msg) {
-        if (debug) {
-            Log.w(TAG, msg);
-        }
-    }
-
-    private void w(String msg, Throwable tr) {
-        if (debug) {
-            Log.w(TAG, msg, tr);
-        }
-    }
-
-    /**
-     * set services get file key {@link #KEY_DEFAULT_FILE_NAME}
-     */
-    public UploadHttpURLConnectionUtils() {
-        this.filenameKey = KEY_DEFAULT_FILE_NAME;
-
-        this.sendingType = "Content-Type: image/jpeg; charset=";
-    }
-
-    /**
-     * filenameKey is Service get file Key
-     *
-     * @param filenameKey {@link String}
-     */
-    public UploadHttpURLConnectionUtils(String filenameKey) {
-        this.filenameKey = filenameKey;
-    }
-}

+ 42 - 37
app/src/main/java/com/sheep/gamegroup/model/api/ApiService.java

@@ -39,54 +39,54 @@ public interface ApiService {
      * @return
      */
     @Streaming
-    @POST(V1+"app/auth/sms_for_login/")
+    @POST("app/auth/sms_for_login/")
     Observable<BaseMessage> getCaptcha(@Body JSONObject jsonObject);
 
-    @POST(V1+"app/auth/login_by_sms/")
+    @POST("app/auth/login_by_sms/")
     Observable<BaseMessage> loginByCaptcha(@Body JSONObject jsonObject);
 
     /**
      * 获取用户信息
      */
-    @GET(V1+"app/user/get_info/")
+    @GET("app/user/get_info/")
     Observable<BaseMessage> getInfo();
     /**
      * 获取用户的已经挂机微信
      */
-    @GET(V1+"app/wechat/")
+    @GET("app/wechat/")
     Observable<BaseMessage> getWebchat();
     /**
      * 提交用户的微信账号与密码
      */
-    @POST(V1+"app/wechat/")
+    @POST("app/wechat/")
     Observable<BaseMessage> postWebchat(@Body JSONObject jsonObject);
     /**
      * 提交用户的微信账号与密码
      */
-    @PUT(V1+"app/wechat/{id}")
+    @PUT("app/wechat/{id}")
     Observable<BaseMessage> putWebchat(@Path("id") int id, @Body JSONObject jsonObject);
 
     /**
      * 绑定手机号
      */
-    @PUT(V1+"app/user/bind_mobile/")
+    @PUT("app/user/bind_mobile/")
     Observable<BaseMessage> bindMobile(@Query("mobile") String mobile, @Query("sec_code") String sec_code);
     /**
      * 绑定真实姓名
      */
-    @PUT(V1+"app/user/bind_real_name/")
+    @PUT("app/user/bind_real_name/")
     Observable<BaseMessage> bindRealname(@Body JSONObject object);
 //    Observable<BaseMessage> bindRealname(@Query("real_name") String real_name);
     /**
      * 绑定身份证号
      */
-    @PUT(V1+"app/user/bind_id_number/")
+    @PUT("app/user/bind_id_number/")
 //    Observable<BaseMessage> bindIdNumber(@Query("id_number") String id_number);
     Observable<BaseMessage> bindIdNumber(@Body JSONObject objec);
     /**
      * 绑定银行卡
      */
-    @PUT(V1+"app/user/bind_bank_card/")
+    @PUT("app/user/bind_bank_card/")
     Observable<BaseMessage> bindBankCard(@Body JSONObject objec);
 
     /**
@@ -95,37 +95,37 @@ public interface ApiService {
      * type "体现渠道 1:微信 2:支付宝 3:手机充值"
      * now only 1:微信
      */
-    @POST(V1 + "app/withdraw/")
+    @POST("app/withdraw/")
     Observable<BaseMessage> goWithdrawal(@Body JSONObject parame);
 
     /**
      * 提现绑定微信号
      */
-    @GET(V1 + "app/user/bind_wx/")
+    @GET("app/user/bind_wx/")
     Observable<BaseMessage> bindWeixin(@Query("code") String code);
 
     /**
      * 获取已接受任务
      */
-    @GET(V1 + "app/accepted_task/")
+    @GET("app/accepted_task/")
     Observable<BaseMessage> acceptedTask(@Query("page") int page, @Query("per_page") int per_page);
 
     /**
      * 提交任务
      */
-    @POST(V1 + "app/accepted_task/")
+    @POST("app/accepted_task/")
     Observable<BaseMessage> acceptedTask(@Body JSONObject parame);
 
     /**
      * 获取自己正在运行的任务
      */
-    @GET(V1 + "app/accepted_task/run_task/")
+    @GET("app/accepted_task/run_task/")
     Observable<BaseMessage> returnTask();
 
     /**
      * 获取正在运行的任务
      */
-    @GET(V1 + "app/release_task/")
+    @GET("app/release_task/")
     Observable<BaseMessage> releaseTask();
 
 
@@ -133,12 +133,12 @@ public interface ApiService {
     /**
      * 邀请赚钱
      */
-    @GET(V1+"app/auth/login_by_we_chat")
+    @GET("app/auth/login_by_we_chat")
     Observable<BaseMessage> askMakeMoney(@Body String jsonObject);
     /**
      * 用户提现记录
      */
-    @GET(V1 + "app/withdraw/")
+    @GET("app/withdraw/")
     Observable<BaseMessage> goWithdrawal(@Query("page") int page, @Query("per_page") int per_page, @Query("start_time ") String start_time , @Query("end_time ") String end_time );
 
 
@@ -147,7 +147,7 @@ public interface ApiService {
      * 获取正在运行的任务
      * @param jsonObject
      */
-    @POST(V1+"app/auth/login_by_we_chat")
+    @POST("app/auth/login_by_we_chat")
     Observable<BaseMessage> LoginByWX(@Body com.alibaba.fastjson.JSONObject jsonObject);
 
 
@@ -156,35 +156,35 @@ public interface ApiService {
      * 获取正在运行的任务
      * @param jsonObject
      */
-    @POST(V1+"app/auth/login_by_qq")
+    @POST("app/auth/login_by_qq")
     Observable<BaseMessage> LoginByQQ(@Body com.alibaba.fastjson.JSONObject jsonObject);
 
 
 
-    @GET(V1+"app/user/friend_count_and_award")
+    @GET("app/user/friend_count_and_award")
     Observable<BaseMessage> FriendCountAndAward();
 
     /**
      * 放弃任务
      */
-    @PUT(V1+"app/accepted_task/give_up/")
+    @PUT("app/accepted_task/give_up/")
     Observable<BaseMessage> giveUpTask(@Query("id") int id);
 
     /**
      * 获取任务显示状态
      */
-    @GET(V1 + "app/task_log/node/{id}")
+    @GET("app/task_log/node/{id}")
     Observable<BaseMessage> giveTaskStatue(@Path("id") int id);
 
 
 
-    @PUT(V1+"app/user/change_base_info")
+    @PUT("app/user/change_base_info")
     Observable<BaseMessage> changeBaseInfo (@Body com.alibaba.fastjson.JSONObject jsonObject);
 
     /**
      * 更换手机号
      */
-    @POST(V1 + "app/user/switch_phone")
+    @POST("app/user/switch_phone")
     Observable<BaseMessage> switchPhone(@Body JSONObject jsonObject);
 
 
@@ -192,31 +192,31 @@ public interface ApiService {
     /**
      * 更换手机号
      */
-    @PUT(V1 + "app/user/bind_all_real_info")
+    @PUT("app/user/bind_all_real_info")
     Observable<BaseMessage> bindALl(@Body JSONObject jsonObject);
     /**
      * 绑定手机号
      */
-    @PUT(V1 + "app/user/bind_mobile")
+    @PUT("app/user/bind_mobile")
     Observable<BaseMessage> bindPhone(@Body JSONObject jsonObject);
 
     /**
      * 更换手机号
      */
-    @GET(V1 + "app/user/award_detail")
+    @GET("app/user/award_detail")
     Observable<BaseMessage> awardDetail(@Query("page") int page,@Query("per_page") int per_page);
     /**
      * 发送绑定手机号短信,只传mobile
      */
-    @POST(V1 + "app/user/sms_for_bind_mobile")
+    @POST("app/user/sms_for_bind_mobile")
     Observable<BaseMessage> smsBindMobile(@Body JSONObject jsonObject);
     /**
      * 修改任务进度
      */
-    @GET(V1 + "app/accepted_task/status")
+    @GET("app/accepted_task/status")
     Observable<BaseMessage> taskStatus(@Query("id") int id,@Query("screenshots") String screenshots,
         @Query("remark") String remark,@Query("package_name") String package_name,@Query("status") String status);
-//    @GET(V1 + "app/accepted_task/status")
+//    @GET("app/accepted_task/status")
 //    Observable<BaseMessage> taskStatus(@Body JSONObject jsonObject);
 
     /**
@@ -224,27 +224,32 @@ public interface ApiService {
      * @param jsonObject
      * @return
      */
-    @PUT(V1 + "app/accepted_task/download_task_notify/")
+    @PUT("app/accepted_task/download_task_notify/")
     Observable<BaseMessage> taskDownloadNotify(@Body JSONObject jsonObject);
 
     /**
      * 获取可用余额
      * @return
      */
-    @GET(V1 +"app/user/get_can_withdraw_amount")
+    @GET("app/user/get_can_withdraw_amount")
     Observable<BaseMessage> getCanWithdrawAmount();
 
-    @GET(V1 + "loan/userRecord")
+    @GET("loan/userRecord")
     Observable<BaseMessage> userRecord();
-    @GET(V1 + "loan/getYinkerLoanUrl")
+    @GET("loan/getYinkerLoanUrl")
     Observable<BaseMessage> getYinkerLoanUrl();
-    @GET(V1 + "loan/getYinkerRepaymentUrl")
+    @GET("loan/getYinkerRepaymentUrl")
     Observable<BaseMessage> getYinkerRepaymentUrl();
 
 
     /**
      * 统计数据
      */
-    @POST(V1+"app/event_tracking")
+    @POST("app/event_tracking")
     Observable<BaseMessage> appEventTracking(@Body JSONObject jsonObject);
+
+    @GET("app/newbie_task")
+    Observable<BaseMessage> getNewbieTask();
+    @POST("app/newbie_task/learn_finish")
+    Observable<BaseMessage> appNewbieTaskLearnFinish(@Body JSONObject jsonObject);
 }

+ 10 - 0
app/src/main/java/com/sheep/gamegroup/model/entity/UserEntity.java

@@ -55,6 +55,8 @@ public class UserEntity implements Serializable {
     private String wx_nickname;
     @Column(name = "share_link")
     private String share_link;
+    @Column(name = "newbie_task_status")
+    private int newbie_task_status;
 
     public String getWx_nickname() {
         return wx_nickname;
@@ -223,4 +225,12 @@ public class UserEntity implements Serializable {
     public void setShare_link(String share_link) {
         this.share_link = share_link;
     }
+
+    public int getNewbie_task_status() {
+        return newbie_task_status;
+    }
+
+    public void setNewbie_task_status(int newbie_task_status) {
+        this.newbie_task_status = newbie_task_status;
+    }
 }

+ 2 - 2
app/src/main/java/com/sheep/gamegroup/model/util/AddPuplicParameIntercept.java

@@ -8,6 +8,7 @@ import com.sheep.gamegroup.model.api.BaseMessageConverter;
 import com.sheep.gamegroup.model.api.StringConverter;
 import com.sheep.gamegroup.model.entity.BaseMessage;
 import com.sheep.gamegroup.util.DeviceUtil;
+import com.sheep.jiuyan.samllsheep.BuildConfig;
 import com.sheep.jiuyan.samllsheep.SheepApp;
 import com.sheep.jiuyan.samllsheep.utils.SpUtils;
 
@@ -56,7 +57,7 @@ public class AddPuplicParameIntercept implements Interceptor {
                 .newBuilder();
         String method = oldRequest.method();
         RequestBody body = oldRequest.body();
-        if (method.equals("POST") || method.equals("PUT") ) {
+        if (BuildConfig.XXTEA_ENCRYPT && (method.equals("POST") || method.equals("PUT"))) {//张伟服务器不用加密
             RequestBody requestBody = oldRequest.body();
             if (requestBody instanceof FormBody) {
             } else if (requestBody != null){
@@ -71,7 +72,6 @@ public class AddPuplicParameIntercept implements Interceptor {
                 String newJsonParams = BaseMessageConverter.encrypt(oldParamsJson);
                 if(!TextUtils.isEmpty(newJsonParams))
                     body = RequestBody.create(requestBody.contentType(), newJsonParams);
-//                oldRequest = oldRequest.newBuilder().post(body).build();
             }
         }
         String id = SpUtils.getOpenId(SheepApp.mContext);

+ 1 - 3
app/src/main/java/com/sheep/gamegroup/util/ConnectAddress.java

@@ -8,11 +8,9 @@ import com.sheep.jiuyan.samllsheep.BuildConfig;
 
 public class ConnectAddress {
 
-    public static final String V1 = "/v1/";
-
     /**
      * 接口地址
      */
-    public static final String APP_URL = BuildConfig.APP_URL;
+    public static final String APP_URL = BuildConfig.APP_URL+"v1/";
 
 }

+ 6 - 5
app/src/main/java/com/sheep/gamegroup/view/dialog/DialogNewbieTask1.java

@@ -6,17 +6,16 @@ import android.support.v7.app.AlertDialog;
 import android.view.View;
 import android.widget.TextView;
 
+import com.arialyy.aria.core.Aria;
 import com.kfzs.duanduan.utils.dlg.ViewFindUtils;
 import com.sheep.gamegroup.util.RxjavaCountDownTimer;
 import com.sheep.jiuyan.samllsheep.BuildConfig;
 import com.sheep.jiuyan.samllsheep.R;
+import com.sheep.jiuyan.samllsheep.utils.ClassFileHelper;
 
-import java.util.concurrent.TimeUnit;
+import java.io.File;
 
-import io.reactivex.Flowable;
-import io.reactivex.android.schedulers.AndroidSchedulers;
-import io.reactivex.disposables.Disposable;
-import io.reactivex.functions.Consumer;
+import static com.sheep.jiuyan.samllsheep.utils.ClassFileHelper.DIR;
 
 
 public class DialogNewbieTask1 {
@@ -47,6 +46,8 @@ public class DialogNewbieTask1 {
                     @Override
                     public void onClick(View v) {
                         mAlertDialog.dismiss();
+//                        Aria.download(activity).loadFtp("ftp://ygdy8:ygdy8@yg72.dydytt.net:8189/阳光电影www.ygdy8.com.深海狂鲨2.BD.720p.中英双字幕.mkv")
+//                                .setFilePath(DIR+ File.separator+"深海狂鲨.mkv").start();
                     }
                 });
         mAlertDialog.setOnDismissListener(new DialogInterface.OnDismissListener() {

+ 13 - 0
app/src/main/res/drawable-mdpi/shape_bg_button_unpress.xml

@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="utf-8"?>
+<shape xmlns:android="http://schemas.android.com/apk/res/android"
+    android:shape="rectangle" >
+    <!-- 圆角半径 -->
+    <corners android:radius="200dp" />
+    <!-- 填充颜色 -->
+    <solid android:color="@android:color/holo_blue_light"/>
+    <!-- 线的宽度,颜色灰色 -->
+    <stroke android:width="1dp"
+        android:color="#fff"
+        />
+
+</shape>

+ 1 - 1
datashare/build.gradle

@@ -12,7 +12,7 @@ android {
     }
 
     greendao {
-        schemaVersion 5
+        schemaVersion 6
         targetGenDir 'src/main/java'
     }
     buildTypes {

+ 2 - 2
datashare/src/main/java/com/kfzs/duanduan/data/graph/provider/channel/DaoMaster.java

@@ -18,10 +18,10 @@ import com.kfzs.duanduan.datashare.provider.download.DownLoadInfoDao;
 
 // THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT.
 /**
- * Master of DAO (schema version 5): knows all DAOs.
+ * Master of DAO (schema version 6): knows all DAOs.
  */
 public class DaoMaster extends AbstractDaoMaster {
-    public static final int SCHEMA_VERSION = 5;
+    public static final int SCHEMA_VERSION = 6;
 
     /** Creates underlying database table using DAOs. */
     public static void createAllTables(Database db, boolean ifNotExists) {