IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

Java ME Discussion :

décompiler le jsr179


Sujet :

Java ME

Vue hybride

Message précédent Message précédent   Message suivant Message suivant
  1. #1
    Futur Membre du Club
    Inscrit en
    Janvier 2006
    Messages
    4
    Détails du profil
    Informations forums :
    Inscription : Janvier 2006
    Messages : 4
    Par défaut décompiler le jsr179
    Bonjour à tous,
    Je suis un nouveau en programmation J2ME et je suis face à un problème.
    Je dois capturer le cell Id dans les gsm mais je ne trouve pas les api nécessaires. Alors j'ai décidé de décompiler le JSR179 (capable de le faire mais pour les gsm sophistiqués).
    Mon problème maintenant est qu'un des fichiers décompilés représente des instructions comme goto, break Label que mon compilateur ne peut pas compiler.

    Alors j'ai besoin d'aide si quelqu'un peut m'aider!!!!

    voici le code:
    import java.util.Vector;

    // Referenced classes of package com.sun.kvem.location:
    // PortingLayer

    public abstract class LocationProviderImpl extends LocationProvider
    implements Runnable
    {

    public LocationProviderImpl()
    {
    }

    public abstract boolean matchesCriteria(Criteria criteria1);

    public abstract int getDefaultInterval();

    public abstract int getDefaultMaxAge();

    public abstract int getDefaultTimeout();

    abstract String getName();

    public static Location getLastKnownLocation()
    {
    PortingLayer.getInstance().checkForPermission(36);
    return getLastKnownLocationImpl();
    }

    static Location getLastKnownLocationImpl()
    {
    return LastKnownLocation;
    }

    protected static void setLastKnownLocation(Location newLoc)
    {
    if(newLoc != null)
    LastKnownLocation = newLoc;
    }

    public Location getLocation(int timeout)
    throws LocationException, InterruptedException
    {
    PortingLayer.getInstance().checkForPermission(36);
    Location loc = getLocationImpl(timeout);
    setLastKnownLocation(loc);
    return loc;
    }

    protected abstract Location getLocationImpl(int i)
    throws LocationException, InterruptedException;

    public static LocationProvider getInstance(Criteria criteria)
    throws LocationException
    {
    int oos = 0;
    LocationProviderImpl found[] = new LocationProviderImpl[3];
    if(criteria == null)
    criteria = new Criteria();
    LocationProviderImpl providers[] = PortingLayer.getInstance().getProviders();
    for(int i = 0; i < providers.length; i++)
    {
    LocationProviderImpl provider = providers[i];
    if(provider.matchesCriteria(criteria))
    found[provider.getState() - 1] = provider;
    if(provider.getState() == 3)
    oos++;
    }

    if(oos == providers.length)
    throw new LocationException("All providers are out of service");
    Instance = null;
    if(found[0] != null)
    Instance = found[0];
    else
    if(found[1] != null)
    Instance = found[1];
    return Instance;
    }

    public LocationListener getLocationListener()
    {
    return locationListener;
    }

    public void setLocationListener(LocationListener listener, int interval, int timeout, int maxAge)
    {
    PortingLayer.getInstance().checkForPermission(36);
    PortingLayer.getInstance().registerLocationListener(listener, this);
    if(listener == null)
    {
    locationListener = null;
    return;
    }
    if(interval < -1 || interval != -1 && (timeout > interval || maxAge > interval || timeout < 1 && timeout != -1 || maxAge < 1 && maxAge != -1))
    throw new IllegalArgumentException();
    if(interval == 0)
    {
    locationListener = listener;
    return;
    }
    if(interval == -1)
    {
    interval = getDefaultInterval();
    maxAge = getDefaultMaxAge();
    timeout = getDefaultTimeout();
    }
    if(maxAge == -1)
    maxAge = getDefaultMaxAge();
    if(timeout == -1)
    timeout = getDefaultTimeout();
    locationListener = listener;
    this.interval = interval;
    this.timeout = timeout;
    this.maxAge = maxAge;
    initial = true;
    synchronized(this)
    {
    notify();
    }
    }

    public void run()
    {
    _L2:{
    long clock;
    long time;
    try
    {
    label0:{
    clock = interval * 1000;
    if(locationListener == null || interval == 0)
    break MISSING_BLOCK_LABEL_176;
    if(clock <= 0L)
    break MISSING_BLOCK_LABEL_74;
    synchronized(this)
    {
    initialLocationNotification();
    wait(clock);
    if(locationListener != null && interval != 0)
    break label0;
    }
    continue; /* Loop/switch isn't completed */
    }
    }
    catch(LocationException le)
    {
    continue; /* Loop/switch isn't completed */
    }
    catch(Exception e)
    {
    e.printStackTrace();
    }
    continue; /* Loop/switch isn't completed */
    LocationProviderImpl locationproviderimpl ;
    JVM INSTR monitorexit ;
    break MISSING_BLOCK_LABEL_74;
    locationproviderimpl;
    JVM INSTR monitorexit ;
    break MISSING_BLOCK_LABEL_74;
    exception;
    throw exception;
    time = System.currentTimeMillis();
    if(currentLocation != null)
    {
    if(System.currentTimeMillis() - currentLocation.getTimestamp() > (long)(maxAge * 1000))
    currentLocation = getLocation(timeout);
    } else
    {
    currentLocation = getLocation(timeout);
    }
    LastKnownLocation = currentLocation;
    locationListener.locationUpdated(this, currentLocation);
    clock = (long)(interval * 1000) - (System.currentTimeMillis() - time);
    continue; /* Loop/switch isn't completed */
    synchronized(this)
    {
    wait();
    }
    initialLocationNotification();
    continue; /* Loop/switch isn't completed */
    if(true){
    goto _L2;
    }
    else{
    goto _L1;
    }
    }
    _L1:{}
    }

    private void initialLocationNotification()
    throws LocationException, InterruptedException
    {
    if(initial)
    {
    currentLocation = getLocation(timeout);
    LastKnownLocation = currentLocation;
    locationListener.locationUpdated(this, currentLocation);
    initial = false;
    }
    }

    private static Vector proximityListeners = new Vector();
    private static Location LastKnownLocation;
    private static LocationProviderImpl Instance;
    protected LocationListener locationListener;
    private int interval;
    private int timeout;
    private int maxAge;
    private Location currentLocation;
    protected Criteria criteria;
    protected Thread locationThread;
    private boolean initial;

    }

    j'utilise eclipse 3.1, wtk22 , j2sdk1.4.2_12 et DJDec39 comme décompilateur
    à +
    Miora

  2. #2
    Expert confirmé
    Avatar de le y@m's
    Homme Profil pro
    Ingénieur développement logiciels
    Inscrit en
    Février 2005
    Messages
    2 636
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 42
    Localisation : France, Alpes Maritimes (Provence Alpes Côte d'Azur)

    Informations professionnelles :
    Activité : Ingénieur développement logiciels
    Secteur : High Tech - Produits et services télécom et Internet

    Informations forums :
    Inscription : Février 2005
    Messages : 2 636
    Par défaut
    Avant toute chose, lisez les règles du forum
    • Message illisible
    • Pose une question précise (les "ça marche pas, aidez moi !!!" ça n'avance à rien)
    Je ne répondrai à aucune question technique par MP.

    Pensez aux Tutoriels et aux FAQs avant de poster ;) (pour le java il y a aussi JavaSearch), n'oubliez pas non plus la fonction Rechercher.
    Enfin, quand une solution a été trouvée à votre problème
    pensez au tag :resolu:

    Cours Dvp : http://ydisanto.developpez.com
    Blog : http://yann-disanto.blogspot.com/
    Page perso : http://yann-disanto.fr

  3. #3
    Futur Membre du Club
    Inscrit en
    Janvier 2006
    Messages
    4
    Détails du profil
    Informations forums :
    Inscription : Janvier 2006
    Messages : 4
    Par défaut décompiler le jsr179
    d'accord, ma question est:
    peut-on modifier les instructions "goto" et les labels "break label"?
    quelle décompilateur faut-il utiliser pour qu'on aurait plus ces genres d'instructions?
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
    104
    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    118
    119
    120
    121
    122
    123
    124
    125
    126
    127
    128
    129
    130
    131
    132
    133
    134
    135
    136
    137
    138
    139
    140
    141
    142
    143
    144
    145
    146
    147
    148
    149
    150
    151
    152
    153
    154
    155
    156
    157
    158
    159
    160
    161
    162
    163
    164
    165
    166
    167
    168
    169
    170
    171
    172
    173
    174
    175
    176
    177
    178
    179
    180
    181
    182
    183
    184
    185
    186
    187
    188
    189
    190
    191
    192
    193
    194
    195
    196
    197
    198
    199
    200
    201
    202
    203
    204
    205
    206
    207
    208
    209
    210
    211
    212
    213
    214
    215
    216
    217
    218
     
     
    import java.util.Vector;
     
    // Referenced classes of package com.sun.kvem.location:
    //            PortingLayer
     
    public abstract class LocationProviderImpl extends LocationProvider
        implements Runnable
    {
     
        public LocationProviderImpl()
        {
        }
     
        public abstract boolean matchesCriteria(Criteria criteria1);
     
        public abstract int getDefaultInterval();
     
        public abstract int getDefaultMaxAge();
     
        public abstract int getDefaultTimeout();
     
        abstract String getName();
     
        public static Location getLastKnownLocation()
        {
            PortingLayer.getInstance().checkForPermission(36);
            return getLastKnownLocationImpl();
        }
     
        static Location getLastKnownLocationImpl()
        {
            return LastKnownLocation;
        }
     
        protected static void setLastKnownLocation(Location newLoc)
        {
            if(newLoc != null)
                LastKnownLocation = newLoc;
        }
     
        public Location getLocation(int timeout)
            throws LocationException, InterruptedException
        {
            PortingLayer.getInstance().checkForPermission(36);
            Location loc = getLocationImpl(timeout);
            setLastKnownLocation(loc);
            return loc;
        }
     
        protected abstract Location getLocationImpl(int i)
            throws LocationException, InterruptedException;
     
        public static LocationProvider getInstance(Criteria criteria)
            throws LocationException
        {
            int oos = 0;
            LocationProviderImpl found[] = new LocationProviderImpl[3];
            if(criteria == null)
                criteria = new Criteria();
            LocationProviderImpl providers[] = PortingLayer.getInstance().getProviders();
            for(int i = 0; i < providers.length; i++)
            {
                LocationProviderImpl provider = providers[i];
                if(provider.matchesCriteria(criteria))
                    found[provider.getState() - 1] = provider;
                if(provider.getState() == 3)
                    oos++;
            }
     
            if(oos == providers.length)
                throw new LocationException("All providers are out of service");
            Instance = null;
            if(found[0] != null)
                Instance = found[0];
            else
            if(found[1] != null)
                Instance = found[1];
            return Instance;
        }
     
        public LocationListener getLocationListener()
        {
            return locationListener;
        }
     
        public void setLocationListener(LocationListener listener, int interval, int timeout, int maxAge)
        {
            PortingLayer.getInstance().checkForPermission(36);
            PortingLayer.getInstance().registerLocationListener(listener, this);
            if(listener == null)
            {
                locationListener = null;
                return;
            }
            if(interval < -1 || interval != -1 && (timeout > interval || maxAge > interval || timeout < 1 && timeout != -1 || maxAge < 1 && maxAge != -1))
                throw new IllegalArgumentException();
            if(interval == 0)
            {
                locationListener = listener;
                return;
            }
            if(interval == -1)
            {
                interval = getDefaultInterval();
                maxAge = getDefaultMaxAge();
                timeout = getDefaultTimeout();
            }
            if(maxAge == -1)
                maxAge = getDefaultMaxAge();
            if(timeout == -1)
                timeout = getDefaultTimeout();
            locationListener = listener;
            this.interval = interval;
            this.timeout = timeout;
            this.maxAge = maxAge;
            initial = true;
            synchronized(this)
            {
                notify();
            }
        }
     
        public void run()
        {
        	_L2:{
    	        long clock;
    	        long time;
    	        try
    	        {
    	        	label0:{
    	                clock = interval * 1000;
    	                if(locationListener == null || interval == 0)
    	                    break MISSING_BLOCK_LABEL_176;
    	                if(clock <= 0L)
    	                    break MISSING_BLOCK_LABEL_74;
    	                synchronized(this)
    	                {
    	                    initialLocationNotification();
    	                    wait(clock);
    	                    if(locationListener != null && interval != 0)
    	                        break label0;
    	                }
    	                continue; /* Loop/switch isn't completed */
    	            }
    	        }
    	        catch(LocationException le)
    	        {
    	            continue; /* Loop/switch isn't completed */
    	        }
    	        catch(Exception e)
    	        {
    	            e.printStackTrace();
    	        }
    	        continue; /* Loop/switch isn't completed */
    	        locationproviderimpl ;
    	        JVM INSTR monitorexit ;
    	        break MISSING_BLOCK_LABEL_74;
    	        locationproviderimpl;
    	        JVM INSTR monitorexit ;
    	        break MISSING_BLOCK_LABEL_74;
    	        exception;
    	        throw exception;
    	        time = System.currentTimeMillis();
    	        if(currentLocation != null)
    	        {
    	            if(System.currentTimeMillis() - currentLocation.getTimestamp() > (long)(maxAge * 1000))
    	                currentLocation = getLocation(timeout);
    	        } else
    	        {
    	            currentLocation = getLocation(timeout);
    	        }
    	        LastKnownLocation = currentLocation;
    	        locationListener.locationUpdated(this, currentLocation);
    	        clock = (long)(interval * 1000) - (System.currentTimeMillis() - time);
    	        continue; /* Loop/switch isn't completed */
    	        synchronized(this)
    	        {
    	            wait();
    	        }
    	        initialLocationNotification();
    	        continue; /* Loop/switch isn't completed */
    	        if(true){
    		        goto _L2;
    	        }
    	        else{
    	        	goto _L1;
    	        }
            }
        	_L1:{}
        }
     
        private void initialLocationNotification()
            throws LocationException, InterruptedException
        {
            if(initial)
            {
                currentLocation = getLocation(timeout);
                LastKnownLocation = currentLocation;
                locationListener.locationUpdated(this, currentLocation);
                initial = false;
            }
        }
     
        private static Vector proximityListeners = new Vector();
        private static Location LastKnownLocation;
        private static LocationProviderImpl Instance;
        protected LocationListener locationListener;
        private int interval;
        private int timeout;
        private int maxAge;
        private Location currentLocation;
        protected Criteria criteria;
        protected Thread locationThread;
        private boolean initial;
     
    }

  4. #4
    Membre éprouvé
    Profil pro
    Inscrit en
    Juillet 2006
    Messages
    137
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Juillet 2006
    Messages : 137
    Par défaut
    Je ne vois pas l'interêt de décompiler le JSR 179.
    Tu auras juste l'emballage, il va te manquer l'essentiel: les classes et/ou méthodes qui implémentent la fonctionnalité que tu souhaites sur ton téléphone. (cf les méthodes abstraites dans le code que tu présentes).

  5. #5
    Futur Membre du Club
    Inscrit en
    Janvier 2006
    Messages
    4
    Détails du profil
    Informations forums :
    Inscription : Janvier 2006
    Messages : 4
    Par défaut décompiler le jsr179
    Quelle est alors d'après toi la solution pour récupérer le cellid?
    pour moi, si placelab a pu le faire alors il y a une solution mais reste à savoir laquelle? et je pense qu'ils ont passé par là.
    En fait, j'ai pu décompiler le fichier d'en haut, j'avais pris celui du placelab et les comparé après. j'ai utilisé décafe et cavaj pour ça.
    A +;

  6. #6
    Membre éprouvé
    Profil pro
    Inscrit en
    Juillet 2006
    Messages
    137
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Juillet 2006
    Messages : 137
    Par défaut
    Si ton tel n'est pas compatible JSR 179, tu es sans doute coincé
    Je ne sais pas si cette liste est à jour, mais tu peux toujours jetter un oeil là http://j2mepolish.org/devices/devices-locationapi.html

    Si tu as tel symbian ou windows, peut être que tu peux essayer avec un programme C++ ou C#

Discussions similaires

  1. Décompiler une dll
    Par matmuth dans le forum C++Builder
    Réponses: 4
    Dernier message: 12/09/2005, 17h39
  2. A propos de la décompilation ..
    Par elf dans le forum Général Java
    Réponses: 2
    Dernier message: 16/07/2005, 14h30
  3. Réponses: 11
    Dernier message: 08/07/2005, 17h18
  4. décompilation et delphi
    Par trakiss dans le forum API, COM et SDKs
    Réponses: 7
    Dernier message: 16/06/2004, 10h36

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo