Android-dev.it Community

 
Annunci

:arrow: Benvenuto!, se non sei ancora un utente registrato: puoi registrati qui, oppure effettua il login
:arrow: Apri un forum sul tuo nuovo smartphone Android e collabora con noi! (dettagli)

www.agendadigitale.org
Image


Sponsor
It is currently Sat Feb 11, 2012 7:50 pm

All times are UTC + 1 hour


 Topics   Replies   Views   Last post 
No new posts Attachment(s) aiutino per un applicazione :D

by fillo on Sat Feb 11, 2012 7:06 pm in Sviluppo e programmazione in Android

2

19

Sat Feb 11, 2012 7:06 pm

fillo

No new posts Gridview e focus item

by boriskarloff on Sat Feb 11, 2012 4:29 am in Sviluppo e programmazione in Android

0

10

Sat Feb 11, 2012 4:29 am

boriskarloff

No new posts Attachment(s) help raga perchè non mi trova il txt_url?

by fillo on Fri Feb 10, 2012 5:25 pm in Sviluppo e programmazione in Android

3

41

Fri Feb 10, 2012 5:25 pm

fillo

No new posts Riempire spazio orizzontale

by TheSgrash on Thu Feb 09, 2012 9:43 am in Sviluppo e programmazione in Android

2

83

Thu Feb 09, 2012 9:43 am

TheSgrash

No new posts Help creazione immagini

by hero82 on Wed Feb 08, 2012 6:57 pm in Sviluppo e programmazione in Android

2

42

Wed Feb 08, 2012 6:57 pm

hero82




Post new topic Reply to topic  [ 47 posts ]  Go to page Previous  1, 2, 3, 4, 5  Next
Author Message
 Post subject: Re: Browsing attraverso proxy impostando user&passwd
PostPosted: Wed Apr 07, 2010 7:34 pm 
Offline
User avatar

Joined: Mon Jan 11, 2010 3:35 pm
Posts: 56
Cellulare Android: HTC Hero
Operatore: TIM
Punti Android: 67
In attesa del parere di Verix posso gia' dirti che ho provato ad usare l'indirizzo Ip numerico e non e' successo niente.
Aggiungo che oggi non navigavo neanche in uffcio con in PC. Non so se la cosa centi o meno ma non si sa mai......................


Top
 Profile  
 
 Post subject: Re: Browsing attraverso proxy impostando user&passwd
PostPosted: Thu Apr 08, 2010 3:59 pm 
Offline
User avatar

