We have moved to a new Sailfish OS Forum. Please start new discussions there.
9

[Xperia XA2] Sailfish X don`t have /system/priv-app/ directory

asked 2019-02-01 06:26:13 +0200

Stanislav1988 gravatar image

updated 2019-02-19 13:34:27 +0200

Good Morning,

I want try install google play services (sorry without this my bank application and google music don`t work) but when I use command cd /opt/alien/ ls

I have only system.img in the directory not /system/priv-app/

Can somebody help me?

edit retag flag offensive close delete

Comments

3

system packed to squashfs imgage. you have to repack it to add any modifications.

coderus ( 2019-02-01 10:08:08 +0200 )edit

Please specify when you are referring to the XA2 version of Sailfish X. Generic subjects can confuse readers.

Giacomo Di Giacomo ( 2019-02-01 12:00:04 +0200 )edit

8 Answers

Sort by » oldest newest most voted
17

answered 2019-02-05 02:20:14 +0200

MemphisX gravatar image

updated 2019-02-05 02:33:05 +0200

I've been digging into this for the last couple of days and I think I have some bad news here but there is hope.

So the mistake we all been doing is following instructions for an older version of android. We need gapps for android 8.1, and not 4.4 that the original Jolla (and everything else up to XA2) is running. So following the same steps mentioned by @Zastin91 answerof unsquashing the image file I downloaded the earliest pico version of opengapps for 8.1 from here https://github.com/opengapps/arm/releases/tag/20180301 (01/03/2018).

The zip file is a bit different compared to the older versions of gapps we had as each individual package is also compressed to lz files. All the required files are in the Core folder. I extracted:

  • vending-arm.tar.lz and copied the Phonesky folder
  • gfs-core.tar.lzfor the GoogleServicesFrameworkfolder
  • gmscore-arm.tar.lz for thePrebuiltGmsCore folder
  • gmssetup-all.tar.lz for the GmsCoreSetupPrebuilt folder
  • googleonetimeinitializer-all.tar.lz for the GoogleOneTimeInitializerfolder
  • googlepartnersetup-all.tar.lz for the GooglePartnerSetup folder

(don't just extract the files to the priv-app folder but check the contents and find the appropriate folder that has the apk file with the same name, I also don't know if you really need all those, but that specific combination worked for me to get the play services running to... some extend...keep reading to get what I mean).

Now after packing back the img file, replacing the original in my xa2 and restarting alien dalvik I had to deal with this https://www.xda-developers.com/how-to-fix-device-not-certified-by-google-error/

After downloading the device id app with yalp store and following the procedure for white listing my device as described in the link above I was still getting the error until I managed to add my account and restarted the phone a couple of times as well as updated both the play store and play services by dowloading the latest versions through apkmirror.

At that point everything seemed to work fine but we are back to the same problem we had with every other sailfish device that was running the latest play services. You can't install any app from play store as they are stuck in pending. Apps installed through yalp though work as expected with no problems accessing the play services. (at least after some initial testing)

I believe we will have better luck with microg and some file modifications for signature spoofing than with opengapps.

PS: I also tried the MindTheGApps packages to no luck as play services were constantly crashing.

edit flag offensive delete publish link more

Comments

@MemphisX Did you have account in telegram app? I have some questions, and how you copy this files and where? And did you unsquashfs system.img?

Stanislav1988 ( 2019-02-05 05:50:25 +0200 )edit

Seems this procedure works - Play Store is not working, but Yalp is doing the same. The rest of Google Services seem to be working. Couldn't install Maps for some reason - says the apk is split.

Bundyo ( 2019-02-05 08:53:37 +0200 )edit

