diff --git a/app/src/main/java/com/huanchengfly/tieba/post/api/ProtobufRequest.kt b/app/src/main/java/com/huanchengfly/tieba/post/api/ProtobufRequest.kt index bc02a01e..1f8a163a 100644 --- a/app/src/main/java/com/huanchengfly/tieba/post/api/ProtobufRequest.kt +++ b/app/src/main/java/com/huanchengfly/tieba/post/api/ProtobufRequest.kt @@ -32,11 +32,13 @@ fun buildProtobufRequestBody( return MyMultipartBody.Builder(BOUNDARY) .apply { setType(MyMultipartBody.FORM) + if (clientVersion != ClientVersion.TIEBA_V12) { + addFormDataPart(Param.CLIENT_VERSION, clientVersion.version) + } if (needSToken) { val sToken = AccountUtil.getSToken() if (sToken != null) addFormDataPart(Param.STOKEN, sToken) } - addFormDataPart(Param.CLIENT_VERSION, clientVersion.version) addFormDataPart("data", "file", data.encode().toRequestBody()) } .build() diff --git a/app/src/main/java/com/huanchengfly/tieba/post/api/interfaces/impls/MixedTiebaApiImpl.kt b/app/src/main/java/com/huanchengfly/tieba/post/api/interfaces/impls/MixedTiebaApiImpl.kt index 1c5330eb..5e1e1fab 100644 --- a/app/src/main/java/com/huanchengfly/tieba/post/api/interfaces/impls/MixedTiebaApiImpl.kt +++ b/app/src/main/java/com/huanchengfly/tieba/post/api/interfaces/impls/MixedTiebaApiImpl.kt @@ -947,8 +947,10 @@ object MixedTiebaApiImpl : ITiebaApi { with_group = 1, yuelaou_locate = "" ) - ) - ) + ), + clientVersion = ClientVersion.TIEBA_V12 + ), + forumName = forumName ) } @@ -1130,7 +1132,9 @@ object MixedTiebaApiImpl : ITiebaApi { is_comm_reverse = 0, ori_ugc_type = 0 ) - ) + ), + clientVersion = ClientVersion.TIEBA_V12, + needSToken = false ) ) } diff --git a/app/src/main/java/com/huanchengfly/tieba/post/api/retrofit/RetrofitTiebaApi.kt b/app/src/main/java/com/huanchengfly/tieba/post/api/retrofit/RetrofitTiebaApi.kt index ddac4e99..d08aa675 100644 --- a/app/src/main/java/com/huanchengfly/tieba/post/api/retrofit/RetrofitTiebaApi.kt +++ b/app/src/main/java/com/huanchengfly/tieba/post/api/retrofit/RetrofitTiebaApi.kt @@ -220,15 +220,6 @@ object RetrofitTiebaApi { Header.USER_AGENT to { "bdtb for Android ${ClientVersion.TIEBA_V12.version}" }, Header.X_BD_DATA_TYPE to { "protobuf" }, ), - defaultCommonParamInterceptor - Param.OS_VERSION + CommonParamInterceptor( - Param.CUID to { CuidUtils.getNewCuid() }, - Param.CUID_GALAXY2 to { CuidUtils.getNewCuid() }, - Param.CUID_GID to { "" }, - Param.FROM to { "tieba" }, - Param.CLIENT_VERSION to { ClientVersion.TIEBA_V12.version }, - Param.CUID_GALAXY3 to { UIDUtil.getAid() }, - Param.OAID to { UIDUtil.getOAID() }, - ), stParamInterceptor, ) }