Skip to content
This repository has been archived by the owner on Apr 13, 2023. It is now read-only.

An UNSUPPORTED holiday gift from the ARCore team #139

Open
inio opened this issue Dec 25, 2018 · 52 comments
Open

An UNSUPPORTED holiday gift from the ARCore team #139

inio opened this issue Dec 25, 2018 · 52 comments

Comments

@inio
Copy link

inio commented Dec 25, 2018

Seasons greetings!

First off, I want to apologize for nerfing this project with ARCore 1.2. It was an unfortunate side effect of some important changes we had to make and wasn't intended to limit exploration. We think it's cool that users are so excited about ARCore that they're willing to jump through hoops to use it.

Now, on with the gift:

Though undocumented and totally unsupported, ARCore version 1.6 will look for a file at /data/data/com.google.ar.core/files/custom_device_profile.textproto before trying to load a profile normally from the database. This file has the same format as any other device profile and can be injected on a an unrooted device by using the backup/restore mechanism provided by adb as follows:

  1. Install the 1.6 ARCore APK.
  2. Use adb backup to back up com.google.ar.core.
  3. modify the backup to add the device profile at apps/com.google.ar.core/f/custom_device_profile.textproto. android-backup-extractor may be useful in doing the backup modifications, but be careful of the file order (see the documentation).
  4. Restore the modified backup.

Unfortunately 1.6 adds a wrinkle when figuring out the nearest profile to start from: device profile names are obfuscated. Here's a couple common places to start with (warning: these will probably change with each release):

Device Name Obfuscated Name
Pixel 1U-j16
Pixel 2 ggXzI1
S8 Exynos: zIGRDW Qualcomm: ngqwNz
S7 Exynos: Wvs3US Qualcomm: y3dvz_
S7 Edge Exynos: Qk0fSK Qualcomm: 6xH1dn

To build a bigger table, you should be able to find a logcat message that reports the name of the profile loaded, so get at it 😉.

Two final notes:

First, this only works on devices where the ARCore background process can run. We've seen some devices (mostly in China) with a security mechanism that prevents background apps without a launcher icon from running. On these devices the ARCore runtime can't access the ARCore ContentProvider, which prevents reading the profile from ARCore's data directory.

Finally, we really only intended this mechanism for internal development use. We're mentioning it here because we see users super excited about running ARCore on additional devices, and agree that having to root your phone to do that is dumb. That said, we really only want to expose this to users already familiar with adb, side-loading, rooting, and the instability and wackyness that can arise from those things. Don't go out of your way to make it easy for novice users run ARCore on unsupported devices, and don't ask for support through official channels. If either of those start happening, we may have to cripple or remove this capability, and I think that's a loss for everyone involved.

@tomthecarrot
Copy link
Owner

Thanks so much @inio! We really appreciate your gift and look forward to experimenting more with ARCore in a development setting :)

Happy Holidays!

@faizanalibutt
Copy link

2019-02-04 18:03:30.548 24736-24754/? I/native: device_profile_database_helpers.cc:296 Found nothing for device_profile_YttHJv
2019-02-04 18:03:30.548 24736-24754/? I/native: device_profile_database_helpers.cc:296 Found nothing for device_profile_WAS-LX1A_slash_HWWAS-H_accelerometer_null
2019-02-04 18:03:30.548 24736-24754/? I/native: device_profile_database_helpers.cc:296 Found nothing for device_profile_lsK4W9
2019-02-04 18:03:30.548 24736-24754/? I/native: device_profile_database_helpers.cc:296 Found nothing for device_profile_HWWAS-H_accelerometer_null
2019-02-04 18:03:30.548 24736-24754/? I/native: device_profile_database_helpers.cc:296 Found nothing for device_profile_N64zQ2
2019-02-04 18:03:30.548 24736-24754/? I/native: device_profile_database_helpers.cc:296 Found nothing for device_profile_WAS-LX1A
2019-02-04 18:03:30.548 24736-24754/? I/native: device_profile_database_helpers.cc:298 Could not locate device profile for HUAWEI/WAS-LX1A/HWWAS-H_accelerometer_null:8.0.0/HUAWEIWAS-LX1A/369(C185):user/release-keys

