Click here to Skip to main content
15,890,527 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Help me, l wrote a java program and l added a aapt.bat file in a folder(as a reseource) in the same program. l want the aapt.bat run using command prompt.
The application runs fine from the IDE but when l compiled the application to a .jar file and run it, l get error as below from the command prompt.

'file:' is not recognized as an internal or external command,

and

file:/C:/Users/slab1/Pictures/training/dist/training.jar!/res/aapt.exe list C:\Reversing\Apk\tools\GApp1.6.apk.

What l want to achieve is to run the aapt.bat filed in the jar file cmd.
Thanks

What I have tried:

Java
public boolean decodes(String file)
  {
    Runtime runtime = Runtime.getRuntime();

    System.out.println("Android Path: " + getDexToolPath() + " -f -o " + getWorkPlace() + Base.getSeparator() + getFileName(file) + ".jar " + file);
    try {
      Process process = runtime.exec(getDexToolPath() + " -f -o " + getWorkPlace() + Base.getSeparator() + getFileName(file) + ".jar " + file);

      process.waitFor();
      return true;
    } catch (IOException ex) {
      return false; } catch (InterruptedException ex) {
    }
    return false;
  }
Posted
Updated 28-Sep-18 2:37am

1 solution

You can't. The CMD prompt will only work with the file system. Your application is not part of the file system, so CMD cannot see what's inside the compiled app and use it as if it was.

The only way CMD can get to the batch file and run it is if it is a separate file that shows up in a folder on the drive.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900