Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

升级AGP8 开启混淆后 Controller 报错 #534

Open
Mocaris opened this issue Mar 18, 2024 · 1 comment
Open

升级AGP8 开启混淆后 Controller 报错 #534

Mocaris opened this issue Mar 18, 2024 · 1 comment

Comments

@Mocaris
Copy link

Mocaris commented Mar 18, 2024

Controller MappingHandler 实现类里面,如下代码报错
报错行:
Type body0Type = new TypeWrapper(){}.getType();

log:
java.lang.Class cannot be cast to java.lang.reflect.ParameterizedType
/** ---------- Building Parameters ---------- **/

CallJsFuncDTO body0 = null;
if (converter != null && requestBody != null) {
  Type body0Type = new TypeWrapper<CallJsFuncDTO>(){}.getType();
  InputStream stream = requestBody.stream();
  MediaType mimeType = requestBody.contentType();
  body0 = converter.convert(stream, mimeType, body0Type);
}
if (body0 == null) {
  throw new BodyMissingException();
}
Object o = ((WebController)mHost).callJsFunc(body0);
return new ObjectView(true, o);

===================================
data class CallJsFuncDTO(
@SerializedName("funcName") val funcName: String = "",
@SerializedName("params") val params: Any? = null,
)

//Controller

@PostMapping("/callJsFunc")
fun callJsFunc(@RequestBodydto: CallJsFuncDTO): ResultRepose {}

@yanzhenjie
Copy link
Owner

看起来应该是CallJsFuncDTO不应该混淆。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants