You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hc.apache.org by Julius Davies <ju...@gmail.com> on 2010/04/23 22:08:56 UTC

Re: HttpClient in Android

I'm developing a tool to try and match random jar files against known jar files.

I ran the tool against the Android-7 jar file
(android-sdk-linux_86/platforms/android-7/android.jar), and here's
what my tool returned:



Best match:  'httpcore-4.0-beta2.jar' with 92 matching signatures.

Best match:  'httpclient-4.0-beta1.jar' with 127 matching signatures.


This doesn't guarantee that those are indeed the exact versions in
Android, but I have some confidence, since versions immediately before
and after happened to also be in my database.


Raw results:

 jakarta-httpcore-4.0-alpha1.jar | 2006-04-16 04:01:08 |  21
 jakarta-httpcore-4.0-alpha2.jar | 2006-06-08 16:59:10 |  23
 jakarta-httpcore-4.0-alpha3.jar | 2006-12-07 07:50:16 |  26
 jakarta-httpcore-4.0-alpha4.jar | 2007-03-23 23:50:30 |  31
 httpcore-4.0-alpha5.jar         | 2007-06-28 23:53:46 |  35
 httpcore-4.0-alpha6.jar         | 2007-10-05 19:01:12 |  65
 httpcore-4.0-beta1.jar          | 2008-01-21 02:10:46 |  88
 httpcore-4.0-beta2.jar          | 2008-06-18 02:35:46 |  92
 httpcore-4.0-beta3.jar          | 2008-10-15 03:37:48 |  88
 httpcore-4.0.jar                | 2009-02-20 04:00:22 |  87
 httpcore-4.0.1.jar              | 2009-06-19 03:06:14 |  87
 httpcore-4.1-alpha1.jar         | 2009-09-06 19:37:24 |  84


 httpclient-4.0-alpha1.jar       | 2007-07-15 00:43:50 |  31
 httpclient-4.0-alpha2.jar       | 2007-11-06 23:00:30 |  53
 httpclient-4.0-alpha3.jar       | 2008-02-21 04:46:38 |  67
 httpclient-4.0-alpha4.jar       | 2008-05-05 00:37:32 |  83
 httpclient-4.0-beta1.jar        | 2008-08-23 18:48:30 | 127
 httpclient-4.0-beta2.jar        | 2008-12-18 04:13:42 | 125
 httpclient-4.0.jar              | 2009-08-07 03:40:44 | 119
 httpclient-4.0.1.jar            | 2009-12-10 04:06:18 | 117
 httpclient-4.1-alpha1.jar       | 2009-12-10 04:25:42 | 110


I hope this information can be of some help.


yours,

Julius



>
> Um, OK. I was just trying to be helpful but should be focusing on other
> things right now. Jesse already explained that the Android team is swamped,
> and they haven't had any complaints about HttpClient, so upgrading it has
> been a relatively low priority. Android is open source. If someone feels
> strongly about updating HttpClient sooner rather later, they can submit a
> patch <http://source.android.com/download>.
>
> I'm sorry I didn't have time to process your original email. There are only
> so many hours in a day. I explained on several earlier occasions that
> Android doesn't allow binary incompatibilities of any kind (not my rule). I
> understand that the HttpClient team is more tolerant of binary
> incompatibilities. While I'm not saying it would be impossible to make these
> changes in Android, I am saying that it would take a lot of convincing (and
> time), it would annoy other people who are time-constrained and who have
> higher priorities, and it could likely fail anyway.
>
> Bob
>



-- 
yours,

Julius Davies
250-592-2284 (Home)
250-893-4579 (Mobile)

$ sudo apt-get install cowsay
$ echo "Moo." | cowsay | cowsay -n | cowsay -n
http://juliusdavies.ca/cowsay/

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org


Re: HttpClient in Android

Posted by Julius Davies <ju...@gmail.com>.
Interesting... Android's SSLSocketFactory.java doesn't have

     private static KeyManager[] createKeyManagers(KeyStore,String)


In addition, it appears that in Android's version every method just does this:

 throw new RuntimeException("Stub!");


Okay, whew, my tool seems okay.


public class T {
    public static void main(String[] args) {
        org.apache.http.conn.ssl.SSLSocketFactory.getSocketFactory();
    }
}


$ java -cp lib/android.jar:build/jarchive.jar
ca.juliusdavies.csc589d.jarchive.T
Exception in thread "main" java.lang.RuntimeException: Stub!
	at org.apache.http.conn.ssl.SSLSocketFactory.getSocketFactory(SSLSocketFactory.java:9)
	at ca.juliusdavies.csc589d.jarchive.T.main(T.java:12)





yours,

Julius



On Sat, Apr 24, 2010 at 6:46 PM, Julius Davies <ju...@gmail.com> wrote:
> Thanks, Oleg!
>
> At the moment the 4_0_API_FREEZE build matches 127 signatures, so a
> tie with beta1.
>
> But I'm looking closely at the diff, and I see one change that should
> increase the match count:
>
>
>  336 +++ module-client/src/main/java/org/apache/http/conn/ssl/SSLSocketFactory.java
>  (.../4.0-beta1) (revision 937733)
>    337 @@ -216,6 +216,20 @@
>    338          this(TLS, null, null, truststore, null, null);
>    339      }
>    340
>    341 +    public SSLSocketFactory(
>    342 +        final SSLContext sslContext,
>    343 +        final HostNameResolver nameResolver)
>    344 +    {
>    345 +        this.sslcontext = sslContext;
>    346 +        this.socketfactory = this.sslcontext.getSocketFactory();
>    347 +        this.nameResolver = nameResolver;
>    348 +    }
>    349 +
>    350 +    public SSLSocketFactory(final SSLContext sslContext)
>    351 +    {
>    352 +        this(sslContext, null);
>    353 +    }
>    354 +
>
>
> So I'm trying to dig deeper into that to see why my tool is messing up.
>
>
> My tool also missed this, but it can't handle inner classes yet:
>
>    201 +++ module-client/src/main/java/org/apache/http/impl/client/DefaultHttpClient.java
>
>    231 +    // FIXME: remove this class when protocol interceptors in HttpCore
>    232 +    // are updated to ignore CONNECT methods
>    233 +    static class IgnoreConnectMethod implements
> HttpRequestInterceptor {
>    234 +
>
>
>
> yours,
>
> Julius
>
>
> On Sat, Apr 24, 2010 at 1:46 AM, Oleg Kalnichevski <ol...@apache.org> wrote:
>> On Fri, 2010-04-23 at 13:08 -0700, Julius Davies wrote:
>>> I'm developing a tool to try and match random jar files against known jar files.
>>>
>>> I ran the tool against the Android-7 jar file
>>> (android-sdk-linux_86/platforms/android-7/android.jar), and here's
>>> what my tool returned:
>>>
>>>
>>>
>>> Best match:  'httpcore-4.0-beta2.jar' with 92 matching signatures.
>>>
>>> Best match:  'httpclient-4.0-beta1.jar' with 127 matching signatures.
>>>
>>
>> It think this is pretty accurate. I have always thought Android shipped
>> with HttpCore 4.0b2 and a snapshot of HttpClient taken a few days before
>> 4.0b1
>>
>> http://svn.apache.org/repos/asf/httpcomponents/httpclient/tags/4_0_API_FREEZE/
>>
>> You might want to build the snapshot and see if it produces a better
>> match.
>>
>> Cheers
>>
>> Oleg
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
>> For additional commands, e-mail: dev-help@hc.apache.org
>>
>>
>
>
>
> --
> yours,
>
> Julius Davies
> 250-592-2284 (Home)
> 250-893-4579 (Mobile)
>
> $ sudo apt-get install cowsay
> $ echo "Moo." | cowsay | cowsay -n | cowsay -n
> http://juliusdavies.ca/cowsay/
>



-- 
yours,

Julius Davies
250-592-2284 (Home)
250-893-4579 (Mobile)

$ sudo apt-get install cowsay
$ echo "Moo." | cowsay | cowsay -n | cowsay -n
http://juliusdavies.ca/cowsay/

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org


Re: HttpClient in Android

Posted by Julius Davies <ju...@gmail.com>.
Thanks, Oleg!

At the moment the 4_0_API_FREEZE build matches 127 signatures, so a
tie with beta1.

But I'm looking closely at the diff, and I see one change that should
increase the match count:


  336 +++ module-client/src/main/java/org/apache/http/conn/ssl/SSLSocketFactory.java
 (.../4.0-beta1) (revision 937733)
    337 @@ -216,6 +216,20 @@
    338          this(TLS, null, null, truststore, null, null);
    339      }
    340
    341 +    public SSLSocketFactory(
    342 +        final SSLContext sslContext,
    343 +        final HostNameResolver nameResolver)
    344 +    {
    345 +        this.sslcontext = sslContext;
    346 +        this.socketfactory = this.sslcontext.getSocketFactory();
    347 +        this.nameResolver = nameResolver;
    348 +    }
    349 +
    350 +    public SSLSocketFactory(final SSLContext sslContext)
    351 +    {
    352 +        this(sslContext, null);
    353 +    }
    354 +