Joined: Fri Nov 20, 2009 5:28 pm
Posts: 46
Cellulare Android: HTC Magic
Punti Android: 54
Beh sicuramente se il proxy non funziona nemmeno da pc fisso, non c'è speranza che funzioni con android. L'unica cosa che puoi verificare, quando utilizzi direttamente l'ip per raggiungere un sito, è se a livello rete tcpdump ti mostra i pacchetti indirizzati direttamente a quell'ip (= android non sta utilizzando il proxy) oppure ti mostra i pacchetti indirizzati al proxy (=c'è speranza che funzioni...).

Intanto, stavo provando a leggermi le porzioni di codice in cui viene settato il proxy. La configurazione sembra risiedere in [platform/frameworks/base.git] / core / java / android / net / http / RequestQueue.java

Code:
223     /**
224      * Enables data state and proxy tracking
225      */
226     public synchronized void enablePlatformNotifications() {
227         if (HttpLog.LOGV) HttpLog.v("RequestQueue.enablePlatformNotifications() network");
228
229         if (mProxyChangeReceiver == null) {
230             mProxyChangeReceiver =
231                     new BroadcastReceiver() {
232                         @Override
233                         public void onReceive(Context ctx, Intent intent) {
234                             setProxyConfig();
235                         }
236                     };
237             mContext.registerReceiver(mProxyChangeReceiver,
238                                       new IntentFilter(Proxy.PROXY_CHANGE_ACTION));
239         }
240     }
...
255     /**
256      * Because our IntentReceiver can run within a different thread,
257      * synchronize setting the proxy
258      */
259     private synchronized void setProxyConfig() {
260         NetworkInfo info = mConnectivityManager.getActiveNetworkInfo();
261         if (info != null && info.getType() == ConnectivityManager.TYPE_WIFI) {
262             mProxyHost = null;
263         } else {
264             String host = Proxy.getHost(mContext);
265             if (HttpLog.LOGV) HttpLog.v("RequestQueue.setProxyConfig " + host);
266             if (host == null) {
267                 mProxyHost = null;
268             } else {
269                 mActivePool.disablePersistence();
270                 mProxyHost = new HttpHost(host, Proxy.getPort(mContext), "http");
271             }
272         }
273     }


Qui, purtroppo, mi muovo in un campo che conosco poco e mi servirebbe una mano da qualcuno più esperto.
Da quel che ho capito, il metodo setProxyConfig() viene invocato quando interviene un cambio nella rete (es. un passaggio da rete 3G a wifi o viceversa) e, immagino, anche in fase di inizializzazione.

In questo caso mi sarei aspettato una riga di log del tipo "RequestQueue.setProxyConfig ", invece con un logcat non viene fuori nulla. Questo mi fa pensare che:
- il cambio di rete non viene notificato e quindi il setProxyConfig non viene invocato oppure
- il check "if (info != null && info.getType() == ConnectivityManager.TYPE_WIFI)" produce esito positivo e quindi il proxy viene settato a null (nessun proxy).

Sempre spulciando in rete e sul codice, mi è sembrato di capire che alcuni settaggi sono stati spostati dalla tabella 'system' su cui abbiamo costruito la guida, alla tabella 'secure'. Io ho già fatto la prova a caricare anche lì la configurazione del proxy, ma il risultato è stato il medesimo (configurazione ignorata). Magari qualcuno con una rom diversa può ripetere la prova per capire se ci sono differenze.

ciao,
H.


Top
 Profile  
 
 Post subject: Re: Browsing attraverso proxy impostando user&passwd
PostPosted: Thu Apr 08, 2010 5:23 pm 
Offline
User avatar

Joined: Mon Jan 11, 2010 3:35 pm
Posts: 56
Cellulare Android: HTC Hero
Operatore: TIM
Punti Android: 67
Adesso da una workstation Linux, con le mie credenziali navigo tranquillamente,
Il problema e' sul pc (pare certificati scaduti)

Per il momento tralasciamo il codice.

L'ultimo suggeriemnto, se ho capito, e' provare ad impostare non nella tabella system ma nella tabella secure (che ho visto avere) la configurazione http_proxy='127.0.0.1:5865'
Corretto? Magari scegliendo un numero libero come id?

Aggirnamento 08.04.2010
Ho provato a cancellare http_proxy da system e metterlo in secure.
Calma piatta. Non c'e' un alito di vento. Non si naviga. :a15: :a3:

Aggiornament 09:04:2010
Questa mattina si e' alzato il vento con grande sorpresa navigo (in ufficio ancora no).
.
Sara' stato il reboot? Sara' l'inserimento della voce http_proxy in secure?, la risoluzione di alcuni problemi di rete?
:a6: :a6: :a6: :a6: :a6: :a6: :a6: :a6: :a6: :a6: :a6:
Durera', non durera' chi sa.........

PS x Verix
Il market non va. Gli altri non li ho provati


Last edited by Verix on Wed Apr 14, 2010 5:01 pm, edited 1 time in total.
Log con indirizzi IP privati rimosso


Top
 Profile  
 
 Post subject: Re: Browsing attraverso proxy impostando user&passwd
PostPosted: Fri Apr 09, 2010 9:14 am 
Offline
User avatar

Joined: Fri Nov 20, 2009 5:28 pm
Posts: 46
Cellulare Android: HTC Magic
Punti Android: 54
Bene, l'idea era proprio quella di spostare il settaggio dalla tabella system alla tabella secure.
Io spero in giornata di passare ad openeclair 1.3.0.1 e poi riproverò.

Intanto che navighi, potresti fare la solita verifica con tcpdump?
Scusa se te lo chiedo ogni volta, ma in questo modo riusciamo a verificare se i pacchetti vanno verso il proxy (e quindi navighi perchè la configurazione ha funzionato e viene presa in considerazione) oppure se vanno direttamente verso il sito richiesto (e quindi dipende dai lavori sulla rete che stanno facendo da voi).

Grazie molte! ;)


