-
Notifications
You must be signed in to change notification settings - Fork 13k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
17 changed files
with
455 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 0 additions & 15 deletions
15
app/src/main/java/com/topjohnwu/magisk/utils/Download.java
This file was deleted.
Oops, something went wrong.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<resources> | ||
<drawable name="ic_launcher">@android:drawable/sym_def_app_icon</drawable> | ||
</resources> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,5 @@ | ||
<manifest xmlns:android="http://schemas.android.com/apk/res/android" | ||
package="com.topjohnwu.net" /> | ||
package="com.topjohnwu.net"> | ||
<uses-permission android:name="android.permission.INTERNET" /> | ||
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /> | ||
</manifest> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
70 changes: 70 additions & 0 deletions
70
net/src/main/java/com/topjohnwu/net/NoSSLv3SocketFactory.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
package com.topjohnwu.net; | ||
|
||
import java.io.IOException; | ||
import java.net.InetAddress; | ||
import java.net.Socket; | ||
import java.util.ArrayList; | ||
import java.util.Arrays; | ||
import java.util.List; | ||
|
||
import javax.net.ssl.HttpsURLConnection; | ||
import javax.net.ssl.SSLSocket; | ||
import javax.net.ssl.SSLSocketFactory; | ||
|
||
class NoSSLv3SocketFactory extends SSLSocketFactory { | ||
|
||
private final static SSLSocketFactory base = HttpsURLConnection.getDefaultSSLSocketFactory(); | ||
|
||
@Override | ||
public String[] getDefaultCipherSuites() { | ||
return base.getDefaultCipherSuites(); | ||
} | ||
|
||
@Override | ||
public String[] getSupportedCipherSuites() { | ||
return base.getSupportedCipherSuites(); | ||
} | ||
|
||
private Socket createSafeSocket(Socket socket) { | ||
if (socket instanceof SSLSocket) | ||
return new SSLSocketWrapper((SSLSocket) socket) { | ||
@Override | ||
public void setEnabledProtocols(String[] protocols) { | ||
List<String> proto = new ArrayList<>(Arrays.asList(getSupportedProtocols())); | ||
proto.remove("SSLv3"); | ||
super.setEnabledProtocols(proto.toArray(new String[0])); | ||
} | ||
}; | ||
return socket; | ||
} | ||
|
||
@Override | ||
public Socket createSocket(Socket s, String host, int port, boolean autoClose) throws IOException { | ||
return createSafeSocket(base.createSocket(s, host, port, autoClose)); | ||
} | ||
|
||
@Override | ||
public Socket createSocket() throws IOException { | ||
return createSafeSocket(base.createSocket()); | ||
} | ||
|
||
@Override | ||
public Socket createSocket(String host, int port) throws IOException { | ||
return createSafeSocket(base.createSocket(host, port)); | ||
} | ||
|
||
@Override | ||
public Socket createSocket(String host, int port, InetAddress localHost, int localPort) throws IOException { | ||
return createSafeSocket(base.createSocket(host, port, localHost, localPort)); | ||
} | ||
|
||
@Override | ||
public Socket createSocket(InetAddress host, int port) throws IOException { | ||
return createSafeSocket(base.createSocket(host, port)); | ||
} | ||
|
||
@Override | ||
public Socket createSocket(InetAddress address, int port, InetAddress localAddress, int localPort) throws IOException { | ||
return createSafeSocket(base.createSocket(address, port, localAddress, localPort)); | ||
} | ||
} |
Oops, something went wrong.