fix(oppo): strip empty params from submit body to fix sign mismatch (errno=800004)
OPPO server includes all received body params in server-side signature computation; sending empty-string optional params while excluding them from the client-side sign produces a mismatch. Remove empty entries from params map before building both the api_sign and the POST body so both sides operate on identical param sets. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
这个提交包含在:
父节点
501d7e09ab
当前提交
4d2faa33de
@ -2050,6 +2050,9 @@ public class StoreSubmissionService {
|
|||||||
params.put("business_mobile", appInfo.path("business_mobile").asText(""));
|
params.put("business_mobile", appInfo.path("business_mobile").asText(""));
|
||||||
params.put("copyright_url", appInfo.path("copyright_url").asText(appInfo.path("electronic_cert_url").asText("")));
|
params.put("copyright_url", appInfo.path("copyright_url").asText(appInfo.path("electronic_cert_url").asText("")));
|
||||||
params.put("electronic_cert_url", appInfo.path("electronic_cert_url").asText(""));
|
params.put("electronic_cert_url", appInfo.path("electronic_cert_url").asText(""));
|
||||||
|
// OPPO sign algorithm excludes empty-string params; sending them in the body causes
|
||||||
|
// server-side signature mismatch (errno=800004). Strip empties from both sign and body.
|
||||||
|
params.entrySet().removeIf(e -> e.getValue() == null || e.getValue().isEmpty());
|
||||||
String requestUrl = oppoRequestUrl("https://oop-openapi-cn.heytapmobi.com/resource/v1/app/upd", params, token, false, clientSecret);
|
String requestUrl = oppoRequestUrl("https://oop-openapi-cn.heytapmobi.com/resource/v1/app/upd", params, token, false, clientSecret);
|
||||||
HttpHeaders headers = new HttpHeaders();
|
HttpHeaders headers = new HttpHeaders();
|
||||||
headers.setContentType(MediaType.APPLICATION_FORM_URLENCODED);
|
headers.setContentType(MediaType.APPLICATION_FORM_URLENCODED);
|
||||||
|
|||||||
正在加载...
在新工单中引用
屏蔽一个用户