tomthecarrot / arcore-for-all

Google ARCore (dev preview 1) for "unsupported" Android devices
GNU General Public License v3.0
1.04k stars 145 forks source link

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

Closed faizanalibutt closed 5 years ago

faizanalibutt commented 5 years ago

@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

mwvent commented 5 years ago

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

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
faizanalibutt commented 5 years ago

Thanks. I will try it.

On Wed, Feb 20, 2019, 6:39 PM Matthew Watts <notifications@github.com wrote:

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
  • extracted backup.ab
  • 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

java -jar android-backup-extractor.jar unpack backup.ab backup.tar tar xf backup.tar

mkdir "apps/com.google.ar.core/f" cp ./custom_device_profile.textproto ./apps/com.google.ar.core/f/custom_device_profile.textproto

tar tf backup.tar > package.list echo "apps/com.google.ar.core/f/custom_device_profile.textproto" >> package.list tar cf restore.tar -T package.list

java -jar android-backup-extractor.jar pack restore.tar restore.ab

adb restore restore.ab

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

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/tomthecarrot/arcore-for-all/issues/140#issuecomment-465577165, or mute the thread https://github.com/notifications/unsubscribe-auth/AZf-ZItQI6e-yb7L0dDjZzc10FyvSqwvks5vPVAIgaJpZM4bCLQr .

faizanalibutt commented 5 years ago

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

DIGISHORT commented 5 years ago

@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.

faizanalibutt commented 5 years ago

@DIGISHORT okay i will send you todya.

DIGISHORT commented 5 years ago

@digishort how will you send it?

faizanalibutt commented 5 years ago

Okay no problem.

On Mon, Feb 25, 2019, 8:31 AM DIGISHORT notifications@github.com wrote:

@faizanalibutt https://github.com/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.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/tomthecarrot/arcore-for-all/issues/140#issuecomment-466860215, or mute the thread https://github.com/notifications/unsubscribe-auth/AZf-ZImkFwj7G2cyoJwv5HVgFXLSqY6Iks5vQ1kegaJpZM4bCLQr .

faizanalibutt commented 5 years ago

@DIGISHORT i will upload it here.

DIGISHORT commented 5 years ago

@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!

faizanalibutt commented 5 years ago

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

DIGISHORT commented 5 years ago

@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

DIGISHORT commented 5 years ago

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

AlexInTheEcho commented 5 years ago

@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.

swiato commented 5 years ago

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?

faizanalibutt commented 5 years ago

On some phones you need to change custom device profile file and for that you need to follow all of the steps defined above by Mattew. In my case it was Huawei p10 lite and its working fine. I dont require to change that custom device file.

On Sun, Apr 7, 2019, 6:48 PM swiato notifications@github.com wrote:

I also had no luck. I tried to create backup with custom changes and after failure using one from @faizanalibutt https://github.com/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?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/tomthecarrot/arcore-for-all/issues/140#issuecomment-480592028, or mute the thread https://github.com/notifications/unsubscribe-auth/AZf-ZLTteUPhkKlhrvv5S6gBXHOKQNpQks5vefcRgaJpZM4bCLQr .

swiato commented 5 years ago

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.

AlexInTheEcho commented 5 years ago

@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

wichayapoka commented 5 years ago

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.

swiato commented 5 years ago

@AlexInTheEcho do everything exactly like @mwvent in https://github.com/tomthecarrot/arcore-for-all/issues/140#issuecomment-465577165 - 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 https://github.com/tomthecarrot/arcore-for-all/issues/139), then run the script with something able to run it (for me on windows it was bash).

AlexInTheEcho commented 5 years ago

@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?

swiato commented 5 years ago

@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.

AlexInTheEcho commented 5 years ago

@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

AlexInTheEcho commented 5 years ago

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

swiato commented 5 years ago

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.

AlexInTheEcho commented 5 years ago

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