-
Notifications
You must be signed in to change notification settings - Fork 858
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix:mitm换了更高效的实现方式,现在https抓包更快了 fix:mbp;littleproxy,netty版本升级
- Loading branch information
Showing
207 changed files
with
2,018 additions
and
17,031 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file renamed
BIN
+2.14 MB
app/libs/netty-android.jar → app/libs/netty-all-android-4.0.44.Final.jar
100644 → 100755
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
128 changes: 128 additions & 0 deletions
128
app/src/main/java/cn/darkal/networkdiagnosis/Activity/ChangeFilterActivity.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,128 @@ | ||
package cn.darkal.networkdiagnosis.Activity; | ||
|
||
import android.content.DialogInterface; | ||
import android.support.design.widget.FloatingActionButton; | ||
import android.support.v7.app.ActionBar; | ||
import android.support.v7.app.AlertDialog; | ||
import android.support.v7.app.AppCompatActivity; | ||
import android.os.Bundle; | ||
import android.view.LayoutInflater; | ||
import android.view.MenuItem; | ||
import android.view.View; | ||
import android.widget.EditText; | ||
import android.widget.ListView; | ||
import android.widget.RelativeLayout; | ||
|
||
import java.util.List; | ||
|
||
import butterknife.BindView; | ||
import butterknife.ButterKnife; | ||
import cn.darkal.networkdiagnosis.Adapter.ContentFilterAdapter; | ||
import cn.darkal.networkdiagnosis.Bean.ResponseFilterRule; | ||
import cn.darkal.networkdiagnosis.R; | ||
import cn.darkal.networkdiagnosis.SysApplication; | ||
import cn.darkal.networkdiagnosis.Utils.DeviceUtils; | ||
import cn.darkal.networkdiagnosis.Utils.SharedPreferenceUtils; | ||
|
||
public class ChangeFilterActivity extends AppCompatActivity { | ||
@BindView(R.id.activity_change_filter) | ||
public RelativeLayout relativeLayout; | ||
|
||
@BindView(R.id.lv_filter) | ||
public ListView listView; | ||
|
||
@BindView(R.id.fab_add) | ||
public FloatingActionButton floatingActionButton; | ||
|
||
ContentFilterAdapter contentFilterAdapter; | ||
|
||
@Override | ||
protected void onCreate(Bundle savedInstanceState) { | ||
super.onCreate(savedInstanceState); | ||
setContentView(R.layout.activity_change_filter); | ||
ButterKnife.bind(this); | ||
setupActionBar(); | ||
|
||
List<ResponseFilterRule> ruleList = ((SysApplication)getApplication()).ruleList; | ||
|
||
contentFilterAdapter = new ContentFilterAdapter(this,ruleList); | ||
listView.setAdapter(contentFilterAdapter); | ||
|
||
floatingActionButton.setOnClickListener(new View.OnClickListener() { | ||
@Override | ||
public void onClick(View v) { | ||
showDialog(null); | ||
} | ||
}); | ||
} | ||
|
||
/** | ||
* Set up the {@link android.app.ActionBar}, if the API is available. | ||
*/ | ||
private void setupActionBar() { | ||
setTitle("返回包注入"); | ||
ActionBar actionBar = getSupportActionBar(); | ||
if (actionBar != null) { | ||
// Show the Up button in the action bar. | ||
actionBar.setDisplayHomeAsUpEnabled(true); | ||
} | ||
} | ||
|
||
public void showDialog(final ResponseFilterRule responseFilterRule){ | ||
AlertDialog.Builder builder = new AlertDialog.Builder(ChangeFilterActivity.this); | ||
|
||
View textEntryView = LayoutInflater.from(ChangeFilterActivity.this).inflate(R.layout.alert_resp_filter, null); | ||
final EditText urlEditText = (EditText) textEntryView.findViewById(R.id.et_origin_url); | ||
final EditText regexEditText = (EditText) textEntryView.findViewById(R.id.et_regex); | ||
final EditText contentEditText = (EditText) textEntryView.findViewById(R.id.et_replace_result); | ||
if(responseFilterRule!=null){ | ||
urlEditText.setText(responseFilterRule.getUrl()); | ||
regexEditText.setText(responseFilterRule.getReplaceRegex()); | ||
contentEditText.setText(responseFilterRule.getReplaceContent()); | ||
builder.setTitle("修改注入项"); | ||
}else{ | ||
builder.setTitle("新增注入项"); | ||
} | ||
|
||
builder.setCancelable(true); | ||
builder.setView(textEntryView); | ||
builder.setPositiveButton("确认", new DialogInterface.OnClickListener() { | ||
@Override | ||
public void onClick(DialogInterface dialog, int which) { | ||
if(responseFilterRule!=null){ | ||
responseFilterRule.setUrl(urlEditText.getText().toString()); | ||
responseFilterRule.setReplaceRegex(regexEditText.getText().toString()); | ||
responseFilterRule.setReplaceContent(contentEditText.getText().toString()); | ||
}else { | ||
if(urlEditText.getText().length()>0 && regexEditText.getText().length()>0 | ||
&& contentEditText.getText().length()>0) { | ||
ResponseFilterRule responseFilterRule = new ResponseFilterRule(); | ||
responseFilterRule.setUrl(urlEditText.getText().toString()); | ||
responseFilterRule.setReplaceRegex(regexEditText.getText().toString()); | ||
responseFilterRule.setReplaceContent(contentEditText.getText().toString()); | ||
((SysApplication) getApplication()).ruleList.add(responseFilterRule); | ||
} | ||
} | ||
contentFilterAdapter.notifyDataSetChanged(); | ||
} | ||
}); | ||
builder.setNegativeButton("取消",null); | ||
builder.show(); | ||
} | ||
|
||
@Override | ||
protected void onStop() { | ||
SharedPreferenceUtils.save(getApplicationContext(), | ||
"response_filter",((SysApplication) getApplication()).ruleList); | ||
super.onStop(); | ||
} | ||
|
||
@Override | ||
public boolean onOptionsItemSelected(MenuItem item) { | ||
if (item.getItemId() == android.R.id.home) { | ||
finish(); | ||
return true; | ||
} | ||
return super.onOptionsItemSelected(item); | ||
} | ||
} |
Oops, something went wrong.