Optimize proxy

pull/590/head
FongMi 12 months ago
parent fa1cc8f4d2
commit 0d8a082246
  1. 10
      app/src/main/java/com/fongmi/android/tv/api/loader/JarLoader.java
  2. 2
      app/src/main/java/com/fongmi/android/tv/server/process/Proxy.java

@ -141,9 +141,15 @@ public class JarLoader {
}
public Object[] proxyInvoke(Map<String, String> params) {
for (Map.Entry<String, Method> entry : methods.entrySet()) {
Object[] result = proxyInvoke(entry.getValue(), params);
if (result != null) return result;
}
return null;
}
private Object[] proxyInvoke(Method method, Map<String, String> params) {
try {
Method method = methods.get(recent);
if (method == null) return null;
return (Object[]) method.invoke(null, params);
} catch (Throwable e) {
e.printStackTrace();

@ -27,7 +27,7 @@ public class Proxy implements Process {
Response response = Response.newChunkedResponse(Status.lookup((Integer) rs[0]), (String) rs[1], (InputStream) rs[2]);
if (rs.length > 3 && rs[3] != null) for (Map.Entry<String, String> entry : ((Map<String, String>) rs[3]).entrySet()) response.addHeader(entry.getKey(), entry.getValue());
return response;
} catch (Exception e) {
} catch (Throwable e) {
return Nano.error(e.getMessage());
}
}

Loading…
Cancel
Save