DroidAssist
DroidAssist copied to clipboard
kotlin不支持
<Replace>
<MethodExecution>
<Source>
void okhttp3.internal.ws.RealWebSocket.initReaderAndWriter(java.lang.String,okhttp3.internal.ws.RealWebSocket$Streams)
</Source>
<Target>
{
val extensions = this.extensions!!;
}
</Target>
<Filter>
<Include>okhttp3.internal.ws.RealWebSocket</Include>
</Filter>
</MethodExecution>
</Replace>
Transform failed for class: okhttp3.internal.ws.RealWebSocket with compile error: ; is missing
另外问下生成的文件在哪里呢?
<Replace>
<MethodExecution>
<Source>
void okhttp3.internal.ws.RealWebSocket.writePingFrame()
</Source>
<Target>
{
android.util.Log.v("aaa", "ttttttttt");
WebSocketWriter writer = null;
int failedPing = 0;
synchronized(this) {
if (failed) return;
if (this.writer == null) return;
writer = this.writer;
failedPing = awaitingPong ? sentPingCount : -1;
sentPingCount++;
awaitingPong = true;
}
if (failedPing != -1) {
failWebSocket(new SocketTimeoutException("sent ping but didn't receive pong within " +
pingIntervalMillis + "ms (after " + (failedPing - 1) + " successful ping/pongs)"), null);
return;
}
try {
writer.writeMessageFrame(OPCODE_TEXT, okio.ByteString.encodeUtf8("ping|12332");
} catch (IOException e) {
failWebSocket(e, null);
}
}
</Target>
<Filter>
<Include>okhttp3.internal.ws.RealWebSocket</Include>
</Filter>
</MethodExecution>
</Replace>
用java来写,没报错,但是不生效