Either link in an HTTP library (that you also build) or use JNI to
connect with the Java library.
Tim
--
You received this message because you are subscribed to the Google Groups "android-ndk" group.
To post to this group, send email to andro...@googlegroups.com.
To unsubscribe from this group, send email to android-ndk...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/android-ndk?hl=en.
You could put them into the C-code encrypted along with the key; it
would be "more" secure than doing the same thing in Java, since Java
decompilers will give you easier-to-read code than a disassembler. But
you could do JUST that part in the C library as well: Just have a
function that you call from Java using JNI that returns the appropriate
strings. That gets you 95% of the benefit, without having to rewrite
HTTP in C or go through JNI calls to Java for every request.
Tim
--
You received this message because you are subscribed to the Google Groups "android-ndk" group.
To post to this group, send email to andro...@googlegroups.com.
To unsubscribe from this group, send email to android-ndk...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/android-ndk?hl=en.
httpCon = (HttpURLConnection) httpUrl.openConnection();
httpCon.setRequestMethod("GET");
if (httpCon.getResponseCode() == HttpURLConnection.HTTP_OK)
{
is = httpCon.getInputStream();
int ch;
sb = new StringBuffer();
while ((ch = is.read()) != -1) {
sb.append((char) ch);
}
}
Seems rather silly. Wouldn’t string encryption and java obfuscation be an easier answer?
No virus found in this message.
Checked by AVG - www.avg.com
Version: 10.0.1388 / Virus Database: 1516/3734 - Release Date: 06/29/11
If someone decompiling Java source is a serious enough threat to merit
additional security measures, then it's serious enough to merit real ones.
If it isn't, Java obfuscation + encryption is practically free and should
suffice to protect the data from most attackers.
-----Original Message-----
From: andro...@googlegroups.com [mailto:andro...@googlegroups.com] On
Behalf Of Tim Mensch
Sent: Wednesday, July 06, 2011 9:19 AM
To: andro...@googlegroups.com
Subject: Re: how to make http connection using ndk?
Tim
--
You received this message because you are subscribed to the Google Groups
"android-ndk" group.
To post to this group, send email to andro...@googlegroups.com.
To unsubscribe from this group, send email to
android-ndk...@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/android-ndk?hl=en.
-----
I'm not sure what would qualify as a "real" security measure, though,
short of a design that doesn't require any of the secrets to be on the
client.
Tim
--
You received this message because you are subscribed to the Google Groups "android-ndk" group.
To post to this group, send email to andro...@googlegroups.com.
To unsubscribe from this group, send email to android-ndk...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/android-ndk?hl=en.
It sounds like you've resolved this problem already, but in case you're
still interested in the Java solution, I found it here:
http://blog.antoine.li/index.php/2010/10/android-trusting-ssl-certificates/
You just import the signing cert and you can connect with a self-signed
HTTPS host. If that's not enough (not sure what you're doing with the
proxy?), you can create the socket factory with
ALLOW_ALL_HOSTNAME_VERIFIER, which should ignore the host name entirely).
Tim
--
You received this message because you are subscribed to the Google Groups "android-ndk" group.
To post to this group, send email to andro...@googlegroups.com.
To unsubscribe from this group, send email to android-ndk...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/android-ndk?hl=en.
OK, well, I was able to get it to work with a free cert from
https://www.startssl.com, but I had to import their CA chain which is
not built in to Android devices. Since I got the rest of it to work,
changing to ALLOW_ALL_HOSTNAME_VERIFIER should have prevented it from
having problems with a proxy.
But if your solution works, then run with it. :)
Tim