lundi 10 août 2015

Android, all web pages blocked

Background: About 8 hours ago, before I went to bed I was enjoying moderate success web scraping my history from a certain website.

This morning, the exact same program was refusing to even connect to the internet. I tried all my AVD's, checked my firewall, and then ran it on my phone. I changed the target URL to http://www.google.com and http://www.yahoo.com but nothing would work. I changed my User-agent in the header and my package name, still no dice. Initially I could get just an "about" in the URL, now I can receive the correct URL in onPageFinished should I choose to listen, but the page is always "not available"

Finally I created a totally fresh project with just a WebView. Still nothing connects, at least I get

Web page not available The Web page at http://www.google.com/ might be temporarily down or it may have moved permanently to a new web addres.

How am I being blocked? Is this even the right stackexchange?

MainActivity.java:

package dog.example.com.turlog;

import android.support.v7.app.ActionBarActivity;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuItem;
import android.webkit.WebView;


public class MainActivity extends ActionBarActivity {

    private WebView mWebView;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        mWebView = (WebView) findViewById(R.id.activity_main_webview);
        mWebView.loadUrl("http://www.google.com");
    }

    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        // Inflate the menu; this adds items to the action bar if it is present.
        getMenuInflater().inflate(R.menu.menu_main, menu);
        return true;
    }

    @Override
    public boolean onOptionsItemSelected(MenuItem item) {
        // Handle action bar item clicks here. The action bar will
        // automatically handle clicks on the Home/Up button, so long
        // as you specify a parent activity in AndroidManifest.xml.
        int id = item.getItemId();

        //noinspection SimplifiableIfStatement
        if (id == R.id.action_settings) {
            return true;
        }

        return super.onOptionsItemSelected(item);
    }
}

activity_main.xml

<RelativeLayout xmlns:android="http://ift.tt/nIICcg"
    xmlns:tools="http://ift.tt/LrGmb4" android:layout_width="match_parent"
    android:layout_height="match_parent" android:paddingLeft="@dimen/activity_horizontal_margin"
    android:paddingRight="@dimen/activity_horizontal_margin"
    android:paddingTop="@dimen/activity_vertical_margin"
    android:paddingBottom="@dimen/activity_vertical_margin" tools:context=".MainActivity">

    <WebView
        android:id="@+id/activity_main_webview"
        android:layout_width="match_parent"
        android:layout_height="match_parent" />

</RelativeLayout>

AndroidManifest.xml

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://ift.tt/nIICcg"
    package="dog.example.com.turlog" >

    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />

    <application
        android:allowBackup="true"
        android:icon="@mipmap/ic_launcher"
        android:label="@string/app_name"
        android:theme="@style/AppTheme" >
        <activity
            android:name="dog.example.com.turlog.MainActivity"
            android:label="@string/app_name" >
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
    </application>

</manifest>

It's not just my homebrew apps on a free debug key being blocked. I ran Terminal Emulator and "ping www.google.com"

PING www.google.com (173.194.39.20) 56(84) bytes of data

From xx.xx.xxx.xxx: icmp_seq=1 Destination Port Unreachable

From xx.xx.xxx.xxx: icmp_seq=1 Destination Port Unreachable ...

Thanks

Aucun commentaire:

Enregistrer un commentaire