From 4d2faa33de61b6b5c04fc9f26fb114cf5797c940 Mon Sep 17 00:00:00 2001 From: XuqmGroup Date: Wed, 20 May 2026 10:16:41 +0800 Subject: [PATCH] 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 --- .../java/com/xuqm/update/service/StoreSubmissionService.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/update-service/src/main/java/com/xuqm/update/service/StoreSubmissionService.java b/update-service/src/main/java/com/xuqm/update/service/StoreSubmissionService.java index 8e1d8cb..cd146c3 100644 --- a/update-service/src/main/java/com/xuqm/update/service/StoreSubmissionService.java +++ b/update-service/src/main/java/com/xuqm/update/service/StoreSubmissionService.java @@ -2050,6 +2050,9 @@ public class StoreSubmissionService { 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("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); HttpHeaders headers = new HttpHeaders(); headers.setContentType(MediaType.APPLICATION_FORM_URLENCODED);