How to upload two deobfuscationfiles for one APK using androidpublisher?

223 Views Asked by At

Is it possible to upload "ReTrace mapping file" and "Native debug symbols" simultaneously for a single APK?

We use "androidpublisher_v3" from googleapis npm package ("googleapis": "^70.0.0") in our application and we manage to publish a new APK with one deobfuscation file (mapping.txt OR native-debug-symbols.zip) to the Google Play Console.

Our current flow is:

  1. Initializing Google Play publisher API.
  2. Creating a new edit transaction in Google Play.
  3. Uploading APK
  4. Uploading mapping.txt file
  5. Committing the edit transaction in Google Play.

We have a function for uploading mapping.txt file (which uses Method: edits.deobfuscationfiles.upload):


/**
 * Uploads a deobfuscation file (mapping.txt) for a given package
 * Assumes authorized
 * @param {string} mappingFilePath the path to the file to upload
 * @param {string} packageName unique android package name (com.android.etc)
 * @param apkVersionCode version code of uploaded APK
 * @returns {Promise} deobfuscationFiles A promise that will return result from uploading a deobfuscation file
 *                          { deobfuscationFile: { symbolType: string } }
 */
export async function uploadDeobfuscation(edits: any, mappingFilePath: string, packageName: string, apkVersionCode: number): Promise<void> {
    const requestParameters = {
        deobfuscationFileType: 'proguard',
        packageName: packageName,
        apkVersionCode: apkVersionCode,
        media: {
            body: fs.createReadStream(mappingFilePath),
            mimeType: ''
        }
    };

    try {
        const res = (await edits.deobfuscationfiles.upload(requestParameters)).data;
    } catch (e) {
        throw new Error(tl.loc('CannotUploadDeobfuscationFile', mappingFilePath, e));
    }
}

And also we have almost the same function to upload native-debug-symbols.zip (the only difference is another deobfuscationFileType: nativeCode)

So if we call edits.deobfuscationfiles.upload once to upload one of the deobfuscation files it works fine, but if we want to upload mapping.txt and native-debug-symbols with a single edits transaction, we can only see the last file uploaded to the Google Play Console (App bundle explorer -> Downloads -> Assets) Case 1 Case 2

Is it expected behavior?


Also, I was able to reproduce this with the .Net client library (NuGet package: AndroidPublisher.v3/1.51.0.2239)


0

There are 0 best solutions below