I can`t find directories when I must paste extracted tar.lz files can someoene find them?

Stanislav1988 ( 2019-02-05 12:02:49 +0200 )edit
1

I am at work now, so it is quite difficult to reply properly. My post was quite late at night yesterday so excuse the not so helpful guidance there, I will try to update it later today when I get home.

@Stanislav1988 Just to make things a bit more clear you still need to get the img file and copy it to a computer running linux and unsquashed it following @Zastin91's answer, but instead of getting the KitKat version of gapps you get the opengapps I mentioned above. You extract the files I mentioned to a temporary folder and then on what you got extracted you look for the subfolder with the name mentioned for each lz file. That folder will hold an apk with the same name as the folder. Usually it is inside a nodpi/system/priv-app folder. You need to copy that folder to the system/priv-app folder of where you unsquashed the img file.

@Bundyo Yalp sometimes tends to download 2 files for some packages. If you go to the folder yalp downloads the files (this is Downloads in Android Storage if you use Crest) you ucan try to install the bigger one. Sometimes it works. Wondering if this has anything to do with 64 bit supporting apks that Google now requires from developers. Map apps for me don't work as expected no matter what I tried. They run but it seems GPS is not working or getting any positioning.

As I said, the above steps just make the Google services work but google play won't be able to install/update apps. When the last working version of Google Play for older Sailfish devices was out (the one that we were forcing to never be updated), the latest Android we had back then was 7.1 so I think we are out of luck here if you want to use Google play for updating and installing apps.

MemphisX ( 2019-02-05 12:30:05 +0200 )edit

@MemphisX

I do everything what you say in the tutorial but when I stop alinedalvik and start again my device reboot into system and reboot again, so something must be wrong.

Stanislav1988 ( 2019-02-05 12:43:33 +0200 )edit
6

answered 2019-02-02 09:11:30 +0200

Zastin91 gravatar image

updated 2019-02-04 10:22:30 +0200

I copy system.img from /opt/alien/ to my linux computer and repacked it.

mkdir squashfs-temp
cd squashfs-temp
unsquashfs /path/to/image/system.img

Then I have directory system/priv-app/ and I follow this quide: https://together.jolla.com/question/114608/howto-install-gapps-gplay-google-play-kk-on-tablet-jolla-c-sailfish-x/?sort=votes&page=1

After that:

mksquashfs squashfs-root/ system.img -comp lz4 -Xhc -noappend -no-exports -no-duplicates -no-fragments

Then I replace system.img in my phone.

It seems like google service start working, but when I try to log in my google accound I get error: "Couldn't sign in, There was a problem communicating with Google servers. Try again later"

So I can't use google play store. Whatsapp recognizes google servises and wants make backup settings, but same error come when I try to login google services.

EDIT: Like J24 say, There wasn't same settings on my command mksquashfs as ordinary img file. Now I correct them. Android support seems work faster after I repackt system.img with arguments what J24 says. But still I can't login google account. Note: I'm not profesional person, I only googled and tested what could work.:)

edit flag offensive delete publish link more

Comments

Can I do this on SailfishOS I don't know how to copy this file and replace, but good that i work but I want /system/priv-app/ inside sailfish but strange that can't connect with Google

Stanislav1988 ( 2019-02-02 11:36:37 +0200 )edit

I use command scp to transfer file to computer and back. I didn't find mksquashfs command preinstalled on sailfishOS, so i transfer file to computer.

Quide how to use scp: https://haydenjames.io/linux-securely-copy-files-using-scp/

Zastin91 ( 2019-02-02 11:54:56 +0200 )edit

ok thanks but if you can't connect to Google, this solution is useless for me.

Stanislav1988 ( 2019-02-02 12:30:29 +0200 )edit

Whilst commands above in Zastin91's post also work using Homebrew upon MacOSX to repack system.img, there is no escaping fact that priv-app now has a totally different (folder) structure compared with that of /opt/alien/system/priv-app in older version.

aspergerguy ( 2019-02-03 17:12:18 +0200 )edit

I noticed that too. I tested that I make own folder for every one of these: GmsCore.apk, GoogleLoginService.apk, GoogleServicesFramework.apk and Phonesky.apk. sameway as other .apk in folder system/priv-app/. I also tested without own folder for .apk files. Both ways ended up to the same resolutions. Without these .apk, installed google play store won't start, but when .apk's are somewhere in system/priv-app/ file then I get login screen when I start google play store. So it looks like android emulator can use these .apk's even folder structure is different.

Zastin91 ( 2019-02-03 17:55:34 +0200 )edit
3

answered 2019-02-05 16:17:26 +0200

Stanislav1988 gravatar image

updated 2019-02-05 16:22:35 +0200

Ok I follow a Guide writed by user @MemphisX (thanks bro), I finally done make Google Play Services work and what we have now:

(I use Yalp to download .apk) (Store from Jolla don`t work O_O )

-Google Drive (work and audio too) -Google Music (I can log in into account, but I dont see my music) -Google Chrome (work, but I cant choose my account)

!!! Remember after you start this guide,you must stop alien dalvik service!!!

