• 大小: 109KB
    文件类型: .zip
    金币: 1
    下载: 0 次
    发布日期: 2021-06-05
  • 语言: 其他
  • 标签: vdex  

资源简介

安卓8/9合并vdex需要用到的工具,就是通过vdex文件得到dex文件,再打包进apk中

资源截图

代码片段和文件信息

/*

   vdexExtractor
   -----------------------------------------

   Anestis Bechtsoudis 
   Copyright 2017 - 2018 by CENSUS S.A. All Rights Reserved.

   Licensed under the Apache License Version 2.0 (the “License“);
   you may not use this file except in compliance with the License.
   You may obtain a copy of the License at

     http://www.apache.org/licenses/LICENSE-2.0

   Unless required by applicable law or agreed to in writing software
   distributed under the License is distributed on an “AS IS“ BASIS
   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND either express or implied.
   See the License for the specific language governing permissions and
   limitations under the License.

*/

#include “dex.h“
#include “utils.h“

static bool enableDisassembler = false;

static inline u2 get2LE(unsigned char const *pSrc) { return pSrc[0] | (pSrc[1] << 8); }

static inline bool IsLeb128Terminator(const u1 *ptr) { return *ptr <= 0x7f; }

// Returns the number of bytes needed to encode the value in unsigned LEB128.
static inline u4 ULeb128Size(u4 data) {
  // bits_to_encode = (data != 0) ? 32 - CLZ(x) : 1  // 32 - CLZ(data | 1)
  // bytes = ceil(bits_to_encode / 7.0);             // (6 + bits_to_encode) / 7
  u4 x = 6 + 32 - __builtin_clz(data | 1U);

  // Division by 7 is done by (x * 37) >> 8 where 37 = ceil(256 / 7).
  // This works for 0 <= x < 256 / (7 * 37 - 256) i.e. 0 <= x <= 85.
  return (x * 37) >> 8;
}

static inline bool IsPowerOfTwo(u4 x) { return (x & (x - 1)) == 0; }

static inline bool IsFirstBitSet(u4 value) { return !IsPowerOfTwo(value & kAccVisibilityFlags); }

static inline u4 GetSecondFlag(u4 value) {
  return ((value & kAccNative) != 0) ? kAccDexHiddenBitNative : kAccDexHiddenBit;
}

// Helper for dex_dumpInstruction() which builds the string representation
// for the index in the given instruction.
static char *indexString(const u1 *dexFileBuf u2 *codePtr u4 bufSize) {
  char *buf = utils_calloc(bufSize);
  static const u4 kInvalidIndex = USHRT_MAX;

  // Determine index and width of the string.
  u4 index = 0;
  u4 secondary_index = kInvalidIndex;
  u4 width = 4;
  switch (kInstructionDescriptors[dexInstr_getOpcode(codePtr)].format) {
    // SOME NOT SUPPORTED:
    // case k20bc:
    case k21c:
    case k35c:
    // case k35ms:
    case k3rc:
      // case k3rms:
      // case k35mi:
      // case k3rmi:
      index = dexInstr_getVRegB(codePtr);
      width = 4;
      break;
    case k31c:
      index = dexInstr_getVRegB(codePtr);
      width = 8;
      break;
    case k22c:
      // case k22cs:
      index = dexInstr_getVRegC(codePtr);
      width = 4;
      break;
    case k45cc:
    case k4rcc:
      index = dexInstr_getVRegB(codePtr);
      secondary_index = dexInstr_getVRegH(codePtr);
      width = 4;
      break;
    default:
      break;
  }  // switch

  // Determine index type.
  size_t outSize = 0;
  switch (kInstructionDescriptors[dexInstr_getOpcode(codePtr)].index_type) {
    case k

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2019-01-29 23:17  vdexExtractor\
     文件          38  2018-09-14 03:21  vdexExtractor\.gitignore
     文件       11414  2018-09-14 03:21  vdexExtractor\LICENSE
     文件       23843  2018-09-14 03:21  vdexExtractor\README.md
     目录           0  2019-01-29 23:17  vdexExtractor\bin\
     文件          71  2018-09-14 03:21  vdexExtractor\bin\.gitignore
     目录           0  2019-01-29 23:17  vdexExtractor\jni\
     文件        1282  2018-09-14 03:21  vdexExtractor\jni\Android.mk
     文件         810  2018-09-14 03:21  vdexExtractor\jni\Application.mk
     文件        3015  2018-09-14 03:21  vdexExtractor\make.sh
     目录           0  2019-01-29 23:17  vdexExtractor\scripts\
     文件       10305  2018-09-14 03:21  vdexExtractor\scripts\extract-apps-from-device.sh
     文件        2846  2018-09-14 03:21  vdexExtractor\scripts\update-vdex-location-checksums.sh
     目录           0  2019-01-29 23:17  vdexExtractor\src\
     文件        1944  2018-09-14 03:21  vdexExtractor\src\Makefile
     文件        2893  2018-09-14 03:21  vdexExtractor\src\common.h
     文件       48808  2018-09-14 03:21  vdexExtractor\src\dex.c
     文件       12691  2018-09-14 03:21  vdexExtractor\src\dex.h
     文件       22768  2018-09-14 03:21  vdexExtractor\src\dex_instruction.c
     文件        9357  2018-09-14 03:21  vdexExtractor\src\dex_instruction.h
     文件       32468  2018-09-14 03:21  vdexExtractor\src\dex_instruction_list.h
     文件        7837  2018-09-14 03:21  vdexExtractor\src\dex_modifiers.h
     目录           0  2019-01-29 23:17  vdexExtractor\src\hashset\
     文件        3200  2018-09-14 03:21  vdexExtractor\src\hashset\hashset.c
     文件        1701  2018-09-14 03:21  vdexExtractor\src\hashset\hashset.h
     文件        4112  2018-09-14 03:21  vdexExtractor\src\log.c
     文件        1645  2018-09-14 03:21  vdexExtractor\src\log.h
     文件        3847  2018-09-14 03:21  vdexExtractor\src\out_writer.c
     文件        1059  2018-09-14 03:21  vdexExtractor\src\out_writer.h
     文件       10267  2018-09-14 03:21  vdexExtractor\src\utils.c
     文件        1684  2018-09-14 03:21  vdexExtractor\src\utils.h
............此处省略28个文件信息

评论

共有 条评论

相关资源