Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6868801
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T03:28:44+00:00 2026-05-27T03:28:44+00:00

I know the method ApplicationDescriptor.currentApplicationDescriptor(); But I aim to download another JAD and compare

  • 0

I know the method

ApplicationDescriptor.currentApplicationDescriptor();

But I aim to download another JAD and compare it’s version number to the current applications version. What is the best/easiest way to do this? Is there a way to construct an ApplicationDescriptor from a simple String?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T03:28:45+00:00Added an answer on May 27, 2026 at 3:28 am

    Get the version from the current Apps JAD:

    String currentVersion = ApplicationDescriptor.currentApplicationDescriptor().getVersion();
    

    Get the version from a downloaded JAD as String:

    public static String getJADProperty(String jadString, String propKey) {
        int indexFrom = jadString.indexOf(propKey) + propKey.length();
    
        // Value reaches until line break (Unix vs. Win)
        int indexTo = jadString.indexOf("\r", indexFrom);
        if (indexTo == -1) { indexTo = jadString.indexOf("\n", indexFrom); }
    
        return jadString.substring(indexFrom, indexTo).trim();
    }
    

    Compare the version strings:

    /**
     * Compares two version strings that are in the format 1.1.1
     * 
     * @param current   Version String in the format 1.1.1 (current version of the app)
     * @param remote    Version String in the format 1.1.1 (remote version of the app)
     * 
     * @return true if the remote version is newer
     */
    public static boolean compareVersionStrings(String current, String remote) {
        int lastIndexCurrent = 0;
        int indexCurrent = 0;
    
        int lastIndexRemote = 0;
        int indexRemote = 0;
    
        String currentVersionSubstring = "";
        String remoteVersionSubstring = "";
    
        do {
            lastIndexCurrent = indexCurrent + currentVersionSubstring.length();
            indexCurrent = current.indexOf(".", lastIndexCurrent);
            lastIndexRemote = indexRemote + remoteVersionSubstring.length();
            indexRemote = remote.indexOf(".", lastIndexRemote);
    
            // Needed because there is no "." at the last number of the version string
            if (indexCurrent != -1) {
                currentVersionSubstring = current.substring(lastIndexCurrent, indexCurrent);
            } else {
                currentVersionSubstring = current.substring(lastIndexCurrent);
            }
            if (indexRemote != -1) {
                remoteVersionSubstring = remote.substring(lastIndexRemote, indexRemote);
            } else {
                remoteVersionSubstring = remote.substring(lastIndexRemote);
            }
    
            if (Integer.parseInt(currentVersionSubstring) < Integer.parseInt(remoteVersionSubstring)) {
                return true;
            }
        } while (indexCurrent != -1);
    
        // 1.0 < 1.0.1
        if (indexRemote != -1) {
            return true;
        }
    
        return false;
    }
    

    Any corrections and improvements are appreciated. Feel free to edit and share your experiences with me.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In Ruby, I know that Method#arity will return a value representing the number of
I need to call a method on an object but I do not know
There is probably no way for this but does anyone know a method of
I know the %% method, but it's not working :(. with NSLog NSLog(@%%5B hello
I know getClass() method in java.lang.Object . But In my application, I know all
I'm used to Atlas where the preferred (from what I know) method is to
I know the method below isn't meant to work with any Entity, and its
Does anyone know a method to programmatically close the CD tray on Windows 2000
Do you know any method to optimize this HTML Code to IE6 or 7
I'd like to know which method is recommended on Windows C programming: using malloc

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.