Top
 Profile  
 
 Post subject: Re: Browsing attraverso proxy impostando user&passwd
PostPosted: Fri Apr 09, 2010 11:06 am 
Offline
User avatar

Joined: Fri Nov 20, 2009 5:28 pm
Posts: 46
Cellulare Android: HTC Magic
Punti Android: 54
Da quello che vedo quando navighi viene sempre contattato il server X.X.X.X sulla porta 8080; se questo è il tuo proxy, direi che la configurazione ha funzionato! :tleft:

Sulla cosa dell'init.d non ti so rispondere al volo. Se non ricordo male in una linux bisogna preparare uno script shell che poi lancia quel che ti serve.


Last edited by Verix on Wed Apr 14, 2010 5:01 pm, edited 1 time in total.
VERIX: indirizzo IP rimosso


Top
 Profile  
 
 Post subject: Re: Browsing attraverso proxy impostando user&passwd
PostPosted: Fri Apr 09, 2010 3:49 pm 
Offline
User avatar

Joined: Fri Nov 20, 2009 5:28 pm
Posts: 46
Cellulare Android: HTC Magic
Punti Android: 54
ciao arkkimede, se il tutto continua a funzionarti, posteresti l'intero contenuto delle tabelle system e secure?

Magari dal confronto viene fuori qlc di utile...


Top
 Profile  
 
 Post subject: Re: Browsing attraverso proxy impostando user&passwd
PostPosted: Sun Apr 11, 2010 4:03 pm 
Offline
User avatar

Joined: Mon Jan 11, 2010 3:35 pm
Posts: 56
Cellulare Android: HTC Hero
Operatore: TIM
Punti Android: 67
Hornet, hai ricevuto i due PM?


Top
 Profile  
 
 Post subject: Re: Browsing attraverso proxy impostando user&passwd
PostPosted: Mon Apr 12, 2010 12:04 pm 
Offline
User avatar

Joined: Fri Nov 20, 2009 5:28 pm
Posts: 46
Cellulare Android: HTC Magic
Punti Android: 54
Ricevuto (adesso ti rispondo anche per il contatto).

Ho fatto un rapido confronto, e nel tuo caso ci sono molte più voci. Ho provato ad inserire quelle che mi sembrano più evidentemente relative a network/wifi/browser...
Purtroppo il risultato è lo stesso.

:bang:


Top
 Profile  
 
 Post subject: Re: Browsing attraverso proxy impostando user&passwd
PostPosted: Mon Apr 12, 2010 6:04 pm 
Offline
User avatar

Joined: Fri Nov 20, 2009 5:28 pm
Posts: 46
Cellulare Android: HTC Magic
Punti Android: 54
Pare che qualcosa si stia muovendo su cyanogen, guardate qui:

http://github.com/cyanogen/android_fram ... Queue.java

Se confrontate la sezione di codice che avevo postato prima con questa modificata, dovreste già notare qualche differenza:

Code:
/**
* Enables data state and proxy tracking
*/
    public synchronized void enablePlatformNotifications() {
        if (HttpLog.LOGV) HttpLog.v("RequestQueue.enablePlatformNotifications() network");

        if (mProxyChangeReceiver == null) {
            mProxyChangeReceiver =
                    new BroadcastReceiver() {
                        @Override
                        public void onReceive(Context ctx, Intent intent) {
                            setProxyConfig();
                        }
                    };
            mContext.registerReceiver(mProxyChangeReceiver,
                                      new IntentFilter(Proxy.PROXY_CHANGE_ACTION));
        }
        setProxyConfig();
    }
