lib/tools/apk-signing.js
async function patchApksigner (originalPath) {
  const originalContent = await fs.readFile(originalPath, 'ascii');
  const patchedContent = originalContent.replace('-Djava.ext.dirs="%frameworkdir%"',
    '-cp "%frameworkdir%\\*"');
  if (patchedContent === originalContent) {
    return originalPath;
  }
  log.debug(`Patching '${originalPath}...`);
  const patchedPath = await tempDir.path({prefix: 'apksigner', suffix: '.bat'});
  await mkdirp(path.dirname(patchedPath));
  await fs.writeFile(patchedPath, patchedContent, 'ascii');
  return patchedPath;
}
async function patchApksigner (originalPath) {
  const originalContent = await fs.readFile(originalPath, 'ascii');
  const patchedContent = originalContent.replace('-Djava.ext.dirs="%frameworkdir%"',
    '-cp "%frameworkdir%\\*"');
  if (patchedContent === originalContent) {
    return originalPath;
  }
  log.debug(`Patching '${originalPath}...`);
  const patchedPath = await tempDir.path({prefix: 'apksigner', suffix: '.bat'});
  await mkdirp(path.dirname(patchedPath));
  await fs.writeFile(patchedPath, patchedContent, 'ascii');
  return patchedPath;
}
async function patchApksigner ( originalPath ) { const originalContent = await fs . readFile ( originalPath , 'ascii' ) ; const patchedContent = originalContent . replace ( '-Djava.ext.dirs="%frameworkdir%"' , '-cp "%frameworkdir%\\*"' ) ; if ( patchedContent === originalContent ) { return originalPath ; } log . debug ( ` ${ originalPath } ` ) ; const patchedPath = await tempDir . path ( { prefix : 'apksigner' , suffix : '.bat' } ) ; await mkdirp ( path . dirname ( patchedPath ) ) ; await fs . writeFile ( patchedPath , patchedContent , 'ascii' ) ; return patchedPath ; }
Applies the patch, which workarounds'-Djava.ext.dirs is not supported. Use -classpath instead.'
error on Windows by creating a temporary patched copy of the original apksigner script.

@param {string} originalPath - The original path to apksigner tool
@returns {string} The full path to the patched script or the same path if there is
no need to patch the original file.
Applies the patch which workarounds - Djava . ext . dirs is not supported . Use - classpath instead . error on Windows by creating a temporary patched copy of the original apksigner script .