├── .gitignore ├── LICENSE.txt ├── README.md ├── app ├── .gitignore ├── build.gradle ├── proguard-rules.pro ├── release │ ├── app-release.apk │ └── output.json └── src │ └── main │ ├── AndroidManifest.xml │ ├── ic_launcher-web.png │ ├── java │ └── com │ │ └── example │ │ └── httpinfo │ │ ├── MainActivity.java │ │ ├── MyApplication.java │ │ ├── OkHttpUrlLoader.java │ │ ├── ResultActivity.java │ │ ├── ResultBean.java │ │ └── adapter │ │ ├── BaseRecyclerAdapter.java │ │ ├── BaseRecyclerHolder.java │ │ └── ResultAdapter.java │ └── res │ ├── drawable-v24 │ └── ic_launcher_foreground.xml │ ├── drawable │ ├── ic_launcher_background.xml │ └── main_activity_start_btn.xml │ ├── layout │ ├── activity_main.xml │ ├── activity_result.xml │ └── item_activity_result_rv.xml │ ├── mipmap-anydpi-v26 │ ├── ic_launcher.xml │ └── ic_launcher_round.xml │ ├── mipmap-hdpi │ ├── ic_launcher.png │ ├── ic_launcher_foreground.png │ └── ic_launcher_round.png │ ├── mipmap-mdpi │ ├── ic_launcher.png │ ├── ic_launcher_foreground.png │ └── ic_launcher_round.png │ ├── mipmap-xhdpi │ ├── ic_launcher.png │ ├── ic_launcher_foreground.png │ └── ic_launcher_round.png │ ├── mipmap-xxhdpi │ ├── ic_launcher.png │ ├── ic_launcher_foreground.png │ └── ic_launcher_round.png │ ├── mipmap-xxxhdpi │ ├── ic_launcher.png │ ├── ic_launcher_foreground.png │ └── ic_launcher_round.png │ ├── values-zh-rCN │ └── strings.xml │ └── values │ ├── colors.xml │ ├── strings.xml │ └── styles.xml ├── build.gradle ├── gradle.properties ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat ├── httpmodel ├── .gitignore ├── build.gradle ├── proguard-rules.pro └── src │ └── main │ ├── AndroidManifest.xml │ └── java │ └── fairy │ └── easy │ └── httpmodel │ ├── HttpModelHelper.java │ ├── load │ └── HttpException.java │ ├── model │ ├── Headers.java │ ├── HttpModel.java │ ├── HttpNormalUrlLoader.java │ ├── Key.java │ ├── LazyHeaderFactory.java │ ├── LazyHeaders.java │ ├── ModelLoader.java │ ├── PostParam.java │ └── RequestMethod.java │ ├── resource │ ├── Factory.java │ ├── HttpFactory.java │ ├── HttpListener.java │ ├── HttpType.java │ ├── Input.java │ ├── base │ │ ├── BaseBean.java │ │ └── BaseData.java │ ├── dns │ │ ├── DnsBean.java │ │ └── DnsHelper.java │ ├── host │ │ ├── HostBean.java │ │ └── HostHelper.java │ ├── http │ │ ├── HttpBean.java │ │ └── HttpHelper.java │ ├── index │ │ ├── IndexBean.java │ │ └── IndexHelper.java │ ├── mtu │ │ ├── MtuBean.java │ │ └── MtuHelper.java │ ├── net │ │ ├── NetBean.java │ │ └── NetHelper.java │ ├── ping │ │ ├── PingBean.java │ │ └── PingHelper.java │ ├── port │ │ ├── PortBean.java │ │ └── PortHelper.java │ └── traceroute │ │ ├── TraceRouteBean.java │ │ └── TraceRouteHelper.java │ ├── server │ ├── A6Record.java │ ├── AAAARecord.java │ ├── AFSDBRecord.java │ ├── APLRecord.java │ ├── ARecord.java │ ├── Address.java │ ├── CAARecord.java │ ├── CDNSKEYRecord.java │ ├── CDSRecord.java │ ├── CERTRecord.java │ ├── CNAMERecord.java │ ├── Cache.java │ ├── Client.java │ ├── ClientSubnetOption.java │ ├── Compression.java │ ├── Credibility.java │ ├── DClass.java │ ├── DHCIDRecord.java │ ├── DLVRecord.java │ ├── DNAMERecord.java │ ├── DNSInput.java │ ├── DNSKEYRecord.java │ ├── DNSOutput.java │ ├── DNSSEC.java │ ├── DSRecord.java │ ├── EDNSOption.java │ ├── EmptyRecord.java │ ├── ExtendedFlags.java │ ├── ExtendedResolver.java │ ├── Flags.java │ ├── FormattedTime.java │ ├── GPOSRecord.java │ ├── Generator.java │ ├── GenericEDNSOption.java │ ├── HINFORecord.java │ ├── Header.java │ ├── IPSECKEYRecord.java │ ├── ISDNRecord.java │ ├── InvalidDClassException.java │ ├── InvalidTTLException.java │ ├── InvalidTypeException.java │ ├── KEYBase.java │ ├── KEYRecord.java │ ├── KXRecord.java │ ├── LOCRecord.java │ ├── Lookup.java │ ├── MBRecord.java │ ├── MDRecord.java │ ├── MFRecord.java │ ├── MGRecord.java │ ├── MINFORecord.java │ ├── MRRecord.java │ ├── MXRecord.java │ ├── Master.java │ ├── Message.java │ ├── Mnemonic.java │ ├── NAPTRRecord.java │ ├── NSAPRecord.java │ ├── NSAP_PTRRecord.java │ ├── NSEC3PARAMRecord.java │ ├── NSEC3Record.java │ ├── NSECRecord.java │ ├── NSIDOption.java │ ├── NSRecord.java │ ├── NULLRecord.java │ ├── NXTRecord.java │ ├── Name.java │ ├── NameTooLongException.java │ ├── OPENPGPKEYRecord.java │ ├── OPTRecord.java │ ├── Opcode.java │ ├── Options.java │ ├── PTRRecord.java │ ├── PXRecord.java │ ├── PacketLogger.java │ ├── RPRecord.java │ ├── RRSIGRecord.java │ ├── RRset.java │ ├── RTRecord.java │ ├── Rcode.java │ ├── Record.java │ ├── RelativeNameException.java │ ├── ResolveThread.java │ ├── Resolver.java │ ├── ResolverConfig.java │ ├── ResolverListener.java │ ├── ReverseMap.java │ ├── SIG0.java │ ├── SIGBase.java │ ├── SIGRecord.java │ ├── SMIMEARecord.java │ ├── SOARecord.java │ ├── SPFRecord.java │ ├── SRVRecord.java │ ├── SSHFPRecord.java │ ├── Section.java │ ├── Serial.java │ ├── SetResponse.java │ ├── SimpleResolver.java │ ├── SingleCompressedNameBase.java │ ├── SingleNameBase.java │ ├── TCPClient.java │ ├── TKEYRecord.java │ ├── TLSARecord.java │ ├── TSIG.java │ ├── TSIGRecord.java │ ├── TTL.java │ ├── TXTBase.java │ ├── TXTRecord.java │ ├── TextParseException.java │ ├── Tokenizer.java │ ├── Type.java │ ├── TypeBitmap.java │ ├── U16NameBase.java │ ├── UDPClient.java │ ├── UNKRecord.java │ ├── URIRecord.java │ ├── Update.java │ ├── WKSRecord.java │ ├── WireParseException.java │ ├── X25Record.java │ ├── Zone.java │ ├── ZoneTransferException.java │ ├── ZoneTransferIn.java │ └── utils │ │ ├── base16.java │ │ ├── base32.java │ │ ├── base64.java │ │ └── hexdump.java │ └── util │ ├── Base.java │ ├── Date.java │ ├── Dns.java │ ├── Host.java │ ├── Http.java │ ├── HttpLog.java │ ├── IPTools.java │ ├── LogTime.java │ ├── MtuScan.java │ ├── Net.java │ ├── NetWork.java │ ├── Output.java │ ├── Ping.java │ ├── PortScan.java │ ├── PortScanTCP.java │ ├── PortScanUDP.java │ ├── Preconditions.java │ ├── Task.java │ └── TraceRoute.java ├── param.gif ├── settings.gradle └── src ├── download.png ├── http-cn.json └── http-en.json /.gitignore: -------------------------------------------------------------------------------- 1 | *.iml 2 | .gradle 3 | /local.properties 4 | /.idea 5 | .DS_Store 6 | /build 7 | /captures 8 | .externalNativeBuild 9 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 |
2 | 3 | ## HttpInfo 4 | 5 | **`Android`Network Diagnostic Tool** 6 | 7 | [![Download](https://api.bintray.com/packages/guxiaonian/maven/http/images/download.svg) ](https://bintray.com/guxiaonian/maven/http/_latestVersion) 8 | [![GitHub issues](https://img.shields.io/github/issues/guxiaonian/HttpInfo.svg)](https://github.com/guxiaonian/HttpInfo/issues) 9 | [![GitHub forks](https://img.shields.io/github/forks/guxiaonian/HttpInfo.svg)](https://github.com/guxiaonian/HttpInfo/network) 10 | [![GitHub stars](https://img.shields.io/github/stars/guxiaonian/HttpInfo.svg)](https://github.com/guxiaonian/HttpInfo/stargazers) 11 | [![GitHub license](https://img.shields.io/github/license/guxiaonian/HttpInfo.svg)](http://www.apache.org/licenses/LICENSE-2.0) 12 | 13 | ## APP Download 14 | 15 | ![](./src/download.png) 16 | 17 |
18 |
19 | 20 | # Dependencies 21 | 22 | ```gradle 23 | implementation 'fairy.easy:httpmodel:{latest-version}' 24 | 25 | ``` 26 | 27 | ## [WIKI](https://github.com/guxiaonian/HttpInfo/wiki) 28 | 29 | ## ChangeLog 30 | 31 | version|update content|updated 32 | -----|-----|----- 33 | **1.0.5** |1、sdk for dependency optimization| 2020-01-07 34 | **1.0.4** |1、Modify TraceRoute timeout time to 1s| 2019-12-29 35 | **1.0.3** |1、Modify the MtuScan settings, change to multi-threaded concurrent, and set the timeout period to 1s| 2019-09-29 36 | **1.0.2** |1、Add Net related options| 2019-08-13 37 | 38 | 39 | # Precautions 40 | 41 | * There is a complete JSON data format under the `src` file for easy viewing. 42 | 43 | # Display 44 | 45 | ![](./param.gif) 46 | 47 | -------------------------------------------------------------------------------- /app/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | /src/androidTest 3 | /src/test 4 | -------------------------------------------------------------------------------- /app/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.application' 2 | 3 | android { 4 | compileSdkVersion 28 5 | defaultConfig { 6 | applicationId "com.example.httpinfo" 7 | minSdkVersion 14 8 | targetSdkVersion 28 9 | versionCode 1 10 | versionName "1.0" 11 | testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" 12 | } 13 | buildTypes { 14 | release { 15 | minifyEnabled false 16 | proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' 17 | } 18 | } 19 | compileOptions { 20 | sourceCompatibility = '1.8' 21 | targetCompatibility = '1.8' 22 | } 23 | } 24 | 25 | dependencies { 26 | implementation fileTree(include: ['*.jar'], dir: 'libs') 27 | implementation 'com.android.support:appcompat-v7:28.0.0' 28 | implementation 'com.android.support.constraint:constraint-layout:1.1.3' 29 | testImplementation 'junit:junit:4.12' 30 | androidTestImplementation 'com.android.support.test:runner:1.0.2' 31 | androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2' 32 | implementation project(':httpmodel') 33 | //依赖外部网络库 34 | implementation 'com.squareup.okhttp3:okhttp:4.1.0' 35 | //demo设计 36 | implementation 'com.android.support:design:28.0.0' 37 | implementation 'com.android.support:cardview-v7:28.0.0' 38 | } 39 | -------------------------------------------------------------------------------- /app/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # You can control the set of applied configuration files using the 3 | # proguardFiles setting in build.gradle. 4 | # 5 | # For more details, see 6 | # http://developer.android.com/guide/developing/tools/proguard.html 7 | 8 | # If your project uses WebView with JS, uncomment the following 9 | # and specify the fully qualified class name to the JavaScript interface 10 | # class: 11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 12 | # public *; 13 | #} 14 | 15 | # Uncomment this to preserve the line number information for 16 | # debugging stack traces. 17 | #-keepattributes SourceFile,LineNumberTable 18 | 19 | # If you keep the line number information, uncomment this to 20 | # hide the original source file name. 21 | #-renamesourcefileattribute SourceFile 22 | -------------------------------------------------------------------------------- /app/release/app-release.apk: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/guxiaonian/HttpInfo/06c591438074dcf4a8ab22fcce5b44b3e7a117fe/app/release/app-release.apk -------------------------------------------------------------------------------- /app/release/output.json: -------------------------------------------------------------------------------- 1 | [{"outputType":{"type":"APK"},"apkInfo":{"type":"MAIN","splits":[],"versionCode":1,"versionName":"1.0","enabled":true,"outputFile":"app-release.apk","fullName":"release","baseName":"release"},"path":"app-release.apk","properties":{}}] -------------------------------------------------------------------------------- /app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 21 | 24 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /app/src/main/ic_launcher-web.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/guxiaonian/HttpInfo/06c591438074dcf4a8ab22fcce5b44b3e7a117fe/app/src/main/ic_launcher-web.png -------------------------------------------------------------------------------- /app/src/main/java/com/example/httpinfo/MainActivity.java: -------------------------------------------------------------------------------- 1 | package com.example.httpinfo; 2 | 3 | import android.Manifest; 4 | import android.content.Intent; 5 | import android.content.pm.PackageManager; 6 | import android.support.v4.app.ActivityCompat; 7 | import android.support.v4.content.ContextCompat; 8 | import android.support.v7.app.AppCompatActivity; 9 | import android.os.Bundle; 10 | import android.text.TextUtils; 11 | import android.view.View; 12 | import android.widget.CheckBox; 13 | import android.widget.EditText; 14 | import android.widget.Toast; 15 | 16 | public class MainActivity extends AppCompatActivity { 17 | public static final String HTTP_ADDRESS = "http"; 18 | public static final String HTTP_RB = "rb"; 19 | 20 | private EditText etInput; 21 | private CheckBox radioButton; 22 | 23 | 24 | @Override 25 | protected void onCreate(Bundle savedInstanceState) { 26 | super.onCreate(savedInstanceState); 27 | setContentView(R.layout.activity_main); 28 | setTitle(getString(R.string.main_net)); 29 | //获取手机强度使用 30 | if (ContextCompat.checkSelfPermission(this, Manifest.permission.ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED) { 31 | ActivityCompat.requestPermissions(this, new String[]{Manifest.permission.ACCESS_COARSE_LOCATION}, 1); 32 | } 33 | 34 | etInput = findViewById(R.id.main_activity_et_input); 35 | radioButton = findViewById(R.id.main_activity_start_rb); 36 | 37 | findViewById(R.id.main_activity_start_btn).setOnClickListener(new View.OnClickListener() { 38 | @Override 39 | public void onClick(View v) { 40 | if (TextUtils.isEmpty(etInput.getText().toString())) { 41 | Toast.makeText(getApplicationContext(), "Input Address is wrong", Toast.LENGTH_SHORT).show(); 42 | return; 43 | } 44 | Intent intent = new Intent(getApplicationContext(), ResultActivity.class); 45 | intent.putExtra(HTTP_ADDRESS, etInput.getText().toString()); 46 | intent.putExtra(HTTP_RB, radioButton.isChecked()); 47 | startActivity(intent); 48 | } 49 | }); 50 | } 51 | 52 | } 53 | -------------------------------------------------------------------------------- /app/src/main/java/com/example/httpinfo/MyApplication.java: -------------------------------------------------------------------------------- 1 | package com.example.httpinfo; 2 | 3 | import android.app.Application; 4 | 5 | 6 | public class MyApplication extends Application { 7 | 8 | @Override 9 | public void onCreate() { 10 | super.onCreate(); 11 | 12 | 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /app/src/main/java/com/example/httpinfo/ResultBean.java: -------------------------------------------------------------------------------- 1 | package com.example.httpinfo; 2 | 3 | import java.io.Serializable; 4 | 5 | 6 | public class ResultBean implements Serializable { 7 | private String title; 8 | private Object param; 9 | 10 | public ResultBean(String title, Object param) { 11 | this.title = title; 12 | this.param = param; 13 | } 14 | 15 | public String getTitle() { 16 | return title; 17 | } 18 | 19 | public void setTitle(String title) { 20 | this.title = title; 21 | } 22 | 23 | public Object getParam() { 24 | return param; 25 | } 26 | 27 | public void setParam(Object param) { 28 | this.param = param; 29 | } 30 | 31 | } 32 | -------------------------------------------------------------------------------- /app/src/main/java/com/example/httpinfo/adapter/BaseRecyclerHolder.java: -------------------------------------------------------------------------------- 1 | package com.example.httpinfo.adapter; 2 | 3 | import android.content.Context; 4 | import android.support.v7.widget.RecyclerView; 5 | import android.util.SparseArray; 6 | import android.view.View; 7 | import android.widget.ImageView; 8 | import android.widget.TextView; 9 | 10 | 11 | public class BaseRecyclerHolder extends RecyclerView.ViewHolder { 12 | 13 | private SparseArray viewSparseArray; 14 | private Context context; 15 | 16 | private BaseRecyclerHolder(View itemView, Context context) { 17 | super(itemView); 18 | this.context = context; 19 | viewSparseArray = new SparseArray<>(8); 20 | } 21 | 22 | /** 23 | * 拿到实体类 24 | * 25 | * @param itemView 26 | * @param context 27 | * @return 28 | */ 29 | public static BaseRecyclerHolder getRecyclerHolder(View itemView, Context context) { 30 | return new BaseRecyclerHolder(itemView, context); 31 | } 32 | 33 | /** 34 | * 拿到所有的控件 35 | * 36 | * @return 37 | */ 38 | public SparseArray getViews() { 39 | return this.viewSparseArray; 40 | } 41 | 42 | /** 43 | * 拿到view的id来获取控件 44 | * 45 | * @param viewId 46 | * @param 47 | * @return 48 | */ 49 | public T getView(int viewId) { 50 | View view = viewSparseArray.get(viewId); 51 | if (view == null) { 52 | view = itemView.findViewById(viewId); 53 | viewSparseArray.put(viewId, view); 54 | } 55 | return (T) view; 56 | } 57 | 58 | public BaseRecyclerHolder setText(int viewId, String text) { 59 | TextView textView = getView(viewId); 60 | if (text == null) { 61 | textView.setVisibility(View.GONE); 62 | } else { 63 | textView.setVisibility(View.VISIBLE); 64 | textView.setText(text); 65 | } 66 | return this; 67 | } 68 | 69 | public BaseRecyclerHolder setVisibility(int viewId, int visible) { 70 | View view = getView(viewId); 71 | view.setVisibility(visible); 72 | return this; 73 | } 74 | 75 | 76 | public BaseRecyclerHolder setImageViewByResource(int viewId, int drawableId) { 77 | ImageView imageView = getView(viewId); 78 | imageView.setImageResource(drawableId); 79 | return this; 80 | } 81 | } 82 | -------------------------------------------------------------------------------- /app/src/main/java/com/example/httpinfo/adapter/ResultAdapter.java: -------------------------------------------------------------------------------- 1 | package com.example.httpinfo.adapter; 2 | 3 | import android.content.Context; 4 | 5 | import com.example.httpinfo.R; 6 | import com.example.httpinfo.ResultBean; 7 | 8 | 9 | /** 10 | * Created by gunaonian on 2018/3/30. 11 | */ 12 | 13 | public class ResultAdapter extends BaseRecyclerAdapter { 14 | 15 | public ResultAdapter(Context context, int itemLayoutId) { 16 | super(context, itemLayoutId); 17 | } 18 | 19 | @Override 20 | public void convert(BaseRecyclerHolder baseRecyclerHolder, ResultBean item, int position) { 21 | baseRecyclerHolder.setText(R.id.item_activity_result_rv_tv, item.getTitle()); 22 | baseRecyclerHolder.setText(R.id.item_activity_result_rv_tv_param, formatString(item.getParam().toString())); 23 | } 24 | 25 | public static String formatString(String text) { 26 | 27 | StringBuilder json = new StringBuilder(); 28 | String indentString = ""; 29 | 30 | for (int i = 0; i < text.length(); i++) { 31 | char letter = text.charAt(i); 32 | switch (letter) { 33 | case '{': 34 | case '[': 35 | json.append(indentString + letter + "\n"); 36 | indentString = indentString + "\t"; 37 | json.append(indentString); 38 | break; 39 | case '}': 40 | case ']': 41 | indentString = indentString.replaceFirst("\t", ""); 42 | json.append("\n" + indentString + letter); 43 | break; 44 | case ',': 45 | json.append(letter + "\n" + indentString); 46 | break; 47 | 48 | default: 49 | json.append(letter); 50 | break; 51 | } 52 | } 53 | 54 | return json.toString(); 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /app/src/main/res/drawable-v24/ic_launcher_foreground.xml: -------------------------------------------------------------------------------- 1 | 7 | 12 | 13 | 19 | 22 | 25 | 26 | 27 | 28 | 34 | 35 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/main_activity_start_btn.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 6 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_main.xml: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | 28 | 29 | 39 | 40 |