Merge changes I06a74c84,I2cf9d3aa into qt-dev am: e20c7dff81
am: 59168601df
Change-Id: I0a1729f86680f7af2645f821ff3e22f252d485e1
This commit is contained in:
@@ -16,6 +16,7 @@
|
||||
|
||||
#include <sys/stat.h> // umask
|
||||
#include <sys/types.h> // umask
|
||||
|
||||
#include <fstream>
|
||||
#include <memory>
|
||||
#include <ostream>
|
||||
|
||||
@@ -31,15 +31,14 @@
|
||||
#include "androidfw/ResourceUtils.h"
|
||||
#include "androidfw/StringPiece.h"
|
||||
#include "androidfw/Util.h"
|
||||
#include "utils/String16.h"
|
||||
#include "utils/String8.h"
|
||||
|
||||
#include "idmap2/CommandLineOptions.h"
|
||||
#include "idmap2/Idmap.h"
|
||||
#include "idmap2/Result.h"
|
||||
#include "idmap2/SysTrace.h"
|
||||
#include "idmap2/Xml.h"
|
||||
#include "idmap2/ZipFile.h"
|
||||
#include "utils/String16.h"
|
||||
#include "utils/String8.h"
|
||||
|
||||
using android::ApkAssets;
|
||||
using android::ApkAssetsCookie;
|
||||
|
||||
@@ -23,12 +23,11 @@
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#include "Commands.h"
|
||||
#include "idmap2/CommandLineOptions.h"
|
||||
#include "idmap2/Result.h"
|
||||
#include "idmap2/SysTrace.h"
|
||||
|
||||
#include "Commands.h"
|
||||
|
||||
using android::idmap2::CommandLineOptions;
|
||||
using android::idmap2::Result;
|
||||
using android::idmap2::Unit;
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
*/
|
||||
|
||||
#include <dirent.h>
|
||||
|
||||
#include <fstream>
|
||||
#include <memory>
|
||||
#include <ostream>
|
||||
@@ -24,8 +25,8 @@
|
||||
#include <utility>
|
||||
#include <vector>
|
||||
|
||||
#include "Commands.h"
|
||||
#include "android-base/properties.h"
|
||||
|
||||
#include "idmap2/CommandLineOptions.h"
|
||||
#include "idmap2/FileUtils.h"
|
||||
#include "idmap2/Idmap.h"
|
||||
@@ -35,8 +36,6 @@
|
||||
#include "idmap2/Xml.h"
|
||||
#include "idmap2/ZipFile.h"
|
||||
|
||||
#include "Commands.h"
|
||||
|
||||
using android::idmap2::CommandLineOptions;
|
||||
using android::idmap2::Error;
|
||||
using android::idmap2::Idmap;
|
||||
@@ -211,7 +210,9 @@ Result<Unit> Scan(const std::vector<std::string>& args) {
|
||||
|
||||
const auto create_ok = Create(create_args);
|
||||
if (!create_ok) {
|
||||
return Error(create_ok.GetError(), "failed to create idmap");
|
||||
LOG(WARNING) << "failed to create idmap for overlay apk path \"" << overlay.apk_path
|
||||
<< "\": " << create_ok.GetError().GetMessage();
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -14,6 +14,8 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include "idmap2d/Idmap2Service.h"
|
||||
|
||||
#include <sys/stat.h> // umask
|
||||
#include <sys/types.h> // umask
|
||||
#include <unistd.h>
|
||||
@@ -28,15 +30,12 @@
|
||||
#include "android-base/macros.h"
|
||||
#include "android-base/stringprintf.h"
|
||||
#include "binder/IPCThreadState.h"
|
||||
#include "utils/String8.h"
|
||||
|
||||
#include "idmap2/BinaryStreamVisitor.h"
|
||||
#include "idmap2/FileUtils.h"
|
||||
#include "idmap2/Idmap.h"
|
||||
#include "idmap2/Policies.h"
|
||||
#include "idmap2/SysTrace.h"
|
||||
|
||||
#include "idmap2d/Idmap2Service.h"
|
||||
#include "utils/String8.h"
|
||||
|
||||
using android::IPCThreadState;
|
||||
using android::binder::Status;
|
||||
|
||||
@@ -21,13 +21,11 @@
|
||||
#include <binder/ProcessState.h>
|
||||
|
||||
#include <cstdlib> // EXIT_{FAILURE,SUCCESS}
|
||||
|
||||
#include <iostream>
|
||||
#include <sstream>
|
||||
|
||||
#include "android-base/macros.h"
|
||||
|
||||
#include "Idmap2Service.h"
|
||||
#include "android-base/macros.h"
|
||||
|
||||
using android::BinderService;
|
||||
using android::IPCThreadState;
|
||||
|
||||
@@ -52,11 +52,9 @@
|
||||
#include <vector>
|
||||
|
||||
#include "android-base/macros.h"
|
||||
|
||||
#include "androidfw/ApkAssets.h"
|
||||
#include "androidfw/ResourceTypes.h"
|
||||
#include "androidfw/StringPiece.h"
|
||||
|
||||
#include "idmap2/Policies.h"
|
||||
|
||||
namespace android::idmap2 {
|
||||
|
||||
@@ -17,11 +17,10 @@
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#include "Result.h"
|
||||
#include "androidfw/ResourceTypes.h"
|
||||
#include "androidfw/StringPiece.h"
|
||||
|
||||
#include "Result.h"
|
||||
|
||||
#ifndef IDMAP2_INCLUDE_IDMAP2_POLICIES_H_
|
||||
#define IDMAP2_INCLUDE_IDMAP2_POLICIES_H_
|
||||
|
||||
|
||||
@@ -21,7 +21,6 @@
|
||||
#include <memory>
|
||||
|
||||
#include "androidfw/AssetManager2.h"
|
||||
|
||||
#include "idmap2/Idmap.h"
|
||||
|
||||
namespace android {
|
||||
|
||||
@@ -22,7 +22,6 @@
|
||||
#include <string>
|
||||
|
||||
#include "androidfw/AssetManager2.h"
|
||||
|
||||
#include "idmap2/Idmap.h"
|
||||
|
||||
namespace android {
|
||||
|
||||
@@ -21,7 +21,6 @@
|
||||
#include <string>
|
||||
|
||||
#include "androidfw/AssetManager2.h"
|
||||
|
||||
#include "idmap2/Idmap.h"
|
||||
#include "idmap2/Result.h"
|
||||
#include "idmap2/ZipFile.h"
|
||||
|
||||
@@ -14,14 +14,14 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include "idmap2/BinaryStreamVisitor.h"
|
||||
|
||||
#include <algorithm>
|
||||
#include <cstring>
|
||||
#include <string>
|
||||
|
||||
#include "android-base/macros.h"
|
||||
|
||||
#include "idmap2/BinaryStreamVisitor.h"
|
||||
|
||||
namespace android::idmap2 {
|
||||
|
||||
void BinaryStreamVisitor::Write16(uint16_t value) {
|
||||
|
||||
@@ -14,6 +14,8 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include "idmap2/CommandLineOptions.h"
|
||||
|
||||
#include <algorithm>
|
||||
#include <iomanip>
|
||||
#include <iostream>
|
||||
@@ -24,8 +26,6 @@
|
||||
#include <vector>
|
||||
|
||||
#include "android-base/macros.h"
|
||||
|
||||
#include "idmap2/CommandLineOptions.h"
|
||||
#include "idmap2/Result.h"
|
||||
|
||||
namespace android::idmap2 {
|
||||
|
||||
@@ -14,6 +14,8 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include "idmap2/FileUtils.h"
|
||||
|
||||
#include <dirent.h>
|
||||
#include <sys/types.h>
|
||||
#include <unistd.h>
|
||||
@@ -33,8 +35,6 @@
|
||||
#include "android-base/stringprintf.h"
|
||||
#include "private/android_filesystem_config.h"
|
||||
|
||||
#include "idmap2/FileUtils.h"
|
||||
|
||||
namespace android::idmap2::utils {
|
||||
|
||||
std::unique_ptr<std::vector<std::string>> FindFiles(const std::string& root, bool recurse,
|
||||
|
||||
@@ -14,6 +14,8 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include "idmap2/Idmap.h"
|
||||
|
||||
#include <algorithm>
|
||||
#include <iostream>
|
||||
#include <iterator>
|
||||
@@ -28,14 +30,12 @@
|
||||
#include "android-base/macros.h"
|
||||
#include "android-base/stringprintf.h"
|
||||
#include "androidfw/AssetManager2.h"
|
||||
#include "utils/String16.h"
|
||||
#include "utils/String8.h"
|
||||
|
||||
#include "idmap2/Idmap.h"
|
||||
#include "idmap2/ResourceUtils.h"
|
||||
#include "idmap2/Result.h"
|
||||
#include "idmap2/SysTrace.h"
|
||||
#include "idmap2/ZipFile.h"
|
||||
#include "utils/String16.h"
|
||||
#include "utils/String8.h"
|
||||
|
||||
namespace android::idmap2 {
|
||||
|
||||
|
||||
@@ -14,15 +14,15 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include "idmap2/Policies.h"
|
||||
|
||||
#include <iterator>
|
||||
#include <map>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#include "androidfw/ResourceTypes.h"
|
||||
|
||||
#include "idmap2/Idmap.h"
|
||||
#include "idmap2/Policies.h"
|
||||
#include "idmap2/Result.h"
|
||||
|
||||
namespace android::idmap2 {
|
||||
|
||||
@@ -14,13 +14,13 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include "idmap2/PrettyPrintVisitor.h"
|
||||
|
||||
#include <string>
|
||||
|
||||
#include "android-base/macros.h"
|
||||
#include "android-base/stringprintf.h"
|
||||
#include "androidfw/ApkAssets.h"
|
||||
|
||||
#include "idmap2/PrettyPrintVisitor.h"
|
||||
#include "idmap2/ResourceUtils.h"
|
||||
#include "idmap2/Result.h"
|
||||
|
||||
|
||||
@@ -14,14 +14,14 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include "idmap2/RawPrintVisitor.h"
|
||||
|
||||
#include <cstdarg>
|
||||
#include <string>
|
||||
|
||||
#include "android-base/macros.h"
|
||||
#include "android-base/stringprintf.h"
|
||||
#include "androidfw/ApkAssets.h"
|
||||
|
||||
#include "idmap2/RawPrintVisitor.h"
|
||||
#include "idmap2/ResourceUtils.h"
|
||||
#include "idmap2/Result.h"
|
||||
|
||||
|
||||
@@ -14,13 +14,13 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include "idmap2/ResourceUtils.h"
|
||||
|
||||
#include <memory>
|
||||
#include <string>
|
||||
|
||||
#include "androidfw/StringPiece.h"
|
||||
#include "androidfw/Util.h"
|
||||
|
||||
#include "idmap2/ResourceUtils.h"
|
||||
#include "idmap2/Result.h"
|
||||
#include "idmap2/Xml.h"
|
||||
#include "idmap2/ZipFile.h"
|
||||
|
||||
@@ -14,12 +14,12 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include "idmap2/Result.h"
|
||||
|
||||
#include <cstdarg>
|
||||
|
||||
#include "android-base/stringprintf.h"
|
||||
|
||||
#include "idmap2/Result.h"
|
||||
|
||||
namespace android::idmap2 {
|
||||
|
||||
// NOLINTNEXTLINE(cert-dcl50-cpp)
|
||||
|
||||
@@ -14,13 +14,13 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include "idmap2/Xml.h"
|
||||
|
||||
#include <map>
|
||||
#include <memory>
|
||||
#include <string>
|
||||
#include <utility>
|
||||
|
||||
#include "idmap2/Xml.h"
|
||||
|
||||
namespace android::idmap2 {
|
||||
|
||||
std::unique_ptr<const Xml> Xml::Create(const uint8_t* data, size_t size, bool copyData) {
|
||||
|
||||
@@ -14,11 +14,12 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include "idmap2/ZipFile.h"
|
||||
|
||||
#include <memory>
|
||||
#include <string>
|
||||
|
||||
#include "idmap2/Result.h"
|
||||
#include "idmap2/ZipFile.h"
|
||||
|
||||
namespace android::idmap2 {
|
||||
|
||||
|
||||
@@ -19,17 +19,14 @@
|
||||
#include <string>
|
||||
#include <utility>
|
||||
|
||||
#include "gmock/gmock.h"
|
||||
#include "gtest/gtest.h"
|
||||
|
||||
#include "TestHelpers.h"
|
||||
#include "androidfw/ApkAssets.h"
|
||||
#include "androidfw/Idmap.h"
|
||||
|
||||
#include "gmock/gmock.h"
|
||||
#include "gtest/gtest.h"
|
||||
#include "idmap2/BinaryStreamVisitor.h"
|
||||
#include "idmap2/Idmap.h"
|
||||
|
||||
#include "TestHelpers.h"
|
||||
|
||||
using ::testing::NotNull;
|
||||
|
||||
namespace android::idmap2 {
|
||||
|
||||
@@ -25,19 +25,16 @@
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#include "gmock/gmock.h"
|
||||
#include "gtest/gtest.h"
|
||||
|
||||
#include "TestHelpers.h"
|
||||
#include "android-base/file.h"
|
||||
#include "androidfw/ApkAssets.h"
|
||||
#include "androidfw/Idmap.h"
|
||||
#include "androidfw/LoadedArsc.h"
|
||||
|
||||
#include "gmock/gmock.h"
|
||||
#include "gtest/gtest.h"
|
||||
#include "idmap2/CommandLineOptions.h"
|
||||
#include "idmap2/Idmap.h"
|
||||
|
||||
#include "TestHelpers.h"
|
||||
|
||||
namespace android::idmap2 {
|
||||
|
||||
TEST(CommandLineOptionsTests, Flag) {
|
||||
|
||||
@@ -15,19 +15,17 @@
|
||||
*/
|
||||
|
||||
#include <dirent.h>
|
||||
|
||||
#include <set>
|
||||
#include <string>
|
||||
|
||||
#include "gmock/gmock.h"
|
||||
#include "gtest/gtest.h"
|
||||
|
||||
#include "TestHelpers.h"
|
||||
#include "android-base/macros.h"
|
||||
#include "android-base/stringprintf.h"
|
||||
#include "private/android_filesystem_config.h"
|
||||
|
||||
#include "gmock/gmock.h"
|
||||
#include "gtest/gtest.h"
|
||||
#include "idmap2/FileUtils.h"
|
||||
|
||||
#include "TestHelpers.h"
|
||||
#include "private/android_filesystem_config.h"
|
||||
|
||||
using ::testing::NotNull;
|
||||
|
||||
|
||||
@@ -34,16 +34,13 @@
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#include "TestHelpers.h"
|
||||
#include "androidfw/PosixUtils.h"
|
||||
#include "gmock/gmock.h"
|
||||
#include "gtest/gtest.h"
|
||||
|
||||
#include "androidfw/PosixUtils.h"
|
||||
#include "private/android_filesystem_config.h"
|
||||
|
||||
#include "idmap2/FileUtils.h"
|
||||
#include "idmap2/Idmap.h"
|
||||
|
||||
#include "TestHelpers.h"
|
||||
#include "private/android_filesystem_config.h"
|
||||
|
||||
using ::android::util::ExecuteBinary;
|
||||
using ::testing::NotNull;
|
||||
@@ -264,6 +261,24 @@ TEST_F(Idmap2BinaryTests, Scan) {
|
||||
ASSERT_THAT(result, NotNull());
|
||||
ASSERT_EQ(result->status, EXIT_SUCCESS) << result->stderr;
|
||||
ASSERT_EQ(result->stdout, "");
|
||||
|
||||
// the signature idmap failing to generate should not cause scanning to fail
|
||||
// clang-format off
|
||||
result = ExecuteBinary({"idmap2",
|
||||
"scan",
|
||||
"--input-directory", GetTestDataPath(),
|
||||
"--recursive",
|
||||
"--target-package-name", "test.target",
|
||||
"--target-apk-path", GetTargetApkPath(),
|
||||
"--output-directory", GetTempDirPath(),
|
||||
"--override-policy", "public"});
|
||||
// clang-format on
|
||||
ASSERT_THAT(result, NotNull());
|
||||
ASSERT_EQ(result->status, EXIT_SUCCESS) << result->stderr;
|
||||
ASSERT_EQ(result->stdout, expected.str());
|
||||
unlink(idmap_static_no_name_path.c_str());
|
||||
unlink(idmap_static_2_path.c_str());
|
||||
unlink(idmap_static_1_path.c_str());
|
||||
}
|
||||
|
||||
TEST_F(Idmap2BinaryTests, Lookup) {
|
||||
|
||||
@@ -15,7 +15,6 @@
|
||||
*/
|
||||
|
||||
#include <cstdio> // fclose
|
||||
|
||||
#include <fstream>
|
||||
#include <memory>
|
||||
#include <sstream>
|
||||
@@ -23,18 +22,15 @@
|
||||
#include <utility>
|
||||
#include <vector>
|
||||
|
||||
#include "gmock/gmock.h"
|
||||
#include "gtest/gtest.h"
|
||||
|
||||
#include "TestHelpers.h"
|
||||
#include "android-base/macros.h"
|
||||
#include "androidfw/ApkAssets.h"
|
||||
|
||||
#include "gmock/gmock.h"
|
||||
#include "gtest/gtest.h"
|
||||
#include "idmap2/BinaryStreamVisitor.h"
|
||||
#include "idmap2/CommandLineOptions.h"
|
||||
#include "idmap2/Idmap.h"
|
||||
|
||||
#include "TestHelpers.h"
|
||||
|
||||
using ::testing::IsNull;
|
||||
using ::testing::NotNull;
|
||||
|
||||
|
||||
@@ -16,11 +16,9 @@
|
||||
|
||||
#include <string>
|
||||
|
||||
#include "android-base/file.h"
|
||||
|
||||
#include "gtest/gtest.h"
|
||||
|
||||
#include "TestHelpers.h"
|
||||
#include "android-base/file.h"
|
||||
#include "gtest/gtest.h"
|
||||
|
||||
namespace android::idmap2 {
|
||||
|
||||
|
||||
@@ -16,9 +16,8 @@
|
||||
|
||||
#include <string>
|
||||
|
||||
#include "gtest/gtest.h"
|
||||
|
||||
#include "TestHelpers.h"
|
||||
#include "gtest/gtest.h"
|
||||
#include "idmap2/Policies.h"
|
||||
|
||||
using android::idmap2::PolicyBitmask;
|
||||
|
||||
@@ -18,18 +18,15 @@
|
||||
#include <sstream>
|
||||
#include <string>
|
||||
|
||||
#include "gmock/gmock.h"
|
||||
#include "gtest/gtest.h"
|
||||
|
||||
#include "TestHelpers.h"
|
||||
#include "androidfw/ApkAssets.h"
|
||||
#include "androidfw/Idmap.h"
|
||||
|
||||
#include "gmock/gmock.h"
|
||||
#include "gtest/gtest.h"
|
||||
#include "idmap2/Idmap.h"
|
||||
#include "idmap2/Policies.h"
|
||||
#include "idmap2/PrettyPrintVisitor.h"
|
||||
|
||||
#include "TestHelpers.h"
|
||||
|
||||
using ::testing::NotNull;
|
||||
|
||||
using android::ApkAssets;
|
||||
|
||||
@@ -19,14 +19,12 @@
|
||||
#include <sstream>
|
||||
#include <string>
|
||||
|
||||
#include "TestHelpers.h"
|
||||
#include "gmock/gmock.h"
|
||||
#include "gtest/gtest.h"
|
||||
|
||||
#include "idmap2/Idmap.h"
|
||||
#include "idmap2/RawPrintVisitor.h"
|
||||
|
||||
#include "TestHelpers.h"
|
||||
|
||||
using ::testing::NotNull;
|
||||
|
||||
namespace android::idmap2 {
|
||||
|
||||
@@ -17,15 +17,13 @@
|
||||
#include <memory>
|
||||
#include <string>
|
||||
|
||||
#include "TestHelpers.h"
|
||||
#include "androidfw/ApkAssets.h"
|
||||
#include "gmock/gmock.h"
|
||||
#include "gtest/gtest.h"
|
||||
|
||||
#include "androidfw/ApkAssets.h"
|
||||
#include "idmap2/ResourceUtils.h"
|
||||
#include "idmap2/Result.h"
|
||||
|
||||
#include "TestHelpers.h"
|
||||
|
||||
using ::testing::NotNull;
|
||||
|
||||
namespace android::idmap2 {
|
||||
|
||||
@@ -20,7 +20,6 @@
|
||||
|
||||
#include "gmock/gmock.h"
|
||||
#include "gtest/gtest.h"
|
||||
|
||||
#include "idmap2/Result.h"
|
||||
|
||||
namespace android::idmap2 {
|
||||
|
||||
@@ -19,6 +19,9 @@
|
||||
|
||||
#include <string>
|
||||
|
||||
#include "gmock/gmock.h"
|
||||
#include "gtest/gtest.h"
|
||||
|
||||
namespace android::idmap2 {
|
||||
|
||||
const unsigned char idmap_raw_data[] = {
|
||||
|
||||
@@ -16,13 +16,11 @@
|
||||
|
||||
#include <cstdio> // fclose
|
||||
|
||||
#include "idmap2/Xml.h"
|
||||
#include "idmap2/ZipFile.h"
|
||||
|
||||
#include "TestHelpers.h"
|
||||
#include "gmock/gmock.h"
|
||||
#include "gtest/gtest.h"
|
||||
|
||||
#include "TestHelpers.h"
|
||||
#include "idmap2/Xml.h"
|
||||
#include "idmap2/ZipFile.h"
|
||||
|
||||
using ::testing::IsNull;
|
||||
using ::testing::NotNull;
|
||||
|
||||
@@ -17,13 +17,11 @@
|
||||
#include <cstdio> // fclose
|
||||
#include <string>
|
||||
|
||||
#include "idmap2/Result.h"
|
||||
#include "idmap2/ZipFile.h"
|
||||
|
||||
#include "TestHelpers.h"
|
||||
#include "gmock/gmock.h"
|
||||
#include "gtest/gtest.h"
|
||||
|
||||
#include "TestHelpers.h"
|
||||
#include "idmap2/Result.h"
|
||||
#include "idmap2/ZipFile.h"
|
||||
|
||||
using ::testing::IsNull;
|
||||
using ::testing::NotNull;
|
||||
|
||||
@@ -19,5 +19,7 @@
|
||||
<application android:hasCode="false"/>
|
||||
<overlay
|
||||
android:targetPackage="test.target"
|
||||
android:targetName="TestResources"/>
|
||||
android:targetName="TestResources"
|
||||
android:isStatic="true"
|
||||
android:priority="10"/>
|
||||
</manifest>
|
||||
|
||||
Binary file not shown.
Reference in New Issue
Block a user