Skip to content
GitLab
  • Menu
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
    • Switch to GitLab Next
  • Sign in / Register
  • fdroidserver fdroidserver
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Locked Files
  • Issues 307
    • Issues 307
    • List
    • Boards
    • Service Desk
    • Milestones
    • Iterations
  • Merge requests 52
    • Merge requests 52
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
    • Test Cases
  • Deployments
    • Deployments
    • Releases
  • Packages & Registries
    • Packages & Registries
    • Container Registry
  • External wiki
    • External wiki
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • F-DroidF-Droid
  • fdroidserverfdroidserver
  • Merge requests
  • !548

Improve how aapt output is parsed in one place

  • Review changes

  • Download
  • Email patches
  • Plain diff
Closed Finn requested to merge thefinn93/fdroidserver:bugfix/parse-aapt-output-better into master Jul 31, 2018
  • Overview 23
  • Commits 1
  • Pipelines 1
  • Changes 1

While trying to build a newer version of Linphone on my own build infrastructure, I ran into this error:

...
INFO: Successfully built version 4.0.1 of org.linphone
ERROR: Could not build app org.linphone: Wrong package ID - build 9 but expected org.linphone

After a bit of poking around, I discovered that the regex being used to parse the output of aapt was incorrectly for newer versions of the SDK, because a new field was added:

fdroid@a3b874b81979:~/data/build/org.linphone$ /home/fdroid/android-sdk/build-tools/28.0.0/aapt dump badging bin/outputs/apk/release/org.linphone-release-unsigned.apk | grep package
package: name='org.linphone' versionCode='4002' versionName='4.0.1' compileSdkVersion='28' compileSdkVersionCodename='9'
fdroid@a3b874b81979:~/data/build/org.linphone$ /home/fdroid/android-sdk/build-tools/27.0.3/aapt dump badging bin/outputs/apk/release/org.linphone-release-unsigned.apk | grep package
package: name='org.linphone' versionCode='4002' versionName='4.0.1' platformBuildVersionName=''

.*name='([a-zA-Z0-9._]*)'.* (the regular expression in question) returns org.linphone for the 27.0.3 output, but 9 for the 28.0.0 output, presumably due to the new compileSdkVersionCodename field in the aapt output. This change parses that line slightly better, in order to fix this problem and hopefully avoiding similar problems in the future.

Assignee
Assign to
Reviewer
Request review from
Time tracking
Source branch: bugfix/parse-aapt-output-better