I have modified system.img (with added required files) but I don`t know if I can add link for this file ?????

edit flag offensive delete publish link more
2

answered 2019-02-01 08:49:40 +0200

ausgeregelt gravatar image

You're talking about Sailfish for XA2, I guess. In the release notes, there is written

Google Play services are not supported; therefore certain apps may not function properly.

This has probably to do with

Linux Containers (lxc) are used for separation of SailfishOS and Aliendalvik (Android Support).

edit flag offensive delete publish link more

Comments

ahhh I see it now, so I must search this directory in different place

Stanislav1988 ( 2019-02-01 10:02:44 +0200 )edit
2

you need to repack android squashfs image!

coderus ( 2019-02-01 12:15:55 +0200 )edit

It could help if someone familiar with squashfs provided a small howto, since a wrong switch might make the difference between a working system and a reflash.

Giacomo Di Giacomo ( 2019-02-01 16:51:37 +0200 )edit

Is it any way to get shell of LXC container? I tried lxc-attach without success

p.s I foud it:

[root@Sailfish nemo]# lxc-attach -n aliendalvik -- /system/bin/sh
Neo2SHYAlien ( 2019-03-30 09:06:08 +0200 )edit
1

answered 2019-10-10 02:38:19 +0200

Raphendyr gravatar image

updated 2019-10-10 02:38:42 +0200

Based on amazing work done by @jaine , @Zastin91 and @MemphisX , I compiled a bit more detailed guide how to get Google Play Services running on XA 2.

Full guide is in a github gist

In short. the process is:

  1. get system.img from XA 2 installation
  2. get opengapps (optional also yalp store)
  3. merge apps to system.img. This part includes a bit of work, see the guide.
  4. copy back to the device, restart and so on
  5. register GSF ID to Google (not sure if really requried, did it before problems)

I look how well this setup works for a few days/weeks and I'll look into posting a new howto about it.

edit flag offensive delete publish link more

Comments

@coderus thanks. That includes "the same". Sadly, I don't see a way to support squashfs editing on windows, due to those permissions.

Raphendyr ( 2019-10-10 13:03:44 +0200 )edit

Thanks for the guide, when I try to log in Play Store, it cannot connect / communicte to Google servers while data checking... Yalp Store cannot log in with fake account, error 404 with existing account.

MaxT ( 2019-11-09 22:49:20 +0200 )edit

@MaxT Yalp store seems to be unmaintained. I started to test Aurora Store in addition to Aptoide. Relevant issue about the anonymous accounts: https://gitlab.com/AuroraOSS/AuroraStore/issues/188

Did you remember to register the GSF ID to google? That probably would block Play Store.

That note, I was debugging why Play Store can't install apps, but I didn't find out. Might be due to missing biometrics classes (raises exceptions for that). I look more into it at some point, but I'm not hopeful. In addition, location services do not seem to work with google play services, which is also under investication.

Raphendyr ( 2019-11-11 00:05:29 +0200 )edit
0

answered 2019-02-01 11:29:56 +0200

Stanislav1988 gravatar image

So I see at now that you really block access to install Google Play, at now there is no /opt/alien/sytem/priv-app/

Now /priv-app/ is in android storage /home/nemo/android storage

But when I stop aliendalvik.service this directory (android_storage) is empty, but if I dont stop aliendalvik I can acess into this directory but I cant copy the GmsCore.apk and etc. because I get this error

Transport endpoint is not connected image description

Now someone must thinking about new way to install this.

edit flag offensive delete publish link more

Comments

2

you need to repack android squashfs image!

coderus ( 2019-02-01 12:15:51 +0200 )edit

Tell me how I am green with this

Stanislav1988 ( 2019-02-01 12:42:28 +0200 )edit
3

if you don't know it you can't do it

coderus ( 2019-02-01 13:22:09 +0200 )edit
3

Coderus, so maybe little tutorial how to do, or maybe you have tutorial how get google play service

Stanislav1988 ( 2019-02-01 14:13:51 +0200 )edit
0

answered 2019-02-01 12:14:01 +0200

balta gravatar image

I haven't tried to install the play services, but have a look into the directories in /home/.android

edit flag offensive delete publish link more

Comments

1

you need to repack android squashfs image!

coderus ( 2019-02-01 12:15:49 +0200 )edit
2

How to do it?

Gouneesz ( 2019-02-01 12:26:22 +0200 )edit

home/android is unavailable when stop aliendalvik.service but if in different you cant copy files because SailfishOS dont let you save them in the directory

Stanislav1988 ( 2019-02-01 12:44:01 +0200 )edit
3
1

I've already added my WhatsApp Backup Folder to this directory without repackaging any squashfs and it worked.

balta ( 2019-02-01 13:23:34 +0200 )edit
-3

answered 2019-02-01 14:38:32 +0200

Stanislav1988 gravatar image

I need google play service to install Google Music

edit flag offensive delete publish link more

Comments

It would be much easier to use Android Phone for Google Music. SailfishOS is an Operating System primary for People who DON'T want use Google Apps and Services....

ExPLIT ( 2019-02-05 11:32:20 +0200 )edit
1

really? I think if iOS have Google Music so why we don`t have

Stanislav1988 ( 2019-02-05 19:11:07 +0200 )edit

Google services is not about the OS. I use them on Android, Linux and Windows. I really would like to use them on Sailfish too.

SailfishOS should not be just for Google haters. That path won't go far.

renni ( 2019-05-29 15:57:52 +0200 )edit

@renni - the idea behind SFOS is that of privacy, one thing Google does NOT specialise in is PRIVACY, need I say any more?

Spam Hunter ( 2019-10-10 12:24:41 +0200 )edit

You should be using android phone for google music, Sailfish OS is made for those who don't want to use google services thinkorswim

Rioniii ( 2020-01-26 12:18:37 +0200 )edit
Login/Signup to Answer

Question tools

Follow
11 followers

Stats

Asked: 2019-02-01 06:26:13 +0200

Seen: 4,973 times

Last updated: Oct 10 '19