This file contains hidden or 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
| #nmap host discovery | |
| #Nmap sends an ICMP echo request, a TCP SYN packet to port 443, a TCP ACK packet to port 80, and an ICMP timestamp request. | |
| $ time sudo zmap -p 80 -i wlan1 10.0.0.0/24 | |
| real 0m9.135s | |
| user 0m0.153s | |
| sys 0m0.109s | |
| CIDR 24 |
This file contains hidden or 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
| sudo apt-get install mesa-utils | |
| glxinfo | grep OpenGL | |
| optirun | grep OpenGL | |
| glxsheres64 | |
| optirun -vv glxspheres64 | |
| lspci | grep NVIDIA | |
This file contains hidden or 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
| adb shell dumpsys procstats --hours 3 | |
| adb shell dumpsys meminfo | |
| adb shell dumpsys activity | |
| #get com.android content providers | |
| adb shell dumpsys | grep Provider{ | grep com.android | |
| #call logs | |
| adb shell content query --uri content://call_log/calls |
This file contains hidden or 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
| File f = new File(filePath); | |
| Intent intent = new Intent(Intent.ACTION_VIEW); | |
| intent.setDataAndType(Uri.fromFile(f), "application/vnd.android.package-archive"); | |
| intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); | |
| startActivity(intent); |
This file contains hidden or 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
| # Author: @c_piekarski | |
| import optparse | |
| import csv | |
| import logging | |
| import os | |
| import datetime | |
| import re | |
| TAGS = ["Browser","Dalvikvm", "Zygote", "AndroidRuntime"] | |
| SUBTAGS = [ |
This file contains hidden or 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
| if(field.getType().isArray() && field.getType() == String[].class) { | |
| if(field.getName() == "SHORTCUT" || field.getName() == "URI") { | |
| String[] x = (String []) field.get(field); | |
| for(int i = 0; i < x.length; i++) { | |
| //Do something | |
| } | |
| } | |
| } |
This file contains hidden or 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
| public static final int FILL_PARENT | |
| Added in API level 1 | |
| Special value for the height or width requested by a View. FILL_PARENT means that the view wants to be as big as its parent, minus the parent's padding, if any. This value is deprecated starting in API Level 8 and replaced by MATCH_PARENT. | |
| Constant Value: -1 (0xffffffff) | |
| public static final int MATCH_PARENT | |
| Added in API level 8 |
This file contains hidden or 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
| Provider[] providers = Security.getProviders(); | |
| for (Provider p : providers) { | |
| System.out.printf("%s/%s/%f\n", p.getName(), p.getInfo(), | |
| p.getVersion()); | |
| Set<Service> services = p.getServices(); | |
| for (Service s : services) { | |
| System.out.printf("\t%s/%s/%s\n", s.getType(), | |
| s.getAlgorithm(), s.getClassName()); |
This file contains hidden or 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
| A dimension value defined in XML. A dimension is specified with a number followed by a unit of measure. For example: 10px, 2in, 5sp. The following units of measure are supported by Android: | |
| dp | |
| Density-independent Pixels - An abstract unit that is based on the physical density of the screen. These units are relative to a 160 dpi (dots per inch) screen, on which 1dp is roughly equal to 1px. When running on a higher density screen, the number of pixels used to draw 1dp is scaled up by a factor appropriate for the screen's dpi. Likewise, when on a lower density screen, the number of pixels used for 1dp is scaled down. The ratio of dp-to-pixel will change with the screen density, but not necessarily in direct proportion. Using dp units (instead of px units) is a simple solution to making the view dimensions in your layout resize properly for different screen densities. In other words, it provides consistency for the real-world sizes of your UI elements across different devices. | |
| sp | |
| Scale-independent Pixels - This |
This file contains hidden or 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
| public void handle(HttpRequest request, ... ) { | |
| Header[] hdrs = request.getAllHeaders(); | |
| for( Header h: hdrs) { | |
| Log.w(TAG, h.getName()+":"+h.getValue()); | |
| } | |
| } |