mirror of
https://github.com/emanuele-f/PCAPdroid.git
synced 2026-06-16 21:10:57 +08:00
Integrate CustomActivityOnCrash to view stack traces
This commit is contained in:
parent
a2a1f0f15a
commit
8d1a1689c0
@ -32,4 +32,5 @@ dependencies {
|
||||
androidTestImplementation 'androidx.test:runner:1.2.0'
|
||||
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
|
||||
implementation project(path: ':zdtun')
|
||||
implementation 'cat.ereza:customactivityoncrash:2.2.0'
|
||||
}
|
||||
|
||||
@ -41,6 +41,8 @@ import android.widget.ListView;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import cat.ereza.customactivityoncrash.config.CaocConfig;
|
||||
|
||||
public class MainActivity extends AppCompatActivity {
|
||||
static final String PREF_COLLECTOR_IP_KEY = "collector_ip";
|
||||
static final String PREF_COLLECTOR_PORT_KEY = "collector_port";
|
||||
@ -79,6 +81,11 @@ public class MainActivity extends AppCompatActivity {
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
|
||||
CaocConfig.Builder.create()
|
||||
.errorDrawable(R.drawable.ic_app_crash)
|
||||
.apply();
|
||||
|
||||
setContentView(R.layout.activity_main);
|
||||
|
||||
TextWatcher start_button_enabler = new TextWatcher() {
|
||||
|
||||
10
app/src/main/res/drawable/ic_app_crash.xml
Normal file
10
app/src/main/res/drawable/ic_app_crash.xml
Normal file
@ -0,0 +1,10 @@
|
||||
<vector android:height="128dp" android:viewportHeight="256"
|
||||
android:viewportWidth="256" android:width="128dp" xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<path android:fillColor="#B6D152" android:pathData="M184.333,171.899l16.053,-22.233c1.205,-1.672 0.828,-4.007 -0.845,-5.214c-1.674,-1.205 -4.006,-0.83 -5.215,0.842l-16.081,22.276c-0.208,0.291 -0.354,0.604 -0.472,0.927c-14.801,-7.064 -31.591,-11.072 -49.402,-11.072c-17.498,0 -34.004,3.873 -48.614,10.706c-0.092,-0.191 -0.195,-0.383 -0.326,-0.562l-16.081,-22.275c-1.206,-1.672 -3.537,-2.047 -5.213,-0.844c-1.673,1.207 -2.049,3.543 -0.843,5.213l15.777,21.854c-30.482,16.862 -51.208,47.232 -52.487,82.168h215.575C234.888,219.007 214.45,188.834 184.333,171.899z"/>
|
||||
<path android:fillColor="#594A42" android:pathData="M95.93,199.207l-5.94,5.941l-5.942,-5.941c-1.943,-1.944 -5.096,-1.942 -7.041,0.003c-1.943,1.943 -1.943,5.096 0,7.039l5.94,5.941l-5.94,5.941c-1.943,1.945 -1.943,5.098 0,7.043c1.943,1.944 5.097,1.944 7.041,-0.002l5.942,-5.94l5.941,5.942c1.942,1.944 5.097,1.944 7.041,0c1.946,-1.945 1.946,-5.098 0,-7.043l-5.941,-5.941l5.941,-5.941c1.946,-1.943 1.946,-5.098 0,-7.042C101.027,197.263 97.873,197.263 95.93,199.207z"/>
|
||||
<path android:fillColor="#F1F2F2" android:pathData="M76.237,182.55c-0.536,0 -1.054,-0.279 -1.339,-0.775c-0.423,-0.739 -0.168,-1.683 0.57,-2.105c2.107,-1.21 4.302,-2.363 6.518,-3.431c0.767,-0.364 1.689,-0.046 2.06,0.722c0.369,0.768 0.047,1.689 -0.722,2.059c-2.151,1.035 -4.277,2.154 -6.321,3.326C76.761,182.483 76.496,182.55 76.237,182.55z"/>
|
||||
<path android:fillColor="#F1F2F2" android:pathData="M40.77,218.337c-0.249,0 -0.501,-0.061 -0.736,-0.188c-0.75,-0.407 -1.026,-1.344 -0.618,-2.092c6.966,-12.795 17.292,-24.043 29.861,-32.531c0.706,-0.478 1.667,-0.291 2.142,0.416c0.477,0.705 0.291,1.664 -0.415,2.141c-12.162,8.213 -22.148,19.088 -28.878,31.449C41.846,218.046 41.316,218.337 40.77,218.337z"/>
|
||||
<path android:fillColor="#9FB543" android:pathData="M162.919,205.372c0,20.409 -10.769,38.297 -26.925,48.313h100.165c-1.271,-34.679 -21.709,-64.852 -51.826,-81.786l16.053,-22.233c1.205,-1.672 0.828,-4.007 -0.845,-5.214c-1.674,-1.205 -4.006,-0.83 -5.215,0.842l-16.081,22.276c-0.208,0.291 -0.354,0.604 -0.472,0.927c-12.364,-5.9 -26.113,-9.658 -40.687,-10.738C152.634,167.896 162.919,185.427 162.919,205.372z"/>
|
||||
<path android:fillColor="#594A42" android:pathData="M174.603,199.207l-5.938,5.941l-5.941,-5.941c-1.946,-1.944 -5.1,-1.942 -7.042,0.003c-1.945,1.943 -1.945,5.096 0,7.039l5.938,5.941l-5.938,5.941c-1.945,1.945 -1.945,5.098 0,7.043c1.942,1.944 5.096,1.944 7.042,-0.002l5.941,-5.94l5.939,5.942c1.943,1.944 5.099,1.944 7.041,0c1.946,-1.945 1.946,-5.098 0,-7.043l-5.941,-5.941l5.941,-5.941c1.946,-1.943 1.946,-5.098 0,-7.042C179.703,197.263 176.548,197.263 174.603,199.207z"/>
|
||||
<path android:fillColor="#594A42" android:pathData="M236.159,256H20.584c-0.628,0 -1.23,-0.255 -1.666,-0.708c-0.437,-0.453 -0.671,-1.063 -0.646,-1.691c1.245,-33.957 20.406,-64.734 51.414,-82.82l-14.268,-19.762c-0.945,-1.311 -1.325,-2.91 -1.066,-4.504c0.259,-1.596 1.122,-2.994 2.433,-3.94c1.042,-0.748 2.263,-1.143 3.536,-1.143c1.94,0 3.774,0.938 4.907,2.508l15.355,21.271c14.987,-6.703 31.052,-10.1 47.789,-10.1c17.023,0 33.328,3.502 48.499,10.411l15.58,-21.582c1.136,-1.57 2.969,-2.508 4.908,-2.508c1.274,0 2.497,0.396 3.535,1.143c2.706,1.952 3.318,5.74 1.369,8.444l-14.554,20.158c30.609,18.139 49.529,48.77 50.763,82.424c0.022,0.628 -0.212,1.238 -0.647,1.691S236.788,256 236.159,256zM23.016,251.372h210.712c-2.016,-31.896 -20.765,-60.719 -50.527,-77.456c-0.575,-0.323 -0.984,-0.876 -1.127,-1.52c-0.142,-0.644 -0.001,-1.317 0.385,-1.852l16.053,-22.233c0.456,-0.635 0.313,-1.525 -0.323,-1.983c-0.308,-0.222 -0.622,-0.269 -0.829,-0.269c-0.465,0 -0.885,0.215 -1.157,0.59l-16.08,22.275c-0.052,0.072 -0.11,0.195 -0.172,0.364c-0.223,0.612 -0.694,1.103 -1.3,1.35c-0.604,0.246 -1.284,0.228 -1.872,-0.054c-15.078,-7.197 -31.364,-10.847 -48.406,-10.847c-16.727,0 -32.752,3.529 -47.633,10.488c-1.154,0.536 -2.521,0.048 -3.068,-1.097c-0.033,-0.069 -0.067,-0.141 -0.115,-0.206l-16.083,-22.276c-0.269,-0.375 -0.688,-0.588 -1.152,-0.588c-0.207,0 -0.521,0.047 -0.831,0.271c-0.305,0.219 -0.508,0.548 -0.568,0.922c-0.062,0.375 0.028,0.75 0.25,1.058l15.778,21.854c0.386,0.536 0.526,1.213 0.381,1.859c-0.145,0.646 -0.559,1.199 -1.139,1.52C44.033,190.226 25.044,219.187 23.016,251.372z"/>
|
||||
</vector>
|
||||
Loading…
Reference in New Issue
Block a user