Kindly tell what should i do for this logcat to be successfull @tomthecarrot please advise.

@inio
Copy link
Author

inio commented Feb 14, 2019

@tomthecarrot Small update: 1.7 (out today) leaves this mechanism unchanged, but switches the main profile database to something much more opaque. I made sure we included an example text-format proto in the assets directory, and I threw in a few hopefully-helpful comments.

@tomthecarrot
Copy link
Owner

Very cool. I'll check it out. Thanks @inio!

@mwvent
Copy link

mwvent commented Feb 15, 2019

Just wanted to thank you @inio - I just tried the example file you provided in 1.7 and tried it with Pokemon Go.

It worked completely unmodified ! ( Samsung Galaxy S6 ) - I could move closer to the 'mon and walk around, my daughter will be thrilled! Absolutely stunning work :-)

@faizanalibutt
Copy link

@mwvent can you please tel 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

kindly assist me in this. Many Thanks. I have also s6.

@faizanalibutt
Copy link

Device Name Obfuscated Name
Pixel 1U-j16
Pixel 2 ggXzI1
S8 Exynos: zIGRDW Qualcomm: ngqwNz
S7 Exynos: Wvs3US Qualcomm: y3dvz_
S7 Edge Exynos: Qk0fSK Qualcomm: 6xH1dn
S6 Exynos: SKMoV6
S6 Exynos: 9Bf8uR

@inio @mwvent @tomthecarrot I'm creating this custom_device_profile.textproto file and saving data while fetching it from logcat. For s6. Please help me where i am doing wrong. Thanks.

this is the tar file order
apps/com.google.ar.core/a/base.apk
apps/com.google.ar.core/sp/phenotypeSharedPrefs.xml
apps/com.google.ar.core/f/custom_device_profile.textproto
apps/com.google.ar.core/_manifest

@faizanalibutt
Copy link

faizanalibutt commented Feb 16, 2019

I have two phones huawei p10 lite with android O 8.0 and s6 with android N 7.0

@mwvent
Copy link

mwvent commented Feb 16, 2019

img_2019-02-15-23384558
@faizanalibutt - it doesn't look like you have to worry about device profile name at all. Just create apps/com.google.ar.core/f/custom_device_profile.textproto repack the tar ( the new file was last in order on mine ) and that device profile will be loaded first

I simply just extracted the apk and used the assets/device_profile_max_compatibility.textproto file for the custom_device_profile.textproto - it works pretty well with the S6 without making any changes although the only app I have tried is Pokemon GO. It's not quite the experience of a fully supported phone but way better then the 'standard' ar photo experience and I am happy with it.

@faizanalibutt
Copy link

@mwvent Many thanks for your reply. I will tell you after implementing it.

@faizanalibutt
Copy link

faizanalibutt commented Feb 18, 2019

https://drive.google.com/open?id=1MOp6CXxNAABrBWpinWVqOZUO-VYNj8R_

@mwvent please see this video we don't need arcore application installed to run pokemon go. you can see in video.
There are two apps. One is Aruler App Other is Pokemon GO
Pokemon go is not dependent on ARCore. Although ArRuler App requires ARCore app installed.
Can you please try ARruler app on your phone S6

@faizanalibutt
Copy link

@tomthecarrot @inio can you please help me on this. I'm not figuring out this thing. Thanks

@mwvent
Copy link

mwvent commented Feb 20, 2019

@faizanalibutt - The video link did not work. Anyhow Pokemon Go works without ARCore yes, but there are photography features that will only work when ARCore is installed. Without ARCore you get a Pokemon overlayed simply on your camera image, you can not walk closer to the Pokemon not take a picture from the side as I did above.

AR Ruler does run - the results are of course inaccurate - we are running ARCore uncalibrated after all!
The inaccuracy is more then tolerable for taking pictures of Pokemon. I am currently running a mixture of old S7 profile from a previous ARCore APK and the device_profile_max_compatibility profile and will probably continue to try and have fun tweaking it for the duration of my devices lifespan.

I would try and respect @inio 's wish not to be hammered with requests for help with this - what has been done already is fantastic and gives us an opportunity to experience the tech and maybe figure some things out ourselves that we could not do otherwise.
screenshot_20190220-131118