...
/**
* Because our IntentReceiver can run within a different thread,
* synchronize setting the proxy
*/
    private synchronized void setProxyConfig() {
        NetworkInfo info = mConnectivityManager.getActiveNetworkInfo();
        String host = Proxy.getHost(mContext);
        if (HttpLog.LOGV) HttpLog.v("RequestQueue.setProxyConfig " + host);
        if (host == null) {
            mProxyHost = null;
        } else {
            mActivePool.disablePersistence();
            mProxyHost = new HttpHost(host, Proxy.getPort(mContext), "http");
        }
    }


Adesso il metodo enablePlatformNotifications() si chiude sempre con un "setProxyConfig();". Anche il metodo setProxyConfig() è stato sfoltito da un if...
Speriamo bene.


Top
 Profile  
 
 Post subject: Re: Browsing attraverso proxy impostando user&passwd
PostPosted: Wed Apr 14, 2010 4:58 pm 
Offline
Moderatore
User avatar

Joined: Thu Dec 27, 2007 3:51 pm
Posts: 986
Cellulare Android: HTC Dream
Operatore: TIM
Punti Android: 1320
Ciao Hornet, grazie per la segnalazione; ti confermo che sul GIT della CyanogemMod è stata inserita la patch per il proxy.
Trovi qualche info in piu' anche in un post recente sul bug-tracker ufficiale, che riporto di seguito: ***URLs are hidden from guests, please register and login to view the hyperlink***

Quote:
There's a patch which restores proxy support to open-source apps (Browser, etc.) in
Eclair, and this patch got merged into Eclair Cyanogenmod (Droid and N1) a few days
ago and seems to work okay. Google Apps (Gmail, Chat, etc.) still don't use a proxy
and they're closed-source so adding that functionality is up to Google.

HTC Sense phones with 2.1 (Desire, etc.) also appear to have either integrated a
similar patch at some point in their development process or never changed from the
old Android 1.6/Donut proxy settings model, but didn't expose proxy settings in the
UI - by accessing the Proxy Settings activity manually on these devices and setting a
proxy you can get proxy support in the browser (still not in Google apps though).

No word on if/when it'll reach AOSP trunk or an official release though - only Google
know what'll be in each release, and it doesn't look like it's even been submitted
for AOSP code review.

In addition only Google know if this has been fixed internally in the next version of
Android (Froyo) - we'll just have to see as more details and the release of Froyo
occurs.

***URLs are hidden from guests, please register and login to view the hyperlink***
4195b3b5d3036 was the relevant diff in Cyanogenmod (along with a little patch to
expose the Proxy Settings in the UI).


Quello che c'è scritto è coerente anche con il fatto che Arkimede, che ha un HTC Hero, riesce ad impostare il proxy correttamente...
Ecco quello che provero' a fare io (appena ho tempo): prendere framework.jar da una ROM il piu' possibile basata su Android AOSP 2.1, magari proprio una cyanogen per Nexus One e provare ad inserirlo nella mia ROM attuale (che è una SuperEclaier). Credo che possa funzionare (ho gia' fatto in passato una patch per framework.jar per abilitare l'autenticazione PAP sull'APN).
Se non funziona, nei prossimi giorni posso anche provare a ricompilare a partire dal sorgente....

A presto!


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 47 posts ]  Go to page Previous  1, 2, 3, 4, 5  Next

Topic Tags

NTLM, ntlmaps, proxy


All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
SitemapIndex SitemapIndex RSS Feed RSS Feed Channel list Channel list
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
phpBB SEO

All trademarks and logos used in this site are of properties of their respective owners.