zhkrb / cloudflare-scrape-Android

A tool to bypass the Cloudflare DDOS page
MIT License
70 stars 17 forks source link

cloudflare-scrape-Android

A tool to bypass the Cloudflare DDOS page.

Download

Notice

scrape-v8 and scrape-rhino is discarded, please use scrape-webview.

Inspired by cloudflare-scrape.

GET START

Download

Maven

<dependency>
  <groupId>com.zhkrb.cloudflare-scrape-android</groupId>
  <artifactId>scrape-webview</artifactId>
  <version>0.0.4</version>
  <type>pom</type>
</dependency>

Gradle via JCenter

implementation 'com.zhkrb.cloudflare-scrape-android:scrape-webview:0.0.4'

Example

    Cloudflare cf = new Cloudflare(Activity, url);
    cf.setUser_agent(UA);
    cf.setCfCallback(new CfCallback() {
        @Override
        public void onSuccess(List<HttpCookie> cookieList, boolean hasNewUrl, String newUrl) {
            something...
        }

        @Override
        public void onFail(int code,String msg) {
            something...
        }
    });
    cf.getCookies();

PS: When you want to use cookieList for String or convert to other type, you needed use ConvertUtil to conversion.
PS: If url redirect to new url, hasNewUrl will return true and 3rd parameter return new url

If you need to use jsoup

Map<String, String> cookies = ConvertUtil.List2Map(cookies);

Dependent project

eclipsesource/J2V8
rhino

issues and test

If you find any issues, please file a bug and provide url after checking for duplicates so I can fix it.

We also provide a demo for you to test, you can go to release to get it