@faizanalibutt
Copy link

faizanalibutt commented Feb 20, 2019 via email

@DIGISHORT
Copy link

@mwvent hello! I'm sorry to bother ya, but I have been trying to extract ar core 1.6 [downloaded from the developer's github] but all that appears is a _manifest file. actually backed up all my apps to be sure it was just that and most of my apps were properly backed. How did you do it? if you don't mind explaining

@cridus
Copy link

cridus commented Feb 22, 2019

I know that github issues shouldn't be used as forum threads or such, but it took some time for me to figure out what to actually do to get ARCore working on my phone (for Pokémon GO's AR+, specifically), so I'm gonna write it here for others to come:
(assuming you have a rooted phone):

  • Install the "arcore-modified-preview.apk" from the "service-mod" branch (it's linked in the README);
  • Download the latest ARCore apk from somewhere and install it (at this time, the latest is v1.7);
  • Go to "/data/data/com.google.ar.core" and create a "files" directory. To be safe, give it the same permissions as the other directories already existing there;
  • Open the ARCore apk file, go to the "assets"directory and extract the "device_profile_max_capability.textproto" file. Rename it to "custom_device_profile.textproto";
  • Put that file in the "files" directory you created previously.

Open Pokémon GO or whatever other app you want ARCore for, and the augmented reality features should be working (AR+, in case of Pokémon GO).
If they don't, it means that you might have to tweak the "custom_device_profile.textproto" file. Good luck with that...

I'd like to thank @tomthecarrot, @inio, @mwvent and everyone else who worked on this project for allowing us to use ARCore on officially-unsupported devices.

@DIGISHORT
Copy link

So after installing ARCore, com.google.ar.core isn't showing up in my data folder As it should. It's probably why I keep getting 1kb backups so I'm kinda stumped asto what to do

@faizanalibutt
Copy link

I'm also getting 1kb backup data @DIGISHORT

@immewnity
Copy link

Looks like there's a bug with the latest adb versions - try 1.0.31 (https://archive.mozilla.org/pub/labs/android-tools/) or earlier.

@faizanalibutt
Copy link

faizanalibutt commented Feb 24, 2019

I've done it. @immewnity @cridus @DIGISHORT Using my Huawei p10 lite android 8.0. Enjoy

#140

see above link

@mwvent
Copy link

mwvent commented Feb 25, 2019

Re the 1kb adb backups I found the only way to get it working with my adb version was to use the -apk flag with adb backup.
Or was it the -system flag.. really should have wrote it down but it was one of the two :-)

@DIGISHORT
Copy link

Re the 1kb adb backups I found the only way to get it working with my adb version was to use the -apk flag with adb backup.
Or was it the -system flag.. really should have wrote it down but it was one of the two :-)

I tried this just now but i continue getting the 1kb backup.. I almost had it working earlier but back to square one. :/ @mwvent

@faizanalibutt
Copy link

Re the 1kb adb backups I found the only way to get it working with my adb version was to use the -apk flag with adb backup.
Or was it the -system flag.. really should have wrote it down but it was one of the two :-)

I was already using this command to backup files. go to platform-tools/adb.exe path and then run this command.
adb backup -f backup.ab -apk com.google.ar.core

@Paulovismfr
Copy link

Good night friends.
I do not understand much of programming and all these technical terms used here in the forum, but I would like the help of you to help me run ARcore on my Moto G6 play phone that unfortunately is not supported.
I did not understand why the developers calibrated the application to the Moto G6 and Moto G6 plus devices to be compatible with ARcore and let the Moto G6 play out of that list.
Thanks for the help.

@DIGISHORT
Copy link

@faizanalibutt hey how do you extract the logcat from ARCore so I can then put it here.

@faizanalibutt
Copy link

faizanalibutt commented Feb 27, 2019

