bool CoreRP::addExfat() { const std::string mount("sbin/mount.exfat"); const std::string fsck("sbin/fsck.exfat"); const std::string mountSig("sbin/mount.exfat.sig"); const std::string fsckSig("sbin/fsck.exfat.sig"); std::string mountPath(m_impl->pc->dataDirectory()); mountPath += "/binaries/android/"; mountPath += m_impl->info->device()->architecture(); mountPath += "/mount.exfat"; std::string sigPath(mountPath); sigPath += ".sig"; m_impl->cpio->remove(mount); m_impl->cpio->remove(fsck); m_impl->cpio->remove(mountSig); m_impl->cpio->remove(fsckSig); if (!m_impl->cpio->addFile(mountPath, mount, 0750) || !m_impl->cpio->addFile(sigPath, mountSig, 0640) || !m_impl->cpio->addSymlink("mount.exfat", fsck) || !m_impl->cpio->addSymlink("mount.exfat.sig", fsckSig)) { m_impl->error = m_impl->cpio->error(); return false; } return true; }
bool CoreRP::addMbtool() { const std::string mbtool("mbtool"); const std::string sig("mbtool.sig"); std::string mbtoolPath(m_impl->pc->dataDirectory()); mbtoolPath += "/binaries/android/"; mbtoolPath += m_impl->info->device()->architecture(); mbtoolPath += "/mbtool"; std::string sigPath(mbtoolPath); sigPath += ".sig"; m_impl->cpio->remove(mbtool); m_impl->cpio->remove(sig); if (!m_impl->cpio->addFile(mbtoolPath, mbtool, 0750) || !m_impl->cpio->addFile(sigPath, sig, 0640)) { m_impl->error = m_impl->cpio->error(); return false; } return true; }
bool CoreRP::addFileContextsTool() { const std::string tool("sbin/file-contexts-tool"); const std::string sig("sbin/file-contexts-tool.sig"); std::string toolPath(m_impl->pc->dataDirectory()); toolPath += "/binaries/android/"; toolPath += mb_device_architecture(m_impl->info->device()); toolPath += "/file-contexts-tool"; std::string sigPath(toolPath); sigPath += ".sig"; m_impl->cpio->remove(tool); m_impl->cpio->remove(sig); if (!m_impl->cpio->addFile(toolPath, tool, 0750) || !m_impl->cpio->addFile(sigPath, sig, 0640)) { m_impl->error = m_impl->cpio->error(); return false; } return true; }
bool CoreRP::addFsckWrapper() { const std::string wrapper("sbin/fsck-wrapper"); const std::string sig("sbin/fsck-wrapper.sig"); std::string wrapperPath(m_impl->pc->dataDirectory()); wrapperPath += "/binaries/android/"; wrapperPath += mb_device_architecture(m_impl->info->device()); wrapperPath += "/fsck-wrapper"; std::string sigPath(wrapperPath); sigPath += ".sig"; m_impl->cpio->remove(wrapper); m_impl->cpio->remove(sig); if (!m_impl->cpio->addFile(wrapperPath, wrapper, 0750) || !m_impl->cpio->addFile(sigPath, sig, 0640)) { m_impl->error = m_impl->cpio->error(); return false; } return true; }