Skip to content

Commit

Permalink
add:添加deflate加密方式的解码(修复mp.weixin.qq.com无法查看内容的bug)
Browse files Browse the repository at this point in the history
fix:gradle版本升级为4.4
fix:升级了bmp的版本
fix:优化了界面
  • Loading branch information
darkal committed Jul 7, 2018
1 parent 42b240e commit 756d007
Show file tree
Hide file tree
Showing 117 changed files with 140 additions and 311 deletions.
73 changes: 38 additions & 35 deletions app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
apply plugin: 'com.android.application'
apply plugin: 'android-apt'
apply plugin: 'bugly'

bugly {
Expand All @@ -20,17 +19,17 @@ android {
dexOptions {
javaMaxHeapSize "4g"
}
compileSdkVersion 24
buildToolsVersion '24.0.3'
compileSdkVersion 27
buildToolsVersion '27.0.3'
dataBinding {
enabled = true
}
defaultConfig {
applicationId "cn.darkal.networkdiagnosis"
minSdkVersion 14
targetSdkVersion 22
targetSdkVersion 23
versionCode 30
versionName "3.1.30"
versionName "3.2.31"
// Enabling multidex support.
multiDexEnabled true
resConfigs "zh"
Expand Down Expand Up @@ -70,50 +69,54 @@ android {
}

dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
testCompile 'junit:junit:4.12'
apt 'com.jakewharton:butterknife-compiler:8.2.1'
compile 'com.jakewharton:butterknife:8.2.1'
compile 'com.squareup.okhttp3:okhttp:3.4.1'
compile 'com.android.support:appcompat-v7:24.2.1'
compile 'com.android.support:design:24.2.1'
compile 'com.android.support:support-v4:24.2.1'
compile 'com.android.support:gridlayout-v7:24.2.1'
implementation fileTree(include: ['*.jar'], dir: 'libs')
testImplementation 'junit:junit:4.12'
implementation 'com.jakewharton:butterknife:8.8.1'
annotationProcessor 'com.jakewharton:butterknife-compiler:8.8.1'
implementation 'com.android.databinding:library:3.1.3'
implementation 'com.android.databinding:adapters:3.1.3'
implementation 'com.squareup.okhttp3:okhttp:3.4.1'
implementation 'com.android.support:appcompat-v7:27.1.1'
implementation 'com.android.support:design:27.1.1'
implementation 'com.android.support:support-v4:27.1.1'
implementation 'com.android.support:gridlayout-v7:27.1.1'
// compile 'com.android.support:cardview-v7:24.0.0'
compile 'com.android.support:support-annotations:24.2.1'
compile 'com.android.support:multidex:1.0.1'
implementation 'com.android.support:support-annotations:27.1.1'
implementation 'com.android.support:multidex:1.0.3'
// littleproxy及其依赖
compile('net.lightbody.bmp:littleproxy:1.1.0-beta-bmp-16') {
implementation('net.lightbody.bmp:littleproxy:1.1.0-beta-bmp-17') {
exclude group: 'io.netty'
}
implementation 'com.jcraft:jzlib:1.1.3'

compile group: 'org.apache.directory.studio', name: 'org.apache.commons.io', version: '2.4'
compile 'javax.annotation:jsr250-api:1.0'
compile 'com.fasterxml.jackson.core:jackson-core:2.7.6'
compile 'com.fasterxml.jackson.core:jackson-databind:2.7.6'
compile 'com.fasterxml.jackson.core:jackson-annotations:2.7.6'
compile 'org.bouncycastle:bcprov-jdk15on:1.54'
compile 'org.bouncycastle:bcpkix-jdk15on:1.54'
compile 'dnsjava:dnsjava:2.1.7'
compile 'com.google.guava:guava:19.0'
compile 'com.google.code.findbugs:jsr305:3.0.1'
compile 'com.google.jimfs:jimfs:1.1'
compile 'com.jcraft:jzlib:1.1.3'

implementation group: 'org.apache.directory.studio', name: 'org.apache.commons.io', version: '2.4'
implementation 'javax.annotation:jsr250-api:1.0'
implementation 'com.fasterxml.jackson.core:jackson-core:2.7.6'
implementation 'com.fasterxml.jackson.core:jackson-databind:2.7.6'
implementation 'com.fasterxml.jackson.core:jackson-annotations:2.7.6'
implementation 'org.bouncycastle:bcprov-jdk15on:1.54'
implementation 'org.bouncycastle:bcpkix-jdk15on:1.54'
implementation 'dnsjava:dnsjava:2.1.7'
implementation 'com.google.guava:guava:19.0'
implementation 'com.google.code.findbugs:jsr305:3.0.1'
implementation 'com.google.jimfs:jimfs:1.1'
implementation 'com.jcraft:jzlib:1.1.3'
// 日志处理
// compile 'org.slf4j:slf4j-api:1.7.21'
compile 'org.slf4j:slf4j-log4j12:1.7.21'
implementation 'org.slf4j:slf4j-log4j12:1.7.21'

// compile 'org.slf4j:jcl-over-slf4j:1.7.21'
// 启用Netty的日志输出(调试用)
// compile 'com.noveogroup.android:android-logger:1.3.5'
// 文件上传插件
compile 'net.gotev:uploadservice:3.0.3'
implementation 'net.gotev:uploadservice:3.0.3'
// Bugly上报
compile 'com.tencent.bugly:crashreport_upgrade:latest.release'
implementation 'com.tencent.bugly:crashreport_upgrade:latest.release'
// compile 'com.tencent.bugly:nativecrashreport:latest.release'
// 图片显示
compile 'com.github.bumptech.glide:glide:3.7.0'
compile 'com.github.clans:fab:1.6.4'
implementation 'com.github.bumptech.glide:glide:3.7.0'
implementation 'com.github.clans:fab:1.6.4'
// Json格式化
compile 'com.google.code.gson:gson:2.7'
implementation 'com.google.code.gson:gson:2.7'
}
7 changes: 3 additions & 4 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
<uses-permission android:name="android.permission.READ_LOGS" />

<application
android:networkSecurityConfig="@xml/network_security_config"
android:name=".SysApplication"
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
Expand Down Expand Up @@ -94,11 +95,9 @@
</receiver>

<activity
android:name=".Activity.HarDetailActivity"
android:theme="@style/AppTheme.NoActionBar" />
android:name=".Activity.HarDetailActivity" />
<activity
android:name=".Activity.JsonPreviewActivity"
android:theme="@style/AppTheme.NoActionBar" />
android:name=".Activity.JsonPreviewActivity" />
<activity
android:name="com.tencent.bugly.beta.ui.BetaActivity"
android:theme="@android:style/Theme.Translucent" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,6 @@ protected void onCreate(Bundle savedInstanceState) {
setContentView(R.layout.activity_scrolling);
ButterKnife.bind(this);

Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
setSupportActionBar(toolbar);

setupActionBar();

try {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,9 @@ protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_json);
ButterKnife.bind(this);

Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
setSupportActionBar(toolbar);
//
// Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
// setSupportActionBar(toolbar);

setupActionBar();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,11 +86,11 @@ public static File getDataRoot() {
}

/**
* 获取我们京致衣橱存储的目录
*
*/
public static File getAppRoot() {
try {
File root = new File(getDataRoot(), "com.jd.wxsq.app");
File root = new File(getDataRoot(), "com.darkal.nt");
if (!root.exists()) {
root.mkdirs();
}
Expand Down
Empty file modified app/src/main/java/net/lightbody/bmp/BrowserMobProxy.java
100755 → 100644
Empty file.
6 changes: 3 additions & 3 deletions app/src/main/java/net/lightbody/bmp/BrowserMobProxyServer.java
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.io.File;
import java.net.InetAddress;
import java.net.InetSocketAddress;
import java.util.ArrayList;
Expand Down Expand Up @@ -326,6 +325,8 @@ public int getMaximumResponseBufferSizeInBytes() {
// .trustSource(trustSource)
// .build();
// }
//
// bootstrap.withManInTheMiddle(mitmManager);

try {
bootstrap.withManInTheMiddle(new CertificateSniffingMitmManager(
Expand Down Expand Up @@ -953,8 +954,7 @@ public void addLastHttpFilterFactory(HttpFiltersSource filterFactory) {
*/
@Override
public void addResponseFilter(ResponseFilter filter) {
filterFactories.add(new ResponseFilterAdapter.FilterSource(filter));
// addLastHttpFilterFactory();
addLastHttpFilterFactory(new ResponseFilterAdapter.FilterSource(filter));
}

/**
Expand Down
47 changes: 3 additions & 44 deletions app/src/main/java/net/lightbody/bmp/client/ClientUtil.java
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
import net.lightbody.bmp.proxy.dns.DnsJavaResolver;
import net.lightbody.bmp.proxy.dns.NativeCacheManipulatingResolver;
import net.lightbody.bmp.proxy.dns.NativeResolver;
//import org.openqa.selenium.Proxy;

import java.net.InetAddress;
import java.net.InetSocketAddress;
Expand Down Expand Up @@ -42,6 +41,7 @@ public static AdvancedHostResolver createNativeResolver() {
* calling {@link net.lightbody.bmp.BrowserMobProxy#setHostNameResolver(net.lightbody.bmp.proxy.dns.AdvancedHostResolver)}.
*
* @return a new DnsJavaResolver
* @deprecated The dnsjava resolver has been deprecated in favor of the standard JVM resolver and will be removed in BMP >2.1.
*/
public static AdvancedHostResolver createDnsJavaResolver() {
return new DnsJavaResolver();
Expand All @@ -53,58 +53,17 @@ public static AdvancedHostResolver createDnsJavaResolver() {
* Can be used when calling {@link net.lightbody.bmp.BrowserMobProxy#setHostNameResolver(net.lightbody.bmp.proxy.dns.AdvancedHostResolver)}.
*
* @return a new ChainedHostResolver that resolves addresses first using a DnsJavaResolver, then using a NativeCacheManipulatingResolver
* @deprecated The dnsjava resolver has been deprecated in favor of the standard JVM resolver and will be removed in BMP >2.1.
*/
public static AdvancedHostResolver createDnsJavaWithNativeFallbackResolver() {
return new ChainedHostResolver(ImmutableList.of(new DnsJavaResolver(), new NativeCacheManipulatingResolver()));
}

/**
* Creates a Selenium Proxy object from the BrowserMobProxy instance. The BrowserMobProxy must be started. Retrieves the address
* of the Proxy using {@link #getConnectableAddress()}.
*
* @param browserMobProxy started BrowserMobProxy instance to read connection information from
* @return a Selenium Proxy instance, configured to use the BrowserMobProxy instance as its proxy server
* @throws java.lang.IllegalStateException if the proxy has not been started.
*/
// public static org.openqa.selenium.Proxy createSeleniumProxy(BrowserMobProxy browserMobProxy) {
// return createSeleniumProxy(browserMobProxy, getConnectableAddress());
// }

/**
* Creates a Selenium Proxy object from the BrowserMobProxy instance, using the specified connectableAddress as the Selenium Proxy object's
* proxy address. Determines the port using {@link net.lightbody.bmp.BrowserMobProxy#getPort()}. The BrowserMobProxy must be started.
*
* @param browserMobProxy started BrowserMobProxy instance to read the port from
* @param connectableAddress the network address the Selenium Proxy will use to reach this BrowserMobProxy instance
* @return a Selenium Proxy instance, configured to use the BrowserMobProxy instance as its proxy server
* @throws java.lang.IllegalStateException if the proxy has not been started.
*/
// public static org.openqa.selenium.Proxy createSeleniumProxy(BrowserMobProxy browserMobProxy, InetAddress connectableAddress) {
// return createSeleniumProxy(new InetSocketAddress(connectableAddress, browserMobProxy.getPort()));
// }

/**
* Creates a Selenium Proxy object using the specified connectableAddressAndPort as the HTTP proxy server.
*
* @param connectableAddressAndPort the network address (or hostname) and port the Selenium Proxy will use to reach its
* proxy server (the InetSocketAddress may be unresolved).
* @return a Selenium Proxy instance, configured to use the specified address and port as its proxy server
*/
// public static org.openqa.selenium.Proxy createSeleniumProxy(InetSocketAddress connectableAddressAndPort) {
// Proxy proxy = new Proxy();
// proxy.setProxyType(Proxy.ProxyType.MANUAL);
//
// String proxyStr = String.format("%s:%d", connectableAddressAndPort.getHostString(), connectableAddressAndPort.getPort());
// proxy.setHttpProxy(proxyStr);
// proxy.setSslProxy(proxyStr);
//
// return proxy;
// }

/**
* Attempts to retrieve a "connectable" address for this device that other devices on the network can use to connect to a local proxy.
* This is a "reasonable guess" that is suitable in many (but not all) common scenarios.
* TODO: define the algorithm used to discover a "connectable" local host
*
* @return a "reasonable guess" at an address that can be used by other machines on the network to reach this host
*/
public static InetAddress getConnectableAddress() {
Expand Down
Empty file modified app/src/main/java/net/lightbody/bmp/core/har/Har.java
100755 → 100644
Empty file.
Empty file modified app/src/main/java/net/lightbody/bmp/core/har/HarCache.java
100755 → 100644
Empty file.
7 changes: 2 additions & 5 deletions app/src/main/java/net/lightbody/bmp/core/har/HarCacheStatus.java
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,6 @@

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;

import net.lightbody.bmp.core.json.ISO8601WithTDZDateFormatter;

import java.util.Date;

Expand All @@ -16,7 +13,7 @@ public class HarCacheStatus {
private volatile int hitCount;
private volatile String comment = "";

@JsonSerialize(using = ISO8601WithTDZDateFormatter.class)
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss")
public Date getExpires() {
return expires;
}
Expand All @@ -25,7 +22,7 @@ public void setExpires(Date expires) {
this.expires = expires;
}

@JsonSerialize(using = ISO8601WithTDZDateFormatter.class)
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss")
public Date getLastAccess() {
return lastAccess;
}
Expand Down
Empty file modified app/src/main/java/net/lightbody/bmp/core/har/HarContent.java
100755 → 100644
Empty file.
11 changes: 4 additions & 7 deletions app/src/main/java/net/lightbody/bmp/core/har/HarCookie.java
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,6 @@

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;

import net.lightbody.bmp.core.json.ISO8601WithTDZDateFormatter;

import java.net.URLDecoder;
import java.util.Date;
Expand Down Expand Up @@ -32,10 +29,10 @@ public String getValue() {
return value;
}

public String getDecodeValue() {
try{
public String getDecodeValue(){
try {
return URLDecoder.decode(value);
}catch (Exception e) {
}catch (Exception e){
return value;
}
}
Expand All @@ -60,7 +57,7 @@ public void setDomain(String domain) {
this.domain = domain;
}

@JsonSerialize(using = ISO8601WithTDZDateFormatter.class)
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss.SSSXXX")
public Date getExpires() {
return expires;
}
Expand Down
5 changes: 1 addition & 4 deletions app/src/main/java/net/lightbody/bmp/core/har/HarEntry.java
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,6 @@
import com.fasterxml.jackson.annotation.JsonAutoDetect;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;

import net.lightbody.bmp.core.json.ISO8601WithTDZDateFormatter;

import java.util.Date;
import java.util.concurrent.TimeUnit;
Expand Down Expand Up @@ -38,7 +35,7 @@ public void setPageref(String pageref) {
this.pageref = pageref;
}

@JsonSerialize(using = ISO8601WithTDZDateFormatter.class)
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss.SSSXXX")
public Date getStartedDateTime() {
return startedDateTime;
}
Expand Down
Empty file modified app/src/main/java/net/lightbody/bmp/core/har/HarLog.java
100755 → 100644
Empty file.
Empty file.
Empty file.
2 changes: 1 addition & 1 deletion app/src/main/java/net/lightbody/bmp/core/har/HarPage.java
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public void setId(String id) {
this.id = id;
}

@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss.SSSZ")
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss.SSSXXX")
public Date getStartedDateTime() {
return startedDateTime;
}
Expand Down
Empty file.
Empty file modified app/src/main/java/net/lightbody/bmp/core/har/HarPostData.java
100755 → 100644
Empty file.
Empty file.
Empty file modified app/src/main/java/net/lightbody/bmp/core/har/HarRequest.java
100755 → 100644
Empty file.
Empty file modified app/src/main/java/net/lightbody/bmp/core/har/HarResponse.java
100755 → 100644
Empty file.
Empty file modified app/src/main/java/net/lightbody/bmp/core/har/HarTimings.java
100755 → 100644
Empty file.

This file was deleted.

Loading

0 comments on commit 756d007

Please sign in to comment.