本文介绍了访问在java程序中编译的资源的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

帮助我,我写了一个java程序,并在同一个程序中的一个文件夹(作为一个reseource)中添加了一个aapt.bat文件。我希望使用命令提示符运行aapt.bat。

应用程序在IDE中正常运行但是当我将应用程序编译为.jar文件并运行它时,我从命令提示符获得如下错误。



'文件:'不被识别为内部或外部命令,







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



我想要实现的是运行jar文件cmd中的aapt.bat。

谢谢



我尝试过:



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:

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;
  }

推荐答案


这篇关于访问在java程序中编译的资源的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-23 06:21