mirror of
https://github.com/ClassiCube/ClassiCube.git
synced 2025-09-09 15:28:21 -04:00
Fix http requests always failing on old android
This commit is contained in:
parent
5700988e49
commit
ebc4d9f753
@ -711,16 +711,17 @@ public class MainActivity extends Activity implements SurfaceHolder.Callback2 {
|
||||
int len;
|
||||
try {
|
||||
conn.connect();
|
||||
Map<String, List<String>> all = conn.getHeaderFields();
|
||||
|
||||
for (Map.Entry<String, List<String>> h : all.entrySet()) {
|
||||
String key = h.getKey();
|
||||
for (String value : h.getValue()) {
|
||||
if (key == null) {
|
||||
httpParseHeader(value);
|
||||
} else {
|
||||
httpParseHeader(key + ":" + value);
|
||||
}
|
||||
|
||||
// Legitimate webservers aren't going to reply with over 200 headers
|
||||
for (int i = 0; i < 200; i++) {
|
||||
String key = conn.getHeaderFieldKey(i);
|
||||
String val = conn.getHeaderField(i);
|
||||
if (key == null && val == null) break;
|
||||
|
||||
if (key == null) {
|
||||
httpParseHeader(val);
|
||||
} else {
|
||||
httpParseHeader(key + ":" + val);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -51,4 +51,4 @@ $TOOLS_ROOT/aapt add -f obj/cc-unsigned.apk classes.dex lib/armeabi/libclassicub
|
||||
cp obj/cc-unsigned.apk obj/cc-signed.apk
|
||||
jarsigner -verbose -sigalg SHA1withRSA -digestalg SHA1 -keystore debug.keystore -storepass android -keypass android obj/cc-signed.apk androiddebugkey
|
||||
# create aligned .apk file
|
||||
$TOOLS_ROOT/zipalign -f -v 4 obj/cc-signed.apk obj/cc-final.apk
|
||||
$TOOLS_ROOT/zipalign -f -v 4 obj/cc-signed.apk ~/client/src/cc.apk
|
Loading…
x
Reference in New Issue
Block a user