So I'm trying to dig deeper into that to see why my tool is messing up.


My tool also missed this, but it can't handle inner classes yet:

    201 +++ module-client/src/main/java/org/apache/http/impl/client/DefaultHttpClient.java

    231 +    // FIXME: remove this class when protocol interceptors in HttpCore
    232 +    // are updated to ignore CONNECT methods
    233 +    static class IgnoreConnectMethod implements
HttpRequestInterceptor {
    234 +



yours,

Julius


On Sat, Apr 24, 2010 at 1:46 AM, Oleg Kalnichevski <ol...@apache.org> wrote:
> On Fri, 2010-04-23 at 13:08 -0700, Julius Davies wrote:
>> I'm developing a tool to try and match random jar files against known jar files.
>>
>> I ran the tool against the Android-7 jar file
>> (android-sdk-linux_86/platforms/android-7/android.jar), and here's
>> what my tool returned:
>>
>>
>>
>> Best match:  'httpcore-4.0-beta2.jar' with 92 matching signatures.
>>
>> Best match:  'httpclient-4.0-beta1.jar' with 127 matching signatures.
>>
>
> It think this is pretty accurate. I have always thought Android shipped
> with HttpCore 4.0b2 and a snapshot of HttpClient taken a few days before
> 4.0b1
>
> http://svn.apache.org/repos/asf/httpcomponents/httpclient/tags/4_0_API_FREEZE/
>
> You might want to build the snapshot and see if it produces a better
> match.
>
> Cheers
>
> Oleg
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
> For additional commands, e-mail: dev-help@hc.apache.org
>
>



-- 
yours,

Julius Davies
250-592-2284 (Home)
250-893-4579 (Mobile)

$ sudo apt-get install cowsay
$ echo "Moo." | cowsay | cowsay -n | cowsay -n
http://juliusdavies.ca/cowsay/

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org


Re: HttpClient in Android

Posted by Oleg Kalnichevski <ol...@apache.org>.
On Fri, 2010-04-23 at 13:08 -0700, Julius Davies wrote:
> I'm developing a tool to try and match random jar files against known jar files.
> 
> I ran the tool against the Android-7 jar file
> (android-sdk-linux_86/platforms/android-7/android.jar), and here's
> what my tool returned:
> 
> 
> 
> Best match:  'httpcore-4.0-beta2.jar' with 92 matching signatures.
> 
> Best match:  'httpclient-4.0-beta1.jar' with 127 matching signatures.
> 

It think this is pretty accurate. I have always thought Android shipped
with HttpCore 4.0b2 and a snapshot of HttpClient taken a few days before
4.0b1

http://svn.apache.org/repos/asf/httpcomponents/httpclient/tags/4_0_API_FREEZE/

You might want to build the snapshot and see if it produces a better
match.

Cheers

Oleg


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org


Re: HttpClient in Android

Posted by Julius Davies <ju...@gmail.com>.
ps.  The signature count means # of classes with exactly the same
signature, and in this case signature means all 5 of these attributes
matched:

1. fully qualified class name
2. class modifiers and visibility, as well as extends, implements
3. all method names, parameter types, return types, and throws types
4. all method modifiers and visibility (e.g. static, final, protected,
private, synchronized)
5. all methods must appear in the same order in the class

Private methods are also included in the matching, so the fact that
fewer signatures match in httpcore-4.0 could be from private methods
changing.





On Fri, Apr 23, 2010 at 1:08 PM, Julius Davies <ju...@gmail.com> wrote:
> I'm developing a tool to try and match random jar files against known jar files.
>
> I ran the tool against the Android-7 jar file
> (android-sdk-linux_86/platforms/android-7/android.jar), and here's
> what my tool returned:
>
>
>
> Best match:  'httpcore-4.0-beta2.jar' with 92 matching signatures.
>
> Best match:  'httpclient-4.0-beta1.jar' with 127 matching signatures.
>
>
> This doesn't guarantee that those are indeed the exact versions in
> Android, but I have some confidence, since versions immediately before
> and after happened to also be in my database.
>
>
> Raw results:
>
>  jakarta-httpcore-4.0-alpha1.jar | 2006-04-16 04:01:08 |  21
>  jakarta-httpcore-4.0-alpha2.jar | 2006-06-08 16:59:10 |  23
>  jakarta-httpcore-4.0-alpha3.jar | 2006-12-07 07:50:16 |  26
>  jakarta-httpcore-4.0-alpha4.jar | 2007-03-23 23:50:30 |  31
>  httpcore-4.0-alpha5.jar         | 2007-06-28 23:53:46 |  35
>  httpcore-4.0-alpha6.jar         | 2007-10-05 19:01:12 |  65
>  httpcore-4.0-beta1.jar          | 2008-01-21 02:10:46 |  88
>  httpcore-4.0-beta2.jar          | 2008-06-18 02:35:46 |  92
>  httpcore-4.0-beta3.jar          | 2008-10-15 03:37:48 |  88
>  httpcore-4.0.jar                | 2009-02-20 04:00:22 |  87
>  httpcore-4.0.1.jar              | 2009-06-19 03:06:14 |  87
>  httpcore-4.1-alpha1.jar         | 2009-09-06 19:37:24 |  84
>
>
>  httpclient-4.0-alpha1.jar       | 2007-07-15 00:43:50 |  31
>  httpclient-4.0-alpha2.jar       | 2007-11-06 23:00:30 |  53
>  httpclient-4.0-alpha3.jar       | 2008-02-21 04:46:38 |  67
>  httpclient-4.0-alpha4.jar       | 2008-05-05 00:37:32 |  83
>  httpclient-4.0-beta1.jar        | 2008-08-23 18:48:30 | 127
>  httpclient-4.0-beta2.jar        | 2008-12-18 04:13:42 | 125
>  httpclient-4.0.jar              | 2009-08-07 03:40:44 | 119
>  httpclient-4.0.1.jar            | 2009-12-10 04:06:18 | 117
>  httpclient-4.1-alpha1.jar       | 2009-12-10 04:25:42 | 110
>
>
> I hope this information can be of some help.
>
>
> yours,
>
> Julius
>
>
>
>>
>> Um, OK. I was just trying to be helpful but should be focusing on other
>> things right now. Jesse already explained that the Android team is swamped,
>> and they haven't had any complaints about HttpClient, so upgrading it has
>> been a relatively low priority. Android is open source. If someone feels
>> strongly about updating HttpClient sooner rather later, they can submit a
>> patch <http://source.android.com/download>.
>>
>> I'm sorry I didn't have time to process your original email. There are only
>> so many hours in a day. I explained on several earlier occasions that
>> Android doesn't allow binary incompatibilities of any kind (not my rule). I
>> understand that the HttpClient team is more tolerant of binary
>> incompatibilities. While I'm not saying it would be impossible to make these
>> changes in Android, I am saying that it would take a lot of convincing (and
>> time), it would annoy other people who are time-constrained and who have
>> higher priorities, and it could likely fail anyway.
>>
>> Bob
>>
>
>
>
> --
> yours,
>
> Julius Davies
> 250-592-2284 (Home)
> 250-893-4579 (Mobile)
>
> $ sudo apt-get install cowsay
> $ echo "Moo." | cowsay | cowsay -n | cowsay -n
> http://juliusdavies.ca/cowsay/
>



-- 
yours,

Julius Davies
250-592-2284 (Home)
250-893-4579 (Mobile)

$ sudo apt-get install cowsay
$ echo "Moo." | cowsay | cowsay -n | cowsay -n
http://juliusdavies.ca/cowsay/

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org