0%

上小学的时候对于别人如果能有零花钱就感觉很羡慕
因为他们可以买到自已喜欢的吃的
但是我不会去奢求渴望父母也给我
到了初中,我会觉得那些染着黄毛,成天不上学开着大摩托的人比较牛气
因为他们可以不用上学,不用写作业,想打认谁就打谁,可以为别人拔份儿
可以我也不羡慕他们,我也不会去搞个彩毛儿,穿个喇叭裤
到了高中,我觉得那些长的帅气,会打篮球,会弹吉他,会讨女孩子开心的人很好
于是我也会在学习之于搞些自已喜欢的东西
到了大学,那种八面玲珑,左右逢源的人很好

在Android Stadio(as)上创建一个app的时候默认会自动创建相应的test类,可以直接在里面写单元测试用例

image

一、在项目(module)中导入robotium的jar包,右键app->new->directory,输入libs

然后将robotium-solo-5.3.1.jar复制进去,然后右键robotium-solo-5.3.1.jar选择add as library,之后就可以写测试用例了

如果还有问题,看一下项目的build gradle

dependencies {   
 compile fileTree(include: ['*.jar'], dir: 'libs')    
 compile 'com.android.support:appcompat-v7:21.0.3'    
 compile files('libs/robotium-solo-5.3.1.jar')    
}

自已用php+mysql写了一个登录页面。其中包含多个sql注入漏洞,在mysql中创建一个表,其中有username password email一个列,添加三个数据

+————-+————-+—————–+ | username | password | email | +————-+————-+—————–+ | admin | admin | admin@admin.com | | yangyanxing | yangyanxing | yyx@yyx.com | +————-+————-+—————–+

在phpmyadmin中使用一条sql命令

SELECT * FROM admin WHERE 1

where 1 是一个永真,这样它会把admin表中的所有数据返回

写一个testsql.php文件来尝试使用sql注入的方式登录这个系统

当一个应用程序启动之后,android系统会为这个应用程序创建一个主线程,这个线程非常重要,它负责渲染视图,分发事件到响应监听器并执行,对界面进行轮询的监听,一般叫做“UI主线程”

Android系统不会给应用程序的多个元素组件建立多个线程来执行,一个视图(activity)中的多个view组件运行在同一个UI线程当中,因此,多个view组件的监听器的执行可能会相互影响。

如有以下两个button,其中一个在会在主view中进行移动动画,另外一个button在点击以后将线程sleep 5秒

绑定单击事件有两种方法,一种是通过绑定android:onClick属性,一种是绑定一个setOnClickListener回调函数

通过绑定onClick属性

在activity_main.xml对应的组件上设置android:onClick=“test” 属性,然后再Java文件里定义一个test方法来实现,这个test方法是MainActivity类的一个方法

1
2
3
4
5

public void test(View view){
        Toast.makeText(MainActivity.this, "你还真敢点啊!", Toast.LENGTH_LONG).show();
    }
    

这里的view就是要使用的控件,如果是绑定的是个button,那么view就是这个button

经常看到一些朋友每到一个地方就先找wifi,没有密码就直接上了!汗……

今天通过两个小工具来显示一下公共wifi的安全隐患(爱蹭网的代价)

工具:wireshark与cain

下载:wireshark

https://www.wireshark.org/download.html Cain & Abel http://www.oxid.it/cain.html (被墙) 百度网盘链接: http://pan.baidu.com/s/18kshg 密码:9owu

md5:EA2EF30C99ECECB1EDA9AA128631FF31 sha1:82407EAF6437D6956F63E85B28C0EC6CA58D298A

如果没有校验工具,我写了一个python脚本来校验 链接: http://pan.baidu.com/s/1i3j93sp 密码:h6gz

乙醇 的自动化教程写的挺好的,以下是转自他的cnblogs上面的博客

appium简明教程(1)——appium和它的哲学世界

什么是appium?

下面这段介绍来自于appium的官网。

Appium is an open-source tool you can use to automate mobile native, mobile web, and mobile hybrid applications on iOS and Android platforms. “Mobile native apps” are those written using the iOS or Android SDKs. “Mobile web apps” are web apps accessed using a mobile browser (Appium supports Safari on iOS and Chrome on Android). “Mobile hybrid apps” have a native wrapper around a “webview” – a native control that enables interaction with web content. Projects like Phonegap , for example, make it easy to build apps using web technologies that are then bundled into a native wrapper – these are hybrid apps.

Importantly, Appium is “cross-platform”: it allows you to write tests against multiple platforms (iOS, Android), using the same API. This enables a large or total amount of code reuse between iOS and Android testsuites. 我们可以从上面的介绍里获得这样的一些信息:

  • 1,appium是开源的移动端自动化测试框架;
  • 2,appium可以测试原生的、混合的、以及移动端的web项目;
  • 3,appium可以测试ios,android应用(当然了,还有firefox os);
  • 4,appium是跨平台的,可以用在osx,windows以及linux桌面系统上; appium的哲学

Android的自动化测试有很多框架,其中uiautomator是google官方提供的黑盒UI相关的自动化测试工具,case使用java写,今天实践了一下 官方文档 中样例程序,其中还是有一些小问题需要总结一下的。 前几天试着使用uiautoamtor在真实的项目中写了一个简单的测试 使用Uiautomator做基于UI界面的测试

使用ADT创建一个java的项目

在创建项目的时候要加上JUnit与你使用的Android platforms中对应的android.jar与uiautomator.jar

image