tomthecarrot / arcore-for-all

Google ARCore (dev preview 1) for "unsupported" Android devices

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

How to repack tar properly? How to add device in custom_device_profile.textproto?

faizanalibutt opened this issue Β· comments

@tomthecarrot can you please tell me how to do it. I'm stuck at the point where we add our device in custom_device_profile.textproto.

Note: I'm able to get my device profile info from logcat. Knows, there is a textproto file namely device_profile_max_capability.textproto is assets directory. I've extracted apk and found that file.

kindly assist me in this. Many Thanks.

I have two phones huawei p10 lite with android O 8.0 and s6 with android N 7.0
@inio can you please help me on this. I'm not figuring out this thing. Thanks

This is the script I use to upload experimental profile changes to my phone - I use Ubuntu Linux, if you are using Windows/Mac I have no idea I am afraid.

Make a folder with

  • android-backup-extractor.jar
  • backup.ab - backup up from phone of course
  • custom_device_profile.textproto - start with a vanilla copy of device_profile_max_capability.textproto
  • The script below

Note: You do not need your device profile info from logcat this file will load first if it exists making that step unnecessary.

#!/bin/bash
# extract the ackup and untar it
java -jar android-backup-extractor.jar unpack backup.ab backup.tar
tar xf backup.tar

# add the custom profile to the extracted apps folder
mkdir "apps/com.google.ar.core/f"
cp ./custom_device_profile.textproto ./apps/com.google.ar.core/f/custom_device_profile.textproto

# create a package.list to package the files back in the correct order
tar tf backup.tar > package.list
echo "apps/com.google.ar.core/f/custom_device_profile.textproto" >> package.list

# repack the tar - create restore.ab from it
tar cf restore.tar -T package.list
java -jar android-backup-extractor.jar pack restore.tar restore.ab

# send to device
adb restore restore.ab

#cleanup
rm -Rf apps package.list restore.tar restore.ab backup.tar

screenshot_20190224-224214

Thanks @mwvent I manage to run linux commands on windows using cygwin I've used that before a long time ago. This is from my side 🍑 πŸ’ƒ πŸ‘ πŸ’― πŸ₯‡ πŸ˜†

if anyone wants help please contact me. If you don't understand how to do it. Enjoy My friends. Happy Coding

@faizanalibutt by any chance can you send me your backup.ab? I can never seem to get the backup to get the files needed.. I mean I have on various occasions but I have no luck recreating that. Also when I've tried restoring it or backing up nothing comes up.

@DIGISHORT okay i will send you todya.

@DIGISHORT how will you send it?

@DIGISHORT
i will upload it here.

@faizanlibutt thank you so much. Also I will try out your line of code you showed me in the other thread tomorrow. Thank you again for helping out!

backup.zip

Enjoy and try this on your phone by restoring it. Everything is done. Make sure you have arcore 1.7 installed on your phone. just run this command.

adb restore backup.ab

@faizanalibutt alright so I tried out the backup.ab you gave me and it worked! But when turning on AR+ it says arcore has stopped working instead of freezing so I'm close but not there yet in making it work

@faizanalibutt ok a second time and I made it work!
Thank you so much I appreciate your help and generosity!

@DIGISHORT how do you made it work? I'm trying with the backup uploaded and don't works :( I've tried with 1.6, 1.7 and 1.8, but nothing.

I also had no luck. I tried to create backup with custom changes and after failure using one from @faizanalibutt. Nothing worked (using samsung galaxy s6). From what I've noticed, after restoring backup to my phone, and making another one from restored apk, that new backup had no changes made to the first one. It looks like that restore had no effect on my apk, even though I saw a message of restoring on my phone. Anyone?

Now I'm a believer! @faizanalibutt you were right, all I had to do was follow the instructions from @mwvent. I'm a windows fan so I used git bash to run the script. Flawless victory. Great thanks to all who have contributed to this solution.

@swiato if you, or anyone, tell me step by step, for dummies, how have you done to make it work PLEASE help me. Thank you

The custom_device_profile wasn't fully restore for some reason when I use backup.zip. When I check, the file size only around 600 bytes. I have to manually replace "custom_device_profile" file again to make it work.
Edit: I managed to fix it by using newer version of adb (1.0.40) I was so dumb to use a very old version of adb.

@AlexInTheEcho do everything exactly like @mwvent in #140 (comment) - create folder on your computer, put there all ingredients including script (if you don't know where to find them look at first post on #139), then run the script with something able to run it (for me on windows it was bash).

@swiato thank you for the answer! Only one thing, this steps that you follow can be done with powershell in windows? I have to install bash and is a tough work and maybe is there a way to do the same steps in windows?

@AlexInTheEcho I'm not sure about PS, but I rather doubt it. If you've ever installed git (version control system), it has bash already included (default: C:\Program Files\Git\bin\bash.exe). If not, try google for other options.

@swiato thanks for the help! I keep trying with bash, I hope it works. But I have to ask is the version of Arcore it's important to the process. You know, if there are a version that works better or not

Something new happens. When I use Arcore with Pokemon Go, freezes but android says that Arcore stops working. I feel that I'm close. This happens with the backup @faizanalibutt share

I think backup should come from the same version as arcore. I'm using (newest?) 1.8 with my own backup and it works. Pokemon Go camera (AR plus) is working (but when localization/gps? is out of reach it's showing black screen with spining white pokeball in upper left corner of the screen). Few others apk that I checked works as well.

Can anybody share a backup.ab that works with a S6? I think @mwvent has a s6 and make it work