@DIGISHORT just connect device to android studio in which arcore is installed and search for (arcore/device_profile/calibration/stuff that's relate to arcore) in logcat. You will find it.

And there is an option namely Create Gist... click on it give credentials and it will extract the logcat for you.

@ghost
Copy link

ghost commented Mar 23, 2019

First of all, thank you to everybody who gave a little bit of their knowledge to make this possible. I feel like I'm very close to getting this to work on my Samsung SM-A605FN.
I've done every step, backup, restored with the costum_device_profile.textproto and eventually got to the point where a little hand holding a phone shows up on a black screen with a toast saying Failed to create AR session.

Logcat of the crash - https://drive.google.com/open?id=1GnryDFLhyqds4G7J6oPaw5ZOyOwNDttd

In which you can see the error Physical cameras don't match device profile. Camera not found. camera_id=0, cameras count=0.

If somebody could give a hint to what I could possibly be doing wrong, that would be awesome.

Cheers

@faizanalibutt
Copy link

I think your device is not matching the requirements thats present in that file. Anyhow just try this once in your phone. Open this link @joaopmarques66

#140

@ghost
Copy link

ghost commented Mar 23, 2019

I think your device is not matching the requirements thats present in that file. Anyhow just try this once in your phone. Open this link @joaopmarques66

#140

The zip that you provided in the referenced issue is actually the one I'm using, since I could not do a regular backup of my AR Core app.

Is there anything I need to add/edit on the costum_device_profile.textproto?
I've tried to play around with the configurations in this file, but I believe the problem is not with the file itself since the error refers cameras count=0.

@AlexInTheEcho
Copy link

Hello. I´m totally noob in this forum and adb commands. Since Pokemon Go released AR+ for Android I wanna make my Redmi Note 5 works cause there are a lot of devices supported by Arcore that are similar o lower specs than my phone. Can anyone make a tutorial por dummies like me to use adb commands and make my phone have the Arcore than he deserves? Very thank you

@AlexInTheEcho
Copy link

Hello again. I did the backup and I just wanna extract or edit the backup.ab file and it's done (i hope). Please help

@faizanalibutt
Copy link

faizanalibutt commented Mar 31, 2019 via email

@AlexInTheEcho
Copy link

Very thank you for the help, but don't work :( I wondering if it's arcore version's fault. I downloaded 1.6 but maybe y I have to instal 1.7 or 1.8? Thank you again

@faizanalibutt
Copy link

faizanalibutt commented Mar 31, 2019 via email

@AlexInTheEcho
Copy link

I will try. Thank you again
Just to make my mind clear. The steps are installing de arcore apk. restore your backup, and should works? I don't need to reboot or something? The are more steps?

@faizanalibutt
Copy link

faizanalibutt commented Mar 31, 2019 via email

@AlexInTheEcho
Copy link

Dont work. I just tried with 1.7 and 1.8 and use Pokemon Go and black screen. I have a Redmi Note 5. I'll keep trying but I don't know what more to do. Everytime I install Arcore do the restore command and work fine, wipe caché in Pokemon Go and when I use AR+ it's frozen. But really, thank you for the help

@AlexInTheEcho
Copy link

Can anyone share their backups that are functional? Maybe this way I can make this work. I'd loved use Pokemon Go ar+ and stuff

@swiato
Copy link

swiato commented Apr 7, 2019

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?

@langbeck
Copy link

langbeck commented Apr 7, 2019

@faizanalibutt after restoring the backup you provided the profile was loaded:

I native  : calibration_jni.cc:160 Successfully loaded custom v2 device profile from /data/data/com.google.ar.core/files/custom_device_profile.textproto     

But a simple Unity AR tutorial app (that works in emulator) still not working.

E native  : online_calibration_manager.cc:47 OnlineCalibrationManager: Could not open /data/user/0/UniqueName.AR/cache/arcore-online-recalibration for reading
...
W ARCore-AnchorServiceClientFactory: The API key for use with the Google AR service could not be obtained!
...
E native  : status.cc:156 generic::internal: Physical cameras don't match device profile. Camera not found. camera_id=1, cameras count=0
E native  : session_create_implementation_shared.cc:1466 Failed to initilize the data source - -2                                                            
E native  : session_create_implementation_shared.cc:1467 CreateLiveSessionWithMostDependencies returning ArStatusErrorSpace::AR_ERROR_FATAL: .
...
E ArPresto: ArPresto::ArCore session creation failed.
E native  : session_c_api.cc:313 ArConfig_setUpdateMode: session was passed NULL.
E native  : session_c_api.cc:296 ArConfig_setPlaneFindingMode: session was passed NULL.

@inio let me see if I understood things correctly:

What am I missing?

Thanks

EDIT: I'm using a Moto Z2 Play

@AlexInTheEcho
Copy link

Well, I give up. Since weeks I've trying to do this with my Redmi Note 5 but can't do this work because I'm totally noob with adb, bash, modify backups and stuff. I can't even understand how this works, but I understand that this post is made for people like developers. I understand, maybe, that in the backup.ab there are a file where I should insert my device profile, or other phone profile? And I can't even know how to do it. Thank you for the knowledge and the help. I hope someday my Redmi Note 5 and other Xiaomi's phone get supported soon

@mwvent
Copy link

mwvent commented May 9, 2019

@Space4ARDev apkmirror have all the old versions of the apk. The same process for editing the backup works fine on the newer arcore versions though, you can even just install an updated apk over the old one when released as the custom profile gets retained which is great. Do you have a specific need for 1.7?

@jorgenascimentoifs
Copy link

Dear mwvent
recently released arcore 1.9, which enables the model viewer function, allowing the use of augmented reality on the web. Are you working to make this version available to unsupported androids? this version of arcore is one of the best in a matter of novelty released in the last months. it would help a lot of people to have that access. Thank you in advance for your attention.

@kofimokome
Copy link

kofimokome commented Aug 28, 2019

Hello. Please, mine does not seem to work. I've followed the steps above from @inio
and I also followed the steps here
I've installed arcore 1.7
I get this output calibration_jni.cc:160 Successfully loaded custom v2 device profile from /data/data/com.google.ar.core/files/custom_device_profile.textproto but I still see a blank screen when I click on the camera icon in Pokemon go. Can someone help me?

I am using Infinix hot s3x, android 8.1

Second Question: Can this also work the the latest arcore ( v1.11 ) ?

@mwvent
Copy link

mwvent commented Sep 6, 2019

@jorgenascimentoifs - I am just a normal phone user like yourself. Have you tried upgrading to 1.9 and see what happens?

@faizanalibutt
Copy link

@kofimokome its probably your phone specs is not near to supportable devices. try to test on flat surface plain surface. like on marble or flat wooden piece. it should work because profile is loaded.

@kofimokome
Copy link

Thanks @faizanalibutt I still see a black screen.
Is there a way to tweak the custom_device_profile.textproto to match that of my device.

@AlexInTheEcho
Copy link

I'm gonna take the chance that this post it's still alive to say please someone that understand the steps can explain how to do it for normal users?

@cridus
Copy link

cridus commented Sep 20, 2019

I'm gonna take the chance that this post it's still alive to say please someone that understand the steps can explain how to do it for normal users?

Without root? Sorry but I don't know.
If you have root, did you see my guide above?

@Eerovil
Copy link

Eerovil commented Nov 15, 2019

I'm getting the following error:

11-14 12:26:38.288 W/native  (9036): - CAD calibration: File does not have adequate permissions: /data/data/com.google.ar.core/files/custom_device_profile.textproto.

Ive tried the following permissions:
-700
-760
-770
-777

Owner user matches the parent directory.

EDIT: I've fixed the issue by setting SELinux to permissive. Chmod 700.

@WDog367
Copy link

WDog367 commented Jun 27, 2020

Got this working, can confirm it still works for the latest apk (v1.17).

Also I figured out the source of the error Physical cameras don't match device profile. Camera not found. camera_id=1, cameras count=0 some people were seeing.

Based on the log files, arCore uses the native camera libraries. Native lib requires LIMTIED or better Camera2 Api support. You can check your phone with a hardware info app (e.g. Camera2 API Probe), if it says hardware support is LEGACY, then arCore can't see the cameras, and reports 0 camera found.

Although, apparently some phones can have proper Camera2 API support enabled. Something to look into if you really need ArCore running on your phone

@GMAGD
Copy link

GMAGD commented Sep 24, 2021

i've tried this method and it work in redmi note 8 2021 but the camera is little bit dark and the tracking isn't the best

can anyone share with me the database profile for redmi note 8 @inio ?

Thank You :)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests