market and cacerts.bks - Android Software/Hacking General [Developers Only]

Hi,
I've a magic 32B with cyanogenmod v4.2.15.1.
I would like to import StartSSL and FreeSSL certificates authority.
To do this I modified /etc/security/cacerts.bks with keytool on my pc, push the new cacerts.bks to my phone, changed permissions (644), and rebooted the phone.
Now I can connect to FreeSSL https websites without any warning. But the Android Market stops working: I can't download and install apps.
I've this log:
Code:
W/vending ( 776): com.android.vending.api.RequestDispatcher.performRequestsOverNetwork(): IOException while performing API request: Delayed instantiation exception:
E/vending ( 776): com.android.vending.AsynchRequestRunner$1.runRequestRetryingFailure(): Got IOException from async request: Delayed instantiation exception:
D/vending ( 776): com.android.vending.api.LocalAssetDatabase.notifyListener(): -4182933297171720279 / DOWNLOAD_FAILED
If I restore the original cacerts.bks, market works fine, but of course I've warnings with FreeSSL websites.
Can you help me to install FreeSSL CA without disturbing Android Market ?
Thanks.

for citrix client, i've edited cacerts.bks too.
i've used a java program, portecle:
http://portecle.sourceforge.net/
download it, then launch it with the windows command: java -jar portecle.jar
with this tools, open cacerts.bks, and import your ca cert
save the bks and push it into your phone, for me it has worked!

Related

[Q][Froyo][ndk]Subversion Building and Installation of Shared Libs

Disclaimer: This post is unstructured and may be missing crucial info because of that. Please point out the glaring errors and omissions.
Background:
Phone: Huawei Ideos U8150 (Aircel India branding)
OS: Stock 2.2 original firmware (Build number: U8150V100R001C234B832SP02)
Root: Z4Root temporary root (superuser and su installed by z4root)
Relavant Apps: SL4A+Perl for android, Vim for android, Connectbot, dropbear ssh client
I use vim and perl as my primary work tools and have them working beautifully on my Ideos. However, I am unable to access my source code as it is in a subversion repository with only svn+ssh access. So first, I got ssh on my phone (dropbear client 0.49) and then, searched for a subversion build for Froyo.
Finding nothing by way of a command line client for subversion, I decided to build it on my own with the NDK. This is where I've run into trouble. It has a lot of issues building it and once I do, it fails to run on the phone. Has someone tried to do this and successfully managed it? If so, I'd really appreciate the binaries and info on how to install
If not, I'd like to pool our knowledge for getting a successful build/run.
My process:
1) minimal Ubuntu lucid lynx
2) install ant1.8, make, and sun jdk 1.6 using apt-get (no X)
3) get the SDK in $HOME and use the Commandline interface to get everything (no package selection possible, just oneshot all selection)
4) get the NDK into $HOME
5) get svn source tar
6) get svn dependencies tar (svn site itself)
7) untar them together
8) Follow this and this to get the configure script running.
My configure is (using froyo: android-8 platform)
Code:
PATH="$PATH:$NDK/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86/bin/"
./configure --prefix=/usr/local/android-arm/sysroot/usr \
--build=i686-pc-linux-gnu --host=arm-linux-androideabi \
CFLAGS="-mandroid -nostdlib" \
CPPFLAGS="-I$NDK/platforms/android-8/arch-arm/usr/include" \
LDFLAGS="-Wl,-rpath-link=$NDK/platforms/android-8/arch-arm/usr/lib/ \
-L$NDK/platforms/android-8/arch-arm/usr/lib/" \
LIBS="-lc -lcrypt" --without-ssl --without-neon --without-serf --disable-dso
9) Get configure to run successfully.
9.1)Fix failures because cross-compile checks not possible: yes to /dev/null, yes to setpgrp void, no to PROCESS SHARED locks, no to TCP_NODELAY with TCP_CORK
9.2) Fix all config.sub to accept androideabi as a valid os (add relevant section into OS switch-case),
10) run make
11) Fix make issues (make APR_HAVE_IOVEC = 1 in apr.h, remove conditional so that fdatasync is defined as fsync in sqlite3.c)
12) fix link issues with libcrypt by creating the libcrypt from here and adding it to $NDK/platforms/android-8/arch-arm/usr/lib/
13) Run make install to create deployment tree.
14) tar gzip it and push on phone. (including libcrypt)
Open issues/steps with unknown solutions:
15) How to install shared libs (libcrypt)?
16) how to build static?
17) How to make this post better?
Could the mods please shift this thread to the android dev forum?

