Claim Bitcoin cash from android bitcoin app I have some bitcoin stored in the bitcoin wallet android app

I want to transfer my inherited Bitcoin Cash (BCC) to an exchange.
The android app doesn't care about BCC.

I tried to decode a backup of my wallet to use the private key in Bitcoin ABC desktop app. 

openssl enc -d -aes-256-cbc -a -in wallet_backup_file

But gibberish comes out.
Update looks like the decryption worked because I see the first text as org.bitcoin.production. The problem is that it is encoded in a protobuf format: Problems decrypting my bitcoin-wallet on android

Importing the same backup file on the bitcoin app works , and after some time I can see my funds.

How can I claim my bitcoin cash and transfer them to an exchange ?
The Bitcoin Wallet project recently included detailed instructions on how to extract your key pairs for exactly this purpose. In the section Recovering from protobuf wallet format, skip to the paragraph beginning with


  You can also get a list of the private keys...


(Here is a historic version of that guide*, should it ever disappear)

I have now completed the process myself. Here's a summary. Note this works for backups made after 2014 (newer protobuf format). See the article above if your backup is older than this.

# pre-reqs
sudo apt install openjdk-8-jdk openjfx android-tools-adb openssl git maven

# use known version of bitcoinj - HEAD of branch release-0.14 at time of writing
git clone https://github.com/bitcoinj/bitcoinj.git 
(cd bitcoinj &amp;&amp; git reset --hard 0e30a3011c42cedfd83f2109d54dd192730dcc45) 

# decrypt the wallet backup (substitute for &lt;BACKUP&gt;)
openssl enc -d -aes-256-cbc -md md5 -a -in &lt;BACKUP&gt; &gt; /tmp/dec

# reset &amp; sync wallet (may take some time, but was necessary in my case)
(cd bitcoinj/tools &amp;&amp; \
   ./wallet-tool reset --wallet=/tmp/dec &amp;&amp; \
   ./wallet-tool sync --wallet=/tmp/dec --debuglog)

# dump keys You will need to add `--password=&lt;PIN&gt;` if your wallet is pin protected.
(cd bitcoinj/tools &amp;&amp; ./wallet-tool dump --wallet=/tmp/dec --dump-privkeys)

# delete your decrypted wallet
rm /tmp/dec