- 浏览: 2490350 次
- 性别:
- 来自: 成都
文章分类
最新评论
-
nation:
你好,在部署Mesos+Spark的运行环境时,出现一个现象, ...
Spark(4)Deal with Mesos -
sillycat:
AMAZON Relatedhttps://www.godad ...
AMAZON API Gateway(2)Client Side SSL with NGINX -
sillycat:
sudo usermod -aG docker ec2-use ...
Docker and VirtualBox(1)Set up Shared Disk for Virtual Box -
sillycat:
Every Half an Hour30 * * * * /u ...
Build Home NAS(3)Data Redundancy -
sillycat:
3 List the Cron Job I Have>c ...
Build Home NAS(3)Data Redundancy
Android with Emulator Shell
1. Change the HOSTS
First step, start my emulator.
Then, remount the device image as writable
>adb remount
Then, save a copy of the hosts file on my own machine
>adb pull /system/etc/hosts /Users/carl/data
Then, edit the hosts as I like
Then, save and push back the hosts file to the emulator
>adb push /Users/carl/data/hosts /system/etc
2. Connect to HTTPS
Error Message when I try to connect to HTTPS
POST: javax.net.ssl.SSLException: Not trusted server certificate
javax.net.ssl.SSLException: Not trusted server certificate
Solution:
Some solutions are about disable the SSL based on HTTP-Client or KSOAP2.
Disable SSL check based on HTTPCLIENT
http://blog.syedgakbar.com/2012/07/21/android-https-and-not-trusted-server-certificate-error/
Disable SSL check based on ksoap2
http://lanyan-lan.iteye.com/blog/1523821
But I am planning to install the CERT on my emulator.
http://intrepidusgroup.com/insight/2011/08/setting-up-a-persistent-trusted-ca-in-an-android-emulator/
Step 1: Set up OS environment
Android is using a specific keystone type called Bouncycastle KeyStore(BKS).
I download the jar package and place it in my JAVA_HOME lib directory
http://www.bouncycastle.org/archive/141/bcprov-jdk16-141.jar
On my MAC laptop, the directory is here:
/System/Library/Frameworks/JavaVM.framework/Home/lib/ext
>cd /System/Library/Frameworks/JavaVM.framework/Home/lib/ext
>sudo cp /Users/carl/data/bcprov-jdk16-141.jar ./
Try to manually install the CERT
>adb pull /system/etc/security/cacerts.bks /Users/carl/data/
Prepare the CERT file, open the URL with Firefox.
[Add Exception…] ---> [View] ---> [Details] ----> [Export] ----> File name sillycat with [X.509 Certificate (PEM)]
>cd /Users/carl/data
>mv sillycat sillycat.cert
Check the certificate file
>keytool -printcert -file sillycat.cer
Example:
keytool -keystore cacerts.bks -storetype BKS -provider org.bouncycastle.jce.provider.BouncyCastleProvider -storepass changeit -importcert -trustcacerts -alias somealias -file ca.cer -noprompt
>keytool -keystore cacerts.bks -storetype BKS -provider org.bouncycastle.jce.provider.BouncyCastleProvider -storepass changeit -importcert -trustcacerts -alias sillycat -file sillycat.cer -noprompt
I used to think that I do not have password, so I get rid of the line -storepass changeit, I got
Error Message:
keytool error: java.lang.NullPointerException
Solution:
The default password is changeit, but not empty.
Change the permission on AVD
>adb shell chmod 777 /system/etc/security/cacerts.bks
Push the changed file to AVD
>adb push cacerts.bks /system/etc/security/cacerts.bks
>adb shell ls /system/etc/security/
Restart the AVD and try again.
>adb shell stop
>adb shell start
Much Better, the error message changed
Error Message:
POST: java.lang.NullPointerException
java.lang.NullPointException
at org.apache.harmony.xnet.provider.jsse.OpenSSLSocketFactoryImpl.createSocket(OpenSSLSocketFactoryImpl.java:83
Solution:
Maybe, that because I get the CER file by wrong way.
>echo | openssl s_client -connect api.local.sillycat.com:443 2>&1 | sed -ne '/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p' > s1.pem
Import the PEM file again
>keytool -keystore cacerts.bks -storetype BKS -provider org.bouncycastle.jce.provider.BouncyCastleProvider -storepass changeit -importcert -trustcacerts -alias s1 -file s1.pem -noprompt
Push the file again
>adb push cacerts.bks /system/etc/security/cacerts.bks
Restart the AVD
>adb shell stop
>adb shell start
But still not working.
It is not working for my project which is an old project. Maybe I can try in the newly project in the future.
I will just change the https to http on my local machine this time.
References:
http://www.bradcurtis.com/2011/02/13/hosts-file-google-android-emulator/
http://stackoverflow.com/questions/14109319/avd-emulator-browser-wont-use-hosts-file
http://stackoverflow.com/questions/5687082/obtain-root-access-via-su-on-the-android-emulator
http://allencch.wordpress.com/2012/02/29/learn-to-root-android-using-emulator/
http://androidsu.com/superuser/
http://www.bradcurtis.com/2011/02/13/hosts-file-google-android-emulator/
Disable SSL check based on HTTPCLIENT
http://blog.syedgakbar.com/2012/07/21/android-https-and-not-trusted-server-certificate-error/
Disable SSL check based on ksoap2
http://lanyan-lan.iteye.com/blog/1523821
http://blog.antoine.li/2010/10/22/android-trusting-ssl-certificates/
1. Change the HOSTS
First step, start my emulator.
Then, remount the device image as writable
>adb remount
Then, save a copy of the hosts file on my own machine
>adb pull /system/etc/hosts /Users/carl/data
Then, edit the hosts as I like
Then, save and push back the hosts file to the emulator
>adb push /Users/carl/data/hosts /system/etc
2. Connect to HTTPS
Error Message when I try to connect to HTTPS
POST: javax.net.ssl.SSLException: Not trusted server certificate
javax.net.ssl.SSLException: Not trusted server certificate
Solution:
Some solutions are about disable the SSL based on HTTP-Client or KSOAP2.
Disable SSL check based on HTTPCLIENT
http://blog.syedgakbar.com/2012/07/21/android-https-and-not-trusted-server-certificate-error/
Disable SSL check based on ksoap2
http://lanyan-lan.iteye.com/blog/1523821
But I am planning to install the CERT on my emulator.
http://intrepidusgroup.com/insight/2011/08/setting-up-a-persistent-trusted-ca-in-an-android-emulator/
Step 1: Set up OS environment
Android is using a specific keystone type called Bouncycastle KeyStore(BKS).
I download the jar package and place it in my JAVA_HOME lib directory
http://www.bouncycastle.org/archive/141/bcprov-jdk16-141.jar
On my MAC laptop, the directory is here:
/System/Library/Frameworks/JavaVM.framework/Home/lib/ext
>cd /System/Library/Frameworks/JavaVM.framework/Home/lib/ext
>sudo cp /Users/carl/data/bcprov-jdk16-141.jar ./
Try to manually install the CERT
>adb pull /system/etc/security/cacerts.bks /Users/carl/data/
Prepare the CERT file, open the URL with Firefox.
[Add Exception…] ---> [View] ---> [Details] ----> [Export] ----> File name sillycat with [X.509 Certificate (PEM)]
>cd /Users/carl/data
>mv sillycat sillycat.cert
Check the certificate file
>keytool -printcert -file sillycat.cer
Example:
keytool -keystore cacerts.bks -storetype BKS -provider org.bouncycastle.jce.provider.BouncyCastleProvider -storepass changeit -importcert -trustcacerts -alias somealias -file ca.cer -noprompt
>keytool -keystore cacerts.bks -storetype BKS -provider org.bouncycastle.jce.provider.BouncyCastleProvider -storepass changeit -importcert -trustcacerts -alias sillycat -file sillycat.cer -noprompt
I used to think that I do not have password, so I get rid of the line -storepass changeit, I got
Error Message:
keytool error: java.lang.NullPointerException
Solution:
The default password is changeit, but not empty.
Change the permission on AVD
>adb shell chmod 777 /system/etc/security/cacerts.bks
Push the changed file to AVD
>adb push cacerts.bks /system/etc/security/cacerts.bks
>adb shell ls /system/etc/security/
Restart the AVD and try again.
>adb shell stop
>adb shell start
Much Better, the error message changed
Error Message:
POST: java.lang.NullPointerException
java.lang.NullPointException
at org.apache.harmony.xnet.provider.jsse.OpenSSLSocketFactoryImpl.createSocket(OpenSSLSocketFactoryImpl.java:83
Solution:
Maybe, that because I get the CER file by wrong way.
>echo | openssl s_client -connect api.local.sillycat.com:443 2>&1 | sed -ne '/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p' > s1.pem
Import the PEM file again
>keytool -keystore cacerts.bks -storetype BKS -provider org.bouncycastle.jce.provider.BouncyCastleProvider -storepass changeit -importcert -trustcacerts -alias s1 -file s1.pem -noprompt
Push the file again
>adb push cacerts.bks /system/etc/security/cacerts.bks
Restart the AVD
>adb shell stop
>adb shell start
But still not working.
It is not working for my project which is an old project. Maybe I can try in the newly project in the future.
I will just change the https to http on my local machine this time.
References:
http://www.bradcurtis.com/2011/02/13/hosts-file-google-android-emulator/
http://stackoverflow.com/questions/14109319/avd-emulator-browser-wont-use-hosts-file
http://stackoverflow.com/questions/5687082/obtain-root-access-via-su-on-the-android-emulator
http://allencch.wordpress.com/2012/02/29/learn-to-root-android-using-emulator/
http://androidsu.com/superuser/
http://www.bradcurtis.com/2011/02/13/hosts-file-google-android-emulator/
Disable SSL check based on HTTPCLIENT
http://blog.syedgakbar.com/2012/07/21/android-https-and-not-trusted-server-certificate-error/
Disable SSL check based on ksoap2
http://lanyan-lan.iteye.com/blog/1523821
http://blog.antoine.li/2010/10/22/android-trusting-ssl-certificates/
发表评论
-
ionic UI(4)ionic2 framework - basic and components and native
2016-03-24 02:33 1227ionic UI(4)ionic2 framework - b ... -
ionic UI(3)TypeScript - handbook
2016-03-22 23:21 593ionic UI(3)TypeScript - handboo ... -
ionic UI(2)ionic2 framework - TypeScript - tutorial
2016-03-22 06:52 1621ionic UI(2)ionic2 framework - T ... -
Parse and Heroku Service(3)Parse Server and Parse Dashboard
2016-03-22 06:30 943Parse and Heroku Service(3)Pars ... -
Parse and Heroku Service(2)Mail Templates and Push Notification
2016-03-22 02:45 543Parse and Heroku Service(2)Mail ... -
ionic UI(1)Introduction
2016-03-19 03:18 682ionic UI(1)Introduction 1 Inst ... -
Parse and Heroku Service(1)Heroku Installation and Play
2016-03-19 00:13 787Parse and Heroic Service(1)Hero ... -
Hybrid(5)Customize Meteor Directly Google Login
2015-09-01 02:33 888Hybrid(5)Customize Meteor Direc ... -
Hybrid(4)Favorite Places - Google Login
2015-09-01 02:02 1299Hybrid(4)Favorite Places - Goog ... -
Hybrid(3)More Meteor Example - Social
2015-08-11 05:04 729Hybrid(3)More Meteor Example - ... -
Hybrid(2)meteor Running Android and iOS
2015-07-28 23:59 1006Hybrid(2)meteor Running Android ... -
Create the Google Play Account
2015-07-18 06:42 1058Create the Google Play Account ... -
Secure REST API and Mobile(1)Document Read and Understand OAUTH2
2015-07-14 00:36 732Secure REST API and Mobile(1)Do ... -
Screen Size and Web Design
2015-07-11 01:11 694Screen Size and Web Design iPh ... -
Hybrid(1)ionic Cordova meteor
2015-06-25 05:49 431Hybrid(1)ionic Cordova meteor ... -
Android Fire Project(1)Recall Env and Knowledge
2015-02-11 12:28 651Android Fire Project(1)Recall ... -
Android Content Framework(1)Concept
2014-06-14 13:54 1050Android Content Framework(1)Con ... -
Feel Android Studio(1)Install and Update Android Studio
2014-04-11 03:12 1976Feel Android Studio(1)Install a ... -
IOS7 App Development Essentials(2)iBeacon
2014-03-05 05:55 852IOS7 App Development Essentials ... -
IOS7 App Development Essentials(1) Persistent Store
2014-03-05 05:54 1278IOS7 App Development Essentials ...
相关推荐
android-emulator-webrtc 它包含一组React组件,可用于从浏览器与android模拟器进行交互。 它旨在与连接到正在运行的仿真器的一起使用。 有关如何运行可通过网络访问的仿真器的示例,请参见脚本。 npm install --...
android_emulator_hacks We run android espresso instrumentation tests on bamboo. This worked extremely randomly due to a few issues that we've tried to solve with this app. Emulator startup: We start ...
how to install or uninstall apk to or from android emulator
android emulator数据 查看 软件 .db查看 文件查看……
如何快速启动安卓模拟器(Android_Emulator)如何快速启动安卓模拟器(Android_Emulator)如何快速启动安卓模拟器(Android_Emulator)
android adb shell 命令大全 1. 显示系统中全部Android平台: android list targets 2. 显示系统中全部AVD(模拟器): android list avd 3. 创建AVD(模拟器): android create avd --name 名称 --...
Android emulator 谷歌手机模拟器入门
docker-android-emulator, android仿真器的Docker 文件 docker-android-emulator运行 Android 模拟器最新 debianopenjdk 7Android SDK 24.3.4Android api正在运行 模拟器这里存储库为不同的SDK提供 模拟
利用命令访问android系统底层linux shell 这软件是google play市场中的推荐软件,排名很靠前,值得技术人员一用. --------------------- Access your Android's built-in Linux command line shell Android Terminal ...
Android emulator , 大家都懂的,不多说`````
官方版本,亲测可用
Install Android Emulator and Eclipse in Windows
微软的安卓模拟器Visual Studio Emulator for Android(1.1)。在64位win10下感觉蛮快的。32位的不行哦。
用于 AMD 处理器的 Android Emulator Hypervisor 驱动程序 适用于AMD处理器的Android Emulator Hypervisor驱动程序是用于加速的虚拟机管理程序。 它是通过将 KVM 移植到 Windows(Windows 7 或更高版本,64 位)而制...
Android Emulator M1预览 这是M1上一些基本的Android仿真功能的预览。 仍然存在许多问题,但是应用程序是在基本级别上运行的。 即将通过更多修复程序进行更新。 发行标签与此提交相对应: : 已知的问题 Webview在...
安卓终端模拟器,绿色无广告,最好用的android shell This is the final version that includes support for Android 1.5 "Cupcake": Term-1.0.65.apk Note: This application used to be named "Android Terminal ...
Android emulator for pc software development and debugging
Android模拟器参数 emulator启动设置 Android 模拟器 参数 emulator Google
NULL 博文链接:https://flyovrwld.iteye.com/blog/1107012
一个android terminal emulator apk的source code