- 浏览: 2542004 次
- 性别:
- 来自: 成都
文章分类
最新评论
-
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 1255ionic UI(4)ionic2 framework - b ... -
ionic UI(3)TypeScript - handbook
2016-03-22 23:21 630ionic UI(3)TypeScript - handboo ... -
ionic UI(2)ionic2 framework - TypeScript - tutorial
2016-03-22 06:52 1648ionic UI(2)ionic2 framework - T ... -
Parse and Heroku Service(3)Parse Server and Parse Dashboard
2016-03-22 06:30 960Parse and Heroku Service(3)Pars ... -
Parse and Heroku Service(2)Mail Templates and Push Notification
2016-03-22 02:45 574Parse and Heroku Service(2)Mail ... -
ionic UI(1)Introduction
2016-03-19 03:18 714ionic UI(1)Introduction 1 Inst ... -
Parse and Heroku Service(1)Heroku Installation and Play
2016-03-19 00:13 815Parse and Heroic Service(1)Hero ... -
Hybrid(5)Customize Meteor Directly Google Login
2015-09-01 02:33 908Hybrid(5)Customize Meteor Direc ... -
Hybrid(4)Favorite Places - Google Login
2015-09-01 02:02 1333Hybrid(4)Favorite Places - Goog ... -
Hybrid(3)More Meteor Example - Social
2015-08-11 05:04 749Hybrid(3)More Meteor Example - ... -
Hybrid(2)meteor Running Android and iOS
2015-07-28 23:59 1042Hybrid(2)meteor Running Android ... -
Create the Google Play Account
2015-07-18 06:42 1095Create the Google Play Account ... -
Secure REST API and Mobile(1)Document Read and Understand OAUTH2
2015-07-14 00:36 757Secure REST API and Mobile(1)Do ... -
Screen Size and Web Design
2015-07-11 01:11 718Screen Size and Web Design iPh ... -
Hybrid(1)ionic Cordova meteor
2015-06-25 05:49 460Hybrid(1)ionic Cordova meteor ... -
Android Fire Project(1)Recall Env and Knowledge
2015-02-11 12:28 676Android Fire Project(1)Recall ... -
Android Content Framework(1)Concept
2014-06-14 13:54 1071Android Content Framework(1)Con ... -
Feel Android Studio(1)Install and Update Android Studio
2014-04-11 03:12 2020Feel Android Studio(1)Install a ... -
IOS7 App Development Essentials(2)iBeacon
2014-03-05 05:55 883IOS7 App Development Essentials ... -
IOS7 App Development Essentials(1) Persistent Store
2014-03-05 05:54 1314IOS7 App Development Essentials ...
相关推荐
docker-android-emulator, android仿真器的Docker 文件 docker-android-emulator运行 Android 模拟器最新 debianopenjdk 7Android SDK 24.3.4Android api正在运行 模拟器这里存储库为不同的SDK提供 模拟
快速启动安卓模拟器(Android_Emulator)的方法 Android 模拟器是一种非常有用的工具,对于 Android 应用程序的开发和测试来说非常重要。然而,每次启动 Android Emulator 都需要等待很长一段时间,几分钟甚至十几...
在Android 5.1.1系统上,"android terminal emulator.apk"表现良好,用户可以顺畅地输入各种ADB命令,如"adb shell"进入设备的shell环境,执行"ls"查看目录内容,"cd"切换目录,"install"安装APK文件,甚至"push"和...
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 ...
在Android Emulator上安装App Market-g是一个常见的任务,特别是对于开发者和测试人员而言,他们需要在模拟器上体验和测试各种应用。这篇文章将详细介绍如何在Android Emulator中安装Market-g,以便获取更多的应用...
在 Ubuntu 上 Android Studio 中启动 Emulator闪退的解决方法 在 Android Studio 中点击模拟器的启动按钮后,模拟器界面弹出后,又立刻闪退。这是非常常见的问题,本文将为大家分享 Ubuntu 上在 Android Studio 中...
4. **Android Terminal Emulator**:对于普通用户,可以在设备上安装终端模拟器应用,如Terminal Emulator for Android,直接在设备上输入并执行shell命令。 执行shell命令时,需要注意以下几点: - **权限**:...
标题中的“android emulator数据库文件查看软件”指的是在Android模拟器中用于查看SQLite数据库文件的工具。在Android系统中,SQLite是一种轻量级的、关系型的数据库,常用于存储应用程序的数据。开发者或测试人员...
### 使用命令行操作Android模拟器:安装与卸载APK 在进行Android应用开发时,开发者经常需要在模拟器上测试应用。为了提高效率并减少手动操作,掌握如何通过命令行来安装或卸载APK是非常有用的技能。下面将详细介绍...
**Android SDK中的emulator.exe详解** 在Android应用开发过程中,Android SDK(Software Development Kit)扮演着至关重要的角色。它提供了一系列工具,使得开发者能够在没有实际设备的情况下,通过模拟器(Android...
在本文中,我们将深入探讨如何在Windows操作系统上安装Android Emulator和Eclipse,这两个工具是Android应用开发不可或缺的部分。Android Emulator允许开发者在没有物理设备的情况下测试和调试应用程序,而Eclipse则...
《Android Auto Emulator (DHU) for Linux:打造车载体验的新纪元》 在现代科技的快速发展中,Android Auto已经成为连接智能手机与车载信息娱乐系统的重要桥梁。为了满足开发者和用户在Linux平台上模拟Android Auto...
利用命令访问android系统底层linux shell 这软件是google play市场中的推荐软件,排名很靠前,值得技术人员一用. --------------------- Access your Android's built-in Linux command line shell Android Terminal ...
官方版本,亲测可用
安卓终端模拟器,绿色无广告,最好用的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 ...
用于 AMD 处理器的 Android Emulator Hypervisor 驱动程序 适用于AMD处理器的Android Emulator Hypervisor驱动程序是用于加速的虚拟机管理程序。 它是通过将 KVM 移植到 Windows(Windows 7 或更高版本,64 位)而制...