Info Call to Socket API

Description

List of all calls to Server Socket API.

Recommendation

This entry is informative, no recommendations applicable.

Technical details

Method org.apache.cordova.CordovaResourceApi.createHttpConnection() calling method java.net.URL.<init>()


    public java.net.HttpURLConnection createHttpConnection(android.net.Uri p3)
    {
        this.assertBackgroundThread();
        return ((java.net.HttpURLConnection) new java.net.URL(p3.toString()).openConnection());
    }

Method org.apache.cordova.CordovaResourceApi.getMimeType() calling method java.net.URL.<init>()


    public String getMimeType(android.net.Uri p5)
    {
        String v1;
        switch (org.apache.cordova.CordovaResourceApi.getUriType(p5)) {
            case 0:
            case 1:
                v1 = this.getMimeTypeFromPath(p5.getPath());
                break;
            case 2:
            case 3:
                v1 = this.contentResolver.getType(p5);
                break;
            case 4:
                v1 = this.getDataUriMimeType(p5);
                break;
            case 5:
            case 6:
                try {
                    java.net.HttpURLConnection v0_1 = ((java.net.HttpURLConnection) new java.net.URL(p5.toString()).openConnection());
                    v0_1.setDoInput(0);
                    v0_1.setRequestMethod("HEAD");
                    v1 = v0_1.getHeaderField("Content-Type");
                } catch (String[] v2) {
                    v1 = 0;
                }
                if (v1 == null) {
                } else {
                    v1 = v1.split(";")[0];
                }
                break;
            default:
        }
        return v1;
    }

Method org.apache.cordova.CordovaResourceApi.openForRead() calling method java.net.URL.<init>()


    public org.apache.cordova.CordovaResourceApi$OpenForReadResult openForRead(android.net.Uri p23, boolean p24)
    {
        if (!p24) {
            this = this.assertBackgroundThread();
        }
        org.apache.cordova.CordovaResourceApi$OpenForReadResult v2_2;
        switch (org.apache.cordova.CordovaResourceApi.getUriType(p23)) {
            case 0:
                java.io.InputStream v4_2 = new java.io.FileInputStream(p23.getPath());
                v2_2 = new org.apache.cordova.CordovaResourceApi$OpenForReadResult(p23, v4_2, this.getMimeTypeFromPath(p23.getPath()), v4_2.getChannel().size(), 0);
                return v2_2;
            case 1:
                String v9 = p23.getPath().substring(15);
                int v6 = -1;
                try {
                    android.content.res.AssetFileDescriptor v8_2 = this.assetManager.openFd(v9);
                    java.io.InputStream v4_0 = v8_2.createInputStream();
                    int v6_3 = v8_2.getLength();
                } catch (java.io.FileNotFoundException v18) {
                    v4_0 = this.assetManager.open(v9);
                }
                v2_2 = new org.apache.cordova.CordovaResourceApi$OpenForReadResult(p23, v4_0, this.getMimeTypeFromPath(v9), v6_3, v8_2);
                return v2_2;
            case 2:
            case 3:
                String v5_3 = this.contentResolver.getType(p23);
                android.content.res.AssetFileDescriptor v8_1 = this.contentResolver.openAssetFileDescriptor(p23, "r");
                v2_2 = new org.apache.cordova.CordovaResourceApi$OpenForReadResult(p23, v8_1.createInputStream(), v5_3, v8_1.getLength(), v8_1);
                return v2_2;
            case 4:
                org.apache.cordova.CordovaResourceApi$OpenForReadResult v21 = this.readDataUri(p23);
                if (v21 == null) {
                } else {
                    v2_2 = v21;
                    return v2_2;
                }
            case 5:
            case 6:
                java.net.HttpURLConnection v17_1 = ((java.net.HttpURLConnection) new java.net.URL(p23.toString()).openConnection());
                v17_1.setDoInput(1);
                String v5_2 = v17_1.getHeaderField("Content-Type");
                if (v5_2 != null) {
                    v5_2 = v5_2.split(";")[0];
                }
                v2_2 = new org.apache.cordova.CordovaResourceApi$OpenForReadResult(p23, v17_1.getInputStream(), v5_2, ((long) v17_1.getContentLength()), 0);
                return v2_2;
            case 7:
                org.apache.cordova.CordovaPlugin v19 = this.pluginManager.getPlugin(p23.getHost());
                if (v19 != null) {
                    v2_2 = v19.handleOpenForRead(p23);
                    return v2_2;
                } else {
                    throw new java.io.FileNotFoundException(new StringBuilder().append("Invalid plugin ID in URI: ").append(p23).toString());
                }
        }
        throw new java.io.FileNotFoundException(new StringBuilder().append("URI not supported by CordovaResourceApi: ").append(p23).toString());
    }