l2walker 2015-04-16 20:48 采纳率: 0%
浏览 5299
已结题

求解读JAVA代码,为什么MP4文件不能播放?

下载的一个压缩包(压缩包内含mp4文件、字幕文件等),压缩包有密码,android程序用密码打开压缩文件,并执行一系列操作后,程序自动播放压缩包内的MP4文件,但MP4文件不能直接使用播放器播放,求解答如何能让mp4文件用播放器播放 。。。谢谢 。。。这里是完整代码下载链接:点击下载完整代码,(用JD-GUI直接查看Jar内的代码、0000208821-DF705DD4是去掉了扩展名的压缩文件)

下面是部分代码(代码位于jar文件内的nc.class):

import android.widget.Toast;
import com.is.piano.base.ISApp;
import com.ispiano.crc64.Algorithm;
import java.io.File;
import java.io.PrintStream;
import java.util.List;
import net.lingala.zip4j.core.ZipFile;
import net.lingala.zip4j.exception.ZipException;
import net.lingala.zip4j.model.FileHeader;
import net.lingala.zip4j.model.ZipParameters;

public class nc
{
  public static boolean a(String paramString1, String paramString2)
  {
    long l1 = System.currentTimeMillis();
    ZipFile localZipFile;
    File localFile;
    try
    {
      localZipFile = new ZipFile(paramString1);
      localZipFile.setFileNameCharset("GBK");
      if (localZipFile.isValidZipFile())
        break label101;
      mh.b(paramString1);
      throw new ZipException("\u538B\u7F29\u6587\u4EF6\u4E0D\u5408\u6CD5,\u53EF\u80FD\u88AB\u635F\u574F.");
    }
    catch (ZipException localZipException)
    {
      localZipException.printStackTrace();
      localFile = new File(paramString2);
      if (!localFile.exists())
        break label99;
    }
    File[] arrayOfFile;
    int i;
    if (localFile.isDirectory())
    {
      arrayOfFile = localFile.listFiles();
      i = arrayOfFile.length;
    }
    for (int j = 0; ; j++)
    {
      if (j >= i)
      {
        label99: return false;
        label101: if (localZipFile.isEncrypted())
          localZipFile.setPassword("ISPiano Zhang");
        List localList = localZipFile.getFileHeaders();
        long l2 = 0L;
        for (int k = 0; ; k++)
        {
          if (k >= localList.size())
          {
            if (l2 <= mh.b())
              break;
            return false;
          }
          l2 += ((FileHeader)localList.get(k)).getUncompressedSize();
        }
        localZipFile.extractAll(paramString2);
        mh.b(paramString1);
        System.out.println("\u89E3\u538B\u8017\u65F6\uFF1A" + (System.currentTimeMillis() - l1));
        return true;
      }
      arrayOfFile[j].delete();
    }
  }

  public static boolean a(String paramString1, String paramString2, String paramString3)
  {
    System.out.println("unzipUnfinishFile," + paramString1);
    while (true)
    {
      int i;
      try
      {
        String str1 = mh.c() + "/ispiano/package_cache/" + paramString1;
        ZipFile localZipFile = new ZipFile(str1);
        if (!localZipFile.isValidZipFile())
          return false;
        localZipFile.setPassword("ISPiano Zhang");
        List localList = localZipFile.getFileHeaders();
        Algorithm localAlgorithm = new Algorithm();
        i = 0;
        if (i < localList.size())
          continue;
        eg localeg = new eg();
        localeg.a(Long.parseLong(paramString3.substring(0, 8) + "00"), paramString2);
        localeg.g();
        mh.b(str1);
        new File(mh.c() + "/ispiano/package_cache/" + "dir_" + paramString1).delete();
        return true;
        FileHeader localFileHeader = (FileHeader)localList.get(i);
        String str2 = localFileHeader.getFileName();
        long l = localFileHeader.getUncompressedSize();
        String str3 = localAlgorithm.getFileName(paramString2 + paramString3 + str2);
        File localFile = new File(mh.c() + "/ispiano/video_cache/" + str3);
        mi.c("jing", str3 + "," + str2 + "   " + localFile.length() + "," + l);
        if ((!localFile.exists()) || (localFile.length() != l))
        {
          mh.b(mh.c() + "/ispiano/video_cache/" + str3);
          if (mh.b() >= l)
            continue;
          Toast.makeText(ISApp.a(), 2131230828, 0).show();
          return false;
          mh.a(mh.c() + "/ispiano/package_cache/" + "dir_" + paramString1);
          mh.a(mh.c() + "/ispiano/video_cache/");
          localZipFile.extractFile(str2, mh.c() + "/ispiano/package_cache/" + "dir_" + paramString1);
          new File(mh.c() + "/ispiano/package_cache/" + "dir_" + paramString1 + "/" + str2).renameTo(new File(mh.c() + "/ispiano/video_cache/" + str3));
        }
      }
      catch (ZipException localZipException)
      {
        localZipException.printStackTrace();
        return false;
      }
      i++;
    }
  }

  public static boolean b(String paramString1, String paramString2)
  {
    try
    {
      ZipFile localZipFile = new ZipFile(paramString2);
      ZipParameters localZipParameters = new ZipParameters();
      localZipParameters.setCompressionMethod(8);
      localZipParameters.setCompressionLevel(5);
      localZipFile.addFolder(paramString1, localZipParameters);
      return true;
    }
    catch (ZipException localZipException)
    {
      localZipException.printStackTrace();
    }
    return false;
  }

  public static boolean c(String paramString1, String paramString2)
  {
    try
    {
      new ZipFile(paramString1).extractAll(paramString2);
      return true;
    }
    catch (ZipException localZipException)
    {
      localZipException.printStackTrace();
    }
    return false;
  }
}

展开全部

  • 写回答

3条回答 默认 最新

  • 一一叶 2015-04-17 09:27
    关注

    public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.main);
    /* 创建VideoView对象 /
    final VideoView videoView = (VideoView) findViewById(R.id.VideoView01);
    /
    设置路径 /
    videoView.setVideoPath("/sdcard/test.mp4");
    /
    设置模式-播放进度条 */
    videoView.setMediaController(new MediaController(Activity01.this));
    videoView.requestFocus();
    videoView.start();
    }
    你都没有加载Android内置的视频播放器,系统也不会从你的压缩文件里面加载,这是逻辑问题

    评论
编辑
预览

报告相同问题?

悬赏问题

  • ¥15 宝塔面板一键迁移使用不了
  • ¥15 求一个按键录像存储到内存卡的ESP32CAM代码
  • ¥15 如何单独修改下列canvas推箱子代码target参数?,插入图片代替其形状,就是哪个绿色的圆圈每关用插入的图片替代
  • ¥20 四叉树的创建和输出问题
  • ¥15 javaweb连接数据库,jsp文件加载不出来
  • ¥15 matlab关于高斯赛德尔迭代的应用编撰。(相关搜索:matlab代码|迭代法)
  • ¥15 损失匹配问题,求解答
  • ¥15 3500常用汉字书法体检测数据集下载
  • ¥15 odoo17在制造模块或采购模块良品与次品如何分流和在质检模块下如何开发
  • ¥15 Qt音乐播放器的音乐文件相对路径怎么写