[Q] Cannot install SDK: Failure initializing default SSL context

I am trying to install the SDK on my 64 bit linux machine running debian testing. I am following the procedure written here: XXX//developer.android.com/sdk/installing.html and have reached the step where you go into the tools directory and type ./android
It's failing with these messages -- except that I added the XXX so that I could post this note to the forum which won't let me post urls. for XXX read h t t p s below and h t t p above
Fetching XXXdl-ssl.google.com/android/repository/addons_list-1.xml
Failed to fetch URL XXXdl-ssl.google.com/android/repository/addons_list-1.xml, reason: Failure initializing default SSL context
Fetched Add-ons List successfully
Fetching URL: XXXdl-ssl.google.com/android/repository/repository-5.xml
Failed to fetch URL XXXdl-ssl.google.com/android/repository/repository-5.xml, reason: Failure initializing default SSL context
Done loading packages.
I thought to replace https with http but grepping the tools directory for the string XXXdl-ssl.google.com did not find anything.
I don't understand this error message, and I don't know what next to try.
Thanks very much.
Updating from openjdk-6-jdk to openjdk-7-jdk fixed the problem. Just in case anybody else runs into it.

Linux Installer

There is this linux installer app in the market (link).
As it needs root, and I haven't done it yet, is there anyone here that have tried it??
Thanks,
Thanks, gonna give it a try later.
What about this?
Oh crap, I completely forgot.. Got mixed up with other stuff
Gonna put a reminder.
EDIT: Done. Screenshots attached, one for the standard terminal, the other from aptitude, before updating packages.
Anyone else tried this? I'm having some issues with getting mysql up and running. If anyone is asking well, I'm trying to transform my phone into a server and host my own site
Just because I CAN! *evil laughter*
It seems we now have a computer much more than a smartphone...
Maybe it's time to root to test this.
If it has aircrack-ng then it will worth the work.
Managed to connect via SSH from PC. Still haven't looked into the MySQL issues though.
I finally unbootlocked and rooted my ChaCha and installed this.
I installed Debian, and I'm ready to start testing things.
I installed stable but manually upgraded to testing. But I couldn't setup a SSH server.
Where did you got from??
What do you have in your sources.list?
Update apt from the Distribution Manager and afterwards:
Code:
apt-get check
apt-get update
apt-get upgrade
apt-get install ssh
I still couldn't get MySQL server 5.1 up and running; I have a strange feeling there's something wrong with the distribution, as I've just installed it on my ubuntu box without any errors.
Can you give it a try?
Code:
apt-get install mysql-server-5.1
It should print out something about package not configured yet at some point.
EDIT: Forgot to add
Code:
apt-get install openssh-server
Start the ssh server with
Code:
/usr/sbin/sshd
with "sshd" only you'll get the following error:
Code:
sshd re-exec requires execution with absolute path
Afaik, the sshd $PATH is defined wrong for the service so that's why running it simply with sshd won't work.
Test the functionality afterwards with:
Code:
ssh localhost
Forgot to add the info you requested for sources.list:
Code:
deb http://ftp.debian.org/debian squeeze main non-free
deb-src http://ftp.debian.org/debian squeeze main non-free
deb http://ftp.debian.org/debian squeeze/squeeze main non-free
deb-src http://ftp.debian.org/debian squeeze/squeeze main non-free
Should be the same though I think. What's yours?
Ok. I'll try that.
I already installed psmisc so I could try the lsdev command.
But as it uses /proc and /dev folders, and none of them are in the chroot, they are useless...
But I will try to somehow link from inside the chroot to the actual folders, to try if they work.
EDIT:
I tried mysql server, and I had an error just in the very final stage of setup.
Is this the same for you??
someone got succes?
tokafondo said:
EDIT:
I tried mysql server, and I had an error just in the very final stage of setup.
Is this the same for you??
Click to expand...
Click to collapse
Yep, it's the same.
I'm thinking that mysql 5.0 is already installed and when trying to upgrade to 5.1 a know issue is occurring, where my.cnf does not contain a skip-bdb command at the end, but it doesn't seem to work either; also tried chmod a+r on the my.cnf file as permissions were not granted properly on my device.
@dr. - success on what?
sorry i meant to boot gnome or lxde on htc chacha
dr.ilijevski said:
sorry i meant to boot gnome or lxde on htc chacha
Click to expand...
Click to collapse
Modifying the init scripts in the boot partition, I think it could be done.
Take a look here to have the information that could lead you to do it:
http://www.androidenea.com/2009/06/android-boot-process-from-power-on.html
http://www.androidenea.com/2009/08/init-process-and-initrc.html
Well, that is really the tip of the iceberg, because you would have then to port the X.org server, searching/porting/writing for the drivers for it to work, and finding a desktop enviroment that would run smoothly and with enough room in such a small screen with such a low resolution.
And not only that... What about the radio? Not the FM radio, but the GSM or CDMA radio that allows you to make voice calls and have mobile internet.
Funny thing is that if you check the market app screenshots, there is a screenshot of a running deb dist, apparently on a device.
Alex C. said:
Funny thing is that if you check the market app screenshots, there is a screenshot of a running deb dist, apparently on a device.
Click to expand...
Click to collapse
I sent the developer a couple of questions and had no answer...
This was a kind of experiment, but I think it won't last that much in my ChaCha, because it has no practical use -- for me.
Hmm, got a few extras:
mysqld (the mysql server's main program)
[ERROR]: Can't create IP socket: Permission denied
[ERROR]: Aborting.
So the ld ain't turning on since it has no "permission" to open up sockets, therefore both the mysql-server and the mysql-server-5.1 won't be able to install, since both of them require the mysqld to start first.
Addendum: missing socket file mysqld.sock in /var/run/mysqld/ seems to be the cause of this problem.
Alex C. said:
Yep, it's the same.
I'm thinking that mysql 5.0 is already installed and when trying to upgrade to 5.1 a know issue is occurring, where my.cnf does not contain a skip-bdb command at the end, but it doesn't seem to work either; also tried chmod a+r on the my.cnf file as permissions were not granted properly on my device.
@dr. - success on what?
Click to expand...
Click to collapse
Hi, reviving this question after all this time, aka message in a bottle out to anyone....
so, the stage: debian wheezy fully upgraded in a chroot jail on a nexus 7. ssh, lxde, vnc, zsh, nodejs, erlang, more stuff installed, no problems.
tried to install mysql-server 5.5, got the exact same error as in the image above. drilled a little bit, after the failed install, i ran this:
[1] % sudo mysqld --console --verbose &
[1] 18920
(ssh)[email protected] : ~
[0] % 130415 15:34:48 [Note] Plugin 'FEDERATED' is disabled.
130415 15:34:48 InnoDB: The InnoDB memory heap is disabled
130415 15:34:48 InnoDB: Mutexes and rw_locks use GCC atomic builtins
130415 15:34:48 InnoDB: Compressed tables use zlib 1.2.7
130415 15:34:48 InnoDB: Using Linux native AIO
130415 15:34:48 InnoDB: Initializing buffer pool, size = 128.0M
130415 15:34:48 InnoDB: Completed initialization of buffer pool
130415 15:34:48 InnoDB: highest supported file format is Barracuda.
130415 15:34:48 InnoDB: Waiting for the background threads to start
130415 15:34:49 InnoDB: 5.5.30 started; log sequence number 1595675
130415 15:34:49 [Note] Server hostname (bind-address): '0.0.0.0'; port: 3306
130415 15:34:49 [Note] - '0.0.0.0' resolves to '0.0.0.0';
130415 15:34:49 [Note] Server socket created on IP: '0.0.0.0'.
130415 15:34:49 [ERROR] mysqld: Can't create/write to file '/home/deimosaffair/mysqlhome/var/run/my
sqld/mysqld.pid' (Errcode: 2)
130415 15:34:49 [ERROR] Can't start server: can't create PID file: No such file or directory
note the two last lines. it seems that there are no permissions somehow to create the PID file. i edited the my.cnf file to point to that dir, tried to change the user from "mysql" to "root", nothing worked.
the dir is valid and has wide open access (i made chmod a+rw on it just to be sure), so the permissions should be ok.
the wall is starting to be bloodied from so much headbumping. any ideas in this?
dr.ilijevski said:
someone got succes?
Click to expand...
Click to collapse
Yes, I sincerely apologize for kicking an old thread but I ran into this issue today and nobody seemed to know the answer.
The fix is:
adduser mysql AID_INET
It adds the mysql user to the AID_INET group. After this MySQLd will start just fine.

[Guide] [Jupyter][Termiux][noroot][python]jupyter notebook fully works on android

Hi all,
So, for the last 8 months I have been searching to install and run Jupyter on Android
Now a days iPython notebooks have become very famous.
I searched and finally stumbled upon this great and minimal installation of python in you android smartphone.
Required:
Termiux
Hacker's keyboard - Anysoft is more usable and more conventional.
AnySoftKeyboard
Procedure:
After installing Anysoft keyboard, open the app to set it up.
In the app, when you drag from left and cliick on "keyboards", you can select " terminal" keyboard. Once done,
Install Termiux
Go to the termux app.. wait for termux to install its files.
run:
Code:
apt update
apt upgrade
Then runt this code
Code:
apt install clang python python-dev fftw libzmq libzmq-dev freetype freetype-dev libpng libpng-dev pkg-config
LDFLAGS=" -lm -lcompiler_rt" pip install numpy matplotlib pandas jupyter
pip install jupyter
Note: you may get an error or more while running the code. But mostly, it will work even after the error. Feel free to reach me. I'll try to help the best of my knowledge.
Now you're good to go.
You can now open the jupyter in your phone web browser, no internet connection required..
Enter this code, followed by enter..
Code:
jupyter notebook
You will get a local page address generated with following instructions :
Code:
Copy/paste this URL into your browser when you connect for the first time,
to login with a token:
http://localhost:8888/?token=<sixteendigitcode>
Copy paste the address in your web browser.. you will be redirected to local page where you can create and run python notebooks. Also, you can run small snipets inside Termux itself.
Disclaimer
This is not my development. The original development is done by someone else. This thread is created to make it easy to find. Purely for information.
Original thread by the Developer:
http://www.leouieda.com/blog/scipy-on-android.html

How do I sign an APK with the system key using SingApk.jar?

I need to sign an APK using the system keys obtained from Google's source (As an example) using SignApk.jar. However, everytime we try to Sign we get the error below...
This is the command we are using (Please note we are using the Source code downloaded from Google for Android 8.1 for the Pixel).
Besides this method, is there another way to sign an APK with the system key?
java -Xmx2048m -Djava.library.path="out/host/linux-x86/lib64" -jar prebuilts/sdk/tools/lib/signapk.jar -w build/make/target/product/security/platform.x509.pem build/make/target/product/security/platform.pk8 Unsigned-Apk.apk Signed_final_apk.apk
Error: Exception in thread "main" java.lang.ExceptionInInitializerError
at org.conscrypt.OpenSSLBIOInputStream.<init>(OpenSSLBIOInputStream.java:34)
at org.conscrypt.OpenSSLX509Certificate.fromX509PemInputStream(OpenSSLX509Certificate.java:119)
at org.conscrypt.OpenSSLX509CertificateFactory$1.fromX509PemInputStream(OpenSSLX509CertificateFactory.java:220)
at org.conscrypt.OpenSSLX509CertificateFactory$1.fromX509PemInputStream(OpenSSLX509CertificateFactory.java:216)
at org.conscrypt.OpenSSLX509CertificateFactory$Parser.generateItem(OpenSSLX509CertificateFactory.java:94)
at org.conscrypt.OpenSSLX509CertificateFactory.engineGenerateCertificate(OpenSSLX509CertificateFactory.java:272)
at java.security.cert.CertificateFactory.generateCertificate(CertificateFactory.java:339)
at com.android.signapk.SignApk.readPublicKey(SignApk.java:184)
at com.android.signapk.SignApk.main(SignApk.java:1007)
Caused by: java.lang.IllegalArgumentException: Failed to load any of the given libraries: [conscrypt_openjdk_jni-osx-x86_64, conscrypt_openjdk_jni]
at org.conscrypt.NativeLibraryLoader.loadFirstAvailable(NativeLibraryLoader.java:160)
at org.conscrypt.NativeCryptoJni.init(NativeCryptoJni.java:49)
at org.conscrypt.NativeCrypto.<clinit>(NativeCrypto.java:53)
... 9 more

Categories

Resources