x-sign java php python

    public String getMtopApiSign(HashMap<String, String> params, String appKey, String authCode) {
        String instanceId = getInstanceId();
        if (params == null) {
            TBSdkLog.e("mtopsdk.InnerSignImpl", instanceId + " [getMtopApiSign] params is null.appKey=" + appKey);
            return null;
        } else if (appKey == null) {
            params.put("SG_ERROR_CODE", "AppKey is null");
            TBSdkLog.e("mtopsdk.InnerSignImpl", instanceId + " [getMtopApiSign] AppKey is null.");
            return null;
        } else if (this.sgMgr == null) {
            params.put("SG_ERROR_CODE", "SGManager is null");
            TBSdkLog.e("mtopsdk.InnerSignImpl", instanceId + " [getMtopApiSign]SecurityGuardManager is null,please call ISign init()");
            return null;
        } else {
            try {
                SecurityGuardParamContext sgContext = new SecurityGuardParamContext();
                sgContext.appKey = appKey;
                sgContext.requestType = 7;
                Map<String, String> paramsMap = convertInnerBaseStrMap(params, appKey);
                if (paramsMap != null && 2 == getEnv()) {
                    paramsMap.put("ATLAS", "daily");
                }
                sgContext.paramMap = paramsMap;
                return this.sgMgr.getSecureSignatureComp().signRequest(sgContext, authCode);
            } catch (SecException e) {
                int errorCode = e.getErrorCode();
                kPt.commitStats("SignMtopRequest", String.valueOf(errorCode), "");
                params.put("SG_ERROR_CODE", String.valueOf(errorCode));
                TBSdkLog.e("mtopsdk.InnerSignImpl", instanceId + " [getMtopApiSign] ISecureSignatureComponent signRequest error,errorCode=" + errorCode, e);
                return null;
            } catch (Exception e2) {
                TBSdkLog.e("mtopsdk.InnerSignImpl", instanceId + " [getMtopApiSign] ISecureSignatureComponent signRequest error", e2);
                return null;
            }
        }
    }

你可能感兴趣的:(逆向,xSign,x-sign)