正在查看: MT Manager v2.13.3 应用的 C0838.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
正在查看: MT Manager v2.13.3 应用的 C0838.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
package l;
import java.io.BufferedInputStream;
import java.io.BufferedOutputStream;
import java.io.IOException;
import java.net.Inet6Address;
import java.net.InetAddress;
import java.net.InetSocketAddress;
import java.net.ServerSocket;
import java.net.Socket;
import java.net.UnknownHostException;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.Locale;
import java.util.Properties;
import java.util.Random;
import java.util.Set;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
public class C0838 extends C5405 implements InterfaceC3312 {
public static final Pattern f2439 = Pattern.compile("(\\d{1,3},\\d{1,3},\\d{1,3},\\d{1,3}),(\\d{1,3}),(\\d{1,3})");
public int f2440;
public InterfaceC7107 f2441;
public int f2442;
public String f2443;
public int f2444;
public C6797 f2445 = new C6797(this);
public HashMap f2446;
public C2232 f2447;
public int f2448;
public long f2449;
public boolean f2450;
public ۨۙۡۗ f2451;
public String f2452;
public int f2453;
public final boolean m2610(String str) {
return C5573.m13821(mo10634("RMD", str));
}
public final boolean m2611(String str, String str2) {
int mo10634 = mo10634("RNFR", str);
if (mo10634 >= 300 && mo10634 < 400) {
return C5573.m13821(mo10634("RNTO", str2));
}
return false;
}
public final boolean m2614() {
return C5573.m13821(mo10634("NOOP", null));
}
public final boolean m2615(String str) {
return C5573.m13821(mo10634("SITE", str));
}
public final boolean m2616(String str) {
return C5573.m13821(mo10634("MKD", str));
}
public String mo2619() {
if (mo10634("PWD", null) != 257) {
return null;
}
String substring = ((String) C1946.m5230(this.f18717, 1)).substring(4);
if (!substring.startsWith("\"")) {
return substring;
}
StringBuilder sb = new StringBuilder();
boolean z = false;
for (int i = 1; i < substring.length(); i++) {
char charAt = substring.charAt(i);
if (charAt != '\"') {
if (z) {
return sb.toString();
}
sb.append(charAt);
} else if (z) {
sb.append(charAt);
z = false;
} else {
z = true;
}
}
return z ? sb.toString() : substring;
}
public final boolean m2620(String str) {
return C5573.m13821(mo10634("DELE", str));
}
public final boolean m2621(String str, String str2) {
mo10634("USER", str);
if (C5573.m13821(this.f18716)) {
return true;
}
int i = this.f18716;
if (i >= 300 && i < 400) {
return C5573.m13821(mo10634("PASS", str2));
}
return false;
}
public C0838() {
m2599();
this.f2440 = -1;
this.f2450 = true;
this.f2447 = new C2232();
this.f2451 = null;
new Random();
}
@Override
public void mo2613() {
super.m13476();
m2599();
}
public final C1542[] m2612() {
Socket m2607 = m2607("MLSD", null);
C7800 c7800 = new C7800(C5017.m12421(), this.f2451);
if (m2607 != null) {
try {
c7800.m18975(m2607.getInputStream(), this.f18720);
} finally {
try {
m2607.close();
} catch (IOException unused) {
}
m2608();
}
}
return c7800.m18976();
}
public Socket m2607(String str, String str2) {
Socket createSocket;
int i = this.f2444;
if (i != 0 && i != 2) {
return null;
}
boolean z = m6937() instanceof Inet6Address;
if (this.f2444 == 0) {
ServerSocket createServerSocket = this.f8621.createServerSocket(0, 1, m6944());
try {
if (!z) {
InetAddress m6944 = m6944();
int localPort = createServerSocket.getLocalPort();
StringBuilder sb = new StringBuilder(24);
sb.append(m6944.getHostAddress().replace('.', ','));
sb.append(',');
sb.append(localPort >>> 8);
sb.append(',');
sb.append(localPort & C1851.f5797);
if (!C5573.m13821(mo10634("PORT", sb.toString()))) {
createServerSocket.close();
return null;
}
} else if (!C5573.m13821(m13474(m6944(), createServerSocket.getLocalPort()))) {
createServerSocket.close();
return null;
}
long j = this.f2449;
if (j > 0) {
this.f2449 = 0L;
int mo10634 = mo10634("REST", Long.toString(j));
if (!(mo10634 >= 300 && mo10634 < 400)) {
if (createServerSocket != null) {
createServerSocket.close();
}
return null;
}
}
int mo106342 = mo10634(str, str2);
if (!(mo106342 >= 100 && mo106342 < 200)) {
if (createServerSocket != null) {
createServerSocket.close();
}
return null;
}
int i2 = this.f2440;
if (i2 >= 0) {
createServerSocket.setSoTimeout(i2);
}
createSocket = createServerSocket.accept();
int i3 = this.f2440;
if (i3 >= 0) {
createSocket.setSoTimeout(i3);
}
int i4 = this.f2442;
if (i4 > 0) {
createSocket.setSendBufferSize(i4);
}
createServerSocket.close();
} finally {
}
} else {
if (z && mo10634("EPSV", null) == 229) {
String str3 = (String) this.f18717.get(0);
String trim = str3.substring(str3.indexOf(40) + 1, str3.indexOf(41)).trim();
char charAt = trim.charAt(0);
char charAt2 = trim.charAt(1);
char charAt3 = trim.charAt(2);
char charAt4 = trim.charAt(trim.length() - 1);
if (charAt != charAt2 || charAt2 != charAt3 || charAt3 != charAt4) {
throw new C6097("Could not parse extended passive host information.\nServer Reply: ".concat(trim));
}
try {
int parseInt = Integer.parseInt(trim.substring(3, trim.length() - 1));
this.f2452 = m6937().getHostAddress();
this.f2448 = parseInt;
} catch (NumberFormatException unused) {
throw new C6097("Could not parse extended passive host information.\nServer Reply: ".concat(trim));
}
} else {
if (z || mo10634("PASV", null) != 227) {
return null;
}
String str4 = (String) this.f18717.get(0);
Matcher matcher = f2439.matcher(str4);
if (!matcher.find()) {
throw new C6097(ۙ۫ۗ.ۗ("Could not parse passive host information.\nServer Reply: ", str4));
}
this.f2452 = "0,0,0,0".equals(matcher.group(1)) ? this.f8625.getInetAddress().getHostAddress() : matcher.group(1).replace(',', '.');
try {
this.f2448 = (Integer.parseInt(matcher.group(2)) << 8) | Integer.parseInt(matcher.group(3));
C6797 c6797 = this.f2445;
if (c6797 != null) {
try {
String m16862 = c6797.m16862(this.f2452);
if (!this.f2452.equals(m16862)) {
m6943(0);
this.f2452 = m16862;
}
} catch (UnknownHostException unused2) {
throw new C6097(ۙ۫ۗ.ۗ("Could not parse passive host information.\nServer Reply: ", str4));
}
}
} catch (NumberFormatException unused3) {
throw new C6097(ۙ۫ۗ.ۗ("Could not parse passive port information.\nServer Reply: ", str4));
}
}
createSocket = this.f8623.createSocket();
int i5 = this.f2442;
if (i5 > 0) {
createSocket.setSendBufferSize(i5);
}
int i6 = this.f2440;
if (i6 >= 0) {
createSocket.setSoTimeout(i6);
}
createSocket.connect(new InetSocketAddress(this.f2452, this.f2448), this.f8626);
long j2 = this.f2449;
if (j2 > 0) {
this.f2449 = 0L;
int mo106343 = mo10634("REST", Long.toString(j2));
if (!(mo106343 >= 300 && mo106343 < 400)) {
createSocket.close();
return null;
}
}
int mo106344 = mo10634(str, str2);
if (!(mo106344 >= 100 && mo106344 < 200)) {
createSocket.close();
return null;
}
}
if (!this.f2450 || createSocket.getInetAddress().equals(m6937())) {
return createSocket;
}
InetAddress inetAddress = createSocket.getInetAddress();
createSocket.close();
throw new IOException("Host attempting data connection " + inetAddress.getHostAddress() + " is not same as server " + m6937().getHostAddress());
}
public final C5756 m2600(String str) {
۫ۚۡۗ inputStream;
Socket m2607 = m2607("RETR", str);
if (m2607 == null) {
return null;
}
if (this.f2453 == 0) {
inputStream = new ۫ۚۡۗ(new BufferedInputStream(m2607.getInputStream()));
} else {
inputStream = m2607.getInputStream();
}
return new C5756(m2607, inputStream);
}
public final C8538 m2601(String str) {
ۧۚۡۗ outputStream;
Socket m2607 = m2607("STOR", str);
if (m2607 == null) {
return null;
}
if (this.f2453 == 0) {
outputStream = new ۧۚۡۗ(new BufferedOutputStream(m2607.getOutputStream()));
} else {
outputStream = m2607.getOutputStream();
}
return new C8538(m2607, outputStream);
}
public final boolean m2609() {
if (!C5573.m13821(mo10634("TYPE", "AEILNTCFRPSBC".substring(2, 3)))) {
return false;
}
this.f2453 = 2;
return true;
}
public final boolean m2608() {
return C5573.m13821(m13478());
}
@Override
public final void mo2604(ۨۙۡۗ r1) {
this.f2451 = r1;
}
public final C1542[] m2618() {
String property;
if (this.f2441 == null) {
ۨۙۡۗ r0 = this.f2451;
if (r0 != null && r0.ۖ().length() > 0) {
this.f2441 = this.f2447.m6027(this.f2451);
this.f2451.getClass();
} else {
String property2 = System.getProperty("org.apache.commons.net.ftp.systemType");
if (property2 == null) {
if (this.f2443 == null) {
if (C5573.m13821(mo10634("SYST", null))) {
this.f2443 = ((String) this.f18717.get(r0.size() - 1)).substring(4);
} else {
String property3 = System.getProperty("org.apache.commons.net.ftp.systemType.default");
if (property3 != null) {
this.f2443 = property3;
} else {
throw new IOException("Unable to determine system type - response: " + m13479());
}
}
}
property2 = this.f2443;
Properties properties = C4708.f16800;
if (properties != null && (property = properties.getProperty(property2)) != null) {
property2 = property;
}
}
if (this.f2451 != null) {
this.f2441 = this.f2447.m6027(new ۨۙۡۗ(property2, this.f2451));
} else {
this.f2441 = this.f2447.m6026(property2);
}
}
}
InterfaceC7107 interfaceC7107 = this.f2441;
Socket m2607 = m2607("LIST", null);
C7800 c7800 = new C7800(interfaceC7107, this.f2451);
if (m2607 != null) {
try {
c7800.m18975(m2607.getInputStream(), this.f18720);
m2608();
} finally {
try {
m2607.close();
} catch (IOException unused) {
}
}
}
return c7800.m18976();
}
public final boolean m2605(String str, String str2) {
return C5573.m13821(mo10634("MFMT", str2 + " " + str));
}
@Override
public void mo2622() {
super.mo2622();
m2599();
}
public final void m2602() {
this.f2444 = 2;
this.f2452 = null;
this.f2448 = -1;
}
public final boolean m2606(EnumC3622 enumC3622) {
String substring;
String str;
String name = enumC3622.name();
boolean z = true;
if (this.f2446 == null) {
int mo10634 = mo10634("FEAT", null);
if (mo10634 != 530) {
boolean m13821 = C5573.m13821(mo10634);
this.f2446 = new HashMap();
if (m13821) {
Iterator it = this.f18717.iterator();
while (it.hasNext()) {
String str2 = (String) it.next();
if (str2.startsWith(" ")) {
int indexOf = str2.indexOf(32, 1);
if (indexOf > 0) {
substring = str2.substring(1, indexOf);
str = str2.substring(indexOf + 1);
} else {
substring = str2.substring(1);
str = "";
}
String upperCase = substring.toUpperCase(Locale.ENGLISH);
Set set = (Set) this.f2446.get(upperCase);
if (set == null) {
set = new HashSet();
this.f2446.put(upperCase, set);
}
set.add(str);
}
}
}
}
z = false;
}
if (z) {
return this.f2446.containsKey(name.toUpperCase(Locale.ENGLISH));
}
return false;
}
private void m2599() {
this.f2444 = 0;
this.f2452 = null;
this.f2448 = -1;
this.f2453 = 0;
this.f2449 = 0L;
this.f2443 = null;
this.f2441 = null;
this.f2446 = null;
}
public final void m2623() {
this.f2440 = 40000;
}
public final void m2603(long j) {
if (j >= 0) {
this.f2449 = j;
}
}
public final void m2617() {
this.f2442 = 65536;
}
}