Exploit databaseDownload repository ZIP
GH-9bef12607fbc6142c2d2e0da5832840c
nanopathi/framework_base_aosp10_r33_cve-2021-0339
Sources for CVE-2021-0339
1 sourcePreferred order: Exploit-DB, Metasploit, then GitHub repositories by stars.
Repository files52
nanopathi/framework_base_aosp10_r33_cve-2021-0339Revision 14c4f070663c
- ↑..Parent directory
- tests/
- AaptAssets.cpp
- AaptAssets.h
- AaptConfig.cpp
- AaptConfig.h
- AaptUtil.cpp
- AaptUtil.h
- AaptXml.cpp
- AaptXml.h
- Android.bp
- ApkBuilder.cpp
- ApkBuilder.h
- Bundle.h
- CacheUpdater.h
- Command.cpp
- ConfigDescription.h
- CrunchCache.cpp
- CrunchCache.h
- DirectoryWalker.h
- FileFinder.cpp
- FileFinder.h
- Images.cpp
- Images.h
- IndentPrinter.h
- Main.cpp
- Main.h
- NOTICE
- OutputSet.h
- Package.cpp
- Resource.cpp
- ResourceFilter.cpp
- ResourceFilter.h
- ResourceIdCache.cpp
- ResourceIdCache.h
- ResourceTable.cpp
- ResourceTable.h
- SdkConstants.h
- SourcePos.cpp
- SourcePos.h
- StringPool.cpp
- StringPool.h
- Symbol.h
- WorkQueue.cpp
- WorkQueue.h
- XMLNode.cpp
- XMLNode.h
- ZipEntry.cpp
- ZipEntry.h
- ZipFile.cpp
- ZipFile.h
Files from this repository share one source choice. Supporting files may cover other vulnerabilities.
tools/aapt/DirectoryWalker.h
Text · 2,533 bytes//
// Copyright 2011 The Android Open Source Project
//
// Defines an abstraction for opening a directory on the filesystem and
// iterating through it.
#ifndef DIRECTORYWALKER_H
#define DIRECTORYWALKER_H
#include <dirent.h>
#include <sys/types.h>
#include <sys/param.h>
#include <sys/stat.h>
#include <unistd.h>
#include <utils/String8.h>
#include <stdio.h>
using namespace android;
// Directory Walker
// This is an abstraction for walking through a directory and getting files
// and descriptions.
class DirectoryWalker {
public:
virtual ~DirectoryWalker() {};
virtual bool openDir(String8 path) = 0;
virtual bool openDir(const char* path) = 0;
// Advance to next directory entry
virtual struct dirent* nextEntry() = 0;
// Get the stats for the current entry
virtual struct stat* entryStats() = 0;
// Clean Up
virtual void closeDir() = 0;
// This class is able to replicate itself on the heap
virtual DirectoryWalker* clone() = 0;
// DATA MEMBERS
// Current directory entry
struct dirent mEntry;
// Stats for that directory entry
struct stat mStats;
// Base path
String8 mBasePath;
};
// System Directory Walker
// This is an implementation of the above abstraction that calls
// real system calls and is fully functional.
// functions are inlined since they're very short and simple
class SystemDirectoryWalker : public DirectoryWalker {
// Default constructor, copy constructor, and destructor are fine
public:
virtual bool openDir(String8 path) {
mBasePath = path;
dir = NULL;
dir = opendir(mBasePath.string() );
if (dir == NULL)
return false;
return true;
};
virtual bool openDir(const char* path) {
String8 p(path);
openDir(p);
return true;
};
// Advance to next directory entry
virtual struct dirent* nextEntry() {
struct dirent* entryPtr = readdir(dir);
if (entryPtr == NULL)
return NULL;
mEntry = *entryPtr;
// Get stats
String8 fullPath = mBasePath.appendPathCopy(mEntry.d_name);
stat(fullPath.string(),&mStats);
return &mEntry;
};
// Get the stats for the current entry
virtual struct stat* entryStats() {
return &mStats;
};
virtual void closeDir() {
closedir(dir);
};
virtual DirectoryWalker* clone() {
return new SystemDirectoryWalker(*this);
};
private:
DIR* dir;
};
#endif // DIRECTORYWALKER_H