MCPcopy Create free account
hub / github.com/TGX-Android/Publisher / uploadHuaweiApk

Function uploadHuaweiApk

main.js:1621–1639  ·  view source on GitHub ↗
(build, targetFiles, accessToken, uploadUrl, authCode)

Source from the content-addressed store, hash-verified

1619}
1620
1621async function uploadHuaweiApk (build, targetFiles, accessToken, uploadUrl, authCode) {
1622 const apkFilePath = targetFiles.apkFile.path;
1623 try {
1624 const apkFileStream = fs.createReadStream(apkFilePath);
1625 const form = new FormData();
1626 form.append('file', apkFileStream);
1627 form.append('authCode', authCode);
1628 form.append('fileCount', '1');
1629 const response = await postHuaweiForm(uploadUrl, form);
1630 if (response.statusCode !== 200) {
1631 console.error('AGC upload failed', response.statusCode, response.statusMessage, response.contentType, response.content);
1632 return null;
1633 }
1634 return JSON.parse(response.content);
1635 } catch (e) {
1636 console.error('Failed to upload huawei APK', e);
1637 return null;
1638 }
1639}
1640
1641async function updateHuaweiAppFileInfo (build, targetFiles, accessToken, fileInfo) {
1642 try {

Callers 1

uploadToHuaweiAppGalleryFunction · 0.85

Calls 1

postHuaweiFormFunction · 0.85

Tested by

no test coverage detected