UnlockAA / XPrivacyLuaHook

Some XPrivacyLua hooks for Android Auto
GNU General Public License v3.0
5 stars 0 forks source link

Could you add install instructions? #1

Closed bblacher closed 1 year ago

bblacher commented 1 year ago

I can't quite figure out how to install these.

UnlockAA commented 1 year ago

Run XPrivacyLua Pro -> Manage hook definitions -> Import choose .json file you want to import
XPrivacyLua Pro -> Collection activate UnlockAA
You can then activate the hook in XPrivacyLua.

starbrights commented 1 year ago

Sorry this is not 100% clear to me. In LSPosed activate XPrivacyLua, clear. In the XPL Module: Enable it, SystemFramework and Settings are checked already by default. Anything else to do? You mentioned the hook has to be enabled by XPL Do I need to check in XPL XPrivacyLua pro too? (Did it) Do I need to check AndroidAuto? To get it you first has to make it visible by uncheck "hide System apps" (check it too)

In XPrivacyLua Pro -> Manage hook definitions -> Import (all the json files for a dedicated version? ) and check the UnlockAA box to become red? (I did import all)

In Settings/App/AA: Force stop it and open additional settings in app, adjust Launcher. To bad, I still the only the few apps that has been visible before.

If I in "adb shell" run the logcat command there are a lot of lines coming. All around 623. Not sure why so many. as example like this:

11-01 14:38:00.951 11220 11220 I XLua.Xposed: Log com.google.android.projection.gearhead:10144 UnlockAA.Phenotype.String ControlSupportedNavApps__allowlisted_nav_packages = com.google.android.apps.gmm.dev,com.google.android.apps.gmm.car,com.google.android.apps.gmm.fishfood,com.google.android.apps.gmm,com.google.android.apps.gmm.qp,com.google.android.apps.maps,com.waze,com.waze.alpha,com.google.android.apps.auto.sdk.samples.chargingstations,com.google.android.apps.auto.sdk.samples.navigation,com.locnall.KimGiSa:21000 (string)
11-01 14:38:00.953 11220 11220 I XLua.Xposed: Log com.google.android.projection.gearhead:10144 UnlockAA.Phenotype.String ControlSupportedNavApps__allowlisted_touchpad_nav_packages = com.waze:1022171,com.waze.alpha,com.google.android.apps.gmm.dev,com.google.android.apps.gmm.car,com.google.android.apps.gmm.fishfood,com.google.android.apps.gmm,com.google.android.apps.gmm.qp,com.google.android.apps.maps,com.locnall.KimGiSa:21055,com.google.android.apps.auto.sdk.samples.chargingstations,com.google.android.apps.auto.sdk.samples.navigation (string)
11-01 14:38:00.956 11220 11220 I XLua.Xposed: Log com.google.android.projection.gearhead:10144 UnlockAA.Phenotype.Boolean ConnectivityLogging__always_log_bluetooth_disconnect = false (string)
11-01 14:38:00.957 11220 11220 I XLua.Xposed: Log com.google.android.projection.gearhead:10144 UnlockAA.Phenotype.String AndroidAuto__apps_url = https://play.google.com/store/apps/stream/promotion_collections_android_auto (string)
11-01 14:38:00.957 11220 11220 I XLua.Xposed: Log com.google.android.projection.gearhead:10144 UnlockAA.Phenotype.String AndroidAuto__autolaunch_partner_apps = com.logitech.smartcarmount (string)

When I enable/disable AA in XPL I see

11-01 14:49:19.836  6250 10887 I XLua.Provider: com.google.android.projection.gearhead:10144/UnlockAA.Phenotype.Boolean deleted
11-01 14:49:19.836  6250 10887 I XLua.Provider: com.google.android.projection.gearhead:10144/UnlockAA.Phenotype.Double deleted
11-01 14:49:19.836  6250 10887 I XLua.Provider: com.google.android.projection.gearhead:10144/UnlockAA.Phenotype.Float deleted
11-01 14:49:19.836  6250 10887 I XLua.Provider: com.google.android.projection.gearhead:10144/UnlockAA.Phenotype.Int deleted
11-01 14:49:19.836  6250 10887 I XLua.Provider: com.google.android.projection.gearhead:10144/UnlockAA.Phenotype.Long deleted
11-01 14:49:19.836  6250 10887 I XLua.Provider: com.google.android.projection.gearhead:10144/UnlockAA.Phenotype.String deleted
11-01 14:49:23.948  6250  8603 I XLua.Provider: com.google.android.projection.gearhead:10144/UnlockAA.Phenotype.Boolean added
11-01 14:49:23.948  6250  8603 I XLua.Provider: com.google.android.projection.gearhead:10144/UnlockAA.Phenotype.Double added
11-01 14:49:23.948  6250  8603 I XLua.Provider: com.google.android.projection.gearhead:10144/UnlockAA.Phenotype.Float added
11-01 14:49:23.948  6250  8603 I XLua.Provider: com.google.android.projection.gearhead:10144/UnlockAA.Phenotype.Int added
11-01 14:49:23.948  6250  8603 I XLua.Provider: com.google.android.projection.gearhead:10144/UnlockAA.Phenotype.Long added
11-01 14:49:23.948  6250  8603 I XLua.Provider: com.google.android.projection.gearhead:10144/UnlockAA.Phenotype.String added

Whats did I wrong? All the hooks (8.2) appear, but not the unlock.json.

UnlockAA commented 1 year ago

So far everything looks correct.
Did you check both boxes in XPrivacyLua for Android Auto?
According to logs, ManipulatePhenotype is active. What about UnlockApps below?

The log lines are there for experimentation, you can see what it loads with which default values.
You can change it in the scripts as needed. There should be examples in there too. For example, enable Coolwalk If you are bothered by the log lines, you can edit the script and comment out the log line.

alexanderrogling commented 1 year ago

Go in to LSPosed and go in to modules then in to XprivacyLUA and enable both recommended and Android Auto and maybe it will work for you I'm pretty sure that was the thing making it to work for me, I did have same problem like you in the begging and did gave up and suddenly it did work.

Which was probably because of enable Android Auto in XprivacyLUA module in lsposed.

alexanderrogling commented 1 year ago

Good news everybody I have found what was making it work for me, so later this week I will probably releas it to the public and with a pull request :)

An e-mail address will come here (today 2023-02-23) where interested parties should send an e-mail if interested and don't want to wait until I have try it a bit more on my devices.

starbrights commented 1 year ago

Great news you got it. But do you have to tweak what UnlockAA did? The Xprivacy handling is a bit tricky, but once you understand it works well. The only drawback with that solution: updates are a bit painful, as you have to fiddle out the params for each version.

alexanderrogling commented 1 year ago

Yes, I had to tweak what UnlockAA did in order to get it to work on AA 8.2.6.623924. While the Xprivacy handling can be a bit tricky, I agree that updates can be painful as you have to fiddle with the params for each version.

Unfortunately, even with the minor change I made to the maxAPK parameter (from 82623924 to 82623925), UnlockAA still doesn't work perfectly with AA 8.2.6.623924 on Android 13 (well UnlockAA work but has side effects that people would blame UnlockAA for).

As Screen2Auto tends to crash frequently, As a result, I haven't sent a pull request yet, as I'm concerned that people may complain that it "works" but not as expected.

Another thing is that with CoolWalk enabled Plex, PlexAMP just straight out crashes when trying to load it "fullscreen" when CoolWalk is enabled, So I need to take contact with people from Plex or search on there forum if they know that Plex and PlexAMP straight out crashes when using CoolWalk.

However, I may still consider doing a pull request, as I know it works as expected on A12, when it comes to Screen2Auto and other stuff that works as expected when using CoolWalk.

Would love to be able to get a handout to even get it to work on newer AA but to be honest I'm not even close to paintience enough to be able to understand how to use it and how much is req. to get it work on newer AA.

starbrights commented 1 year ago

I figured out to get it working once at a newer version (85624534 - see below): It needs to be decompiled AA - and honestly I didn't understood the code - just looked for some special words. If you look at the now 3 examples you might figure out that only 4 lines are to be changed, and two are the version. Other are className and methodName. As a securitiy feature this names changed in each version. Not sure I will get it work again. For me it was just important to get any other Navigation than Google to work. I plan to touch this again once switching to A13, but I hope that other easier methods might be available than. Nevertheless big thanks to UnlockerAA from my side.

{
  "builtin": false,
  "collection": "UnlockAA",
  "group": "UnlockApps",
  "name": "Unlock.all.apps",
  "author": "UnlockAA",
  "version": 1,
  "description": "Unlock all apps",
  "className": "cms",
  "methodName": "q",
  "parameterTypes": [
    "java.lang.String",
    "ibj",
    "boolean",
    "boolean",
    "boolean"
  ],
  "returnType": "boolean",
  "minSdk": 1,
  "maxSdk": 923,
  "minApk": 85624534,
  "maxApk": 85624534,
  "enabled": true,
  "optional": false,
  "usage": true,
  "notify": false,
  "luaScript": "-- Copyright (C) 2022 UnlockAA\n\n-- This is free software: you can redistribute it and/or modify\n-- it under the terms of the GNU General Public License as published by\n-- the Free Software Foundation, either version 3 of the License, or\n-- (at your option) any later version.\n\n-- This is distributed in the hope that it will be useful,\n-- but WITHOUT ANY WARRANTY; without even the implied warranty of\n-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n-- GNU General Public License for more details.\n\n-- You should have received a copy of the GNU General Public License\n-- along with XPrivacyLua. If not, see <http://www.gnu.org/licenses/>.\n\nfunction before(hook, param)\n    local fake = true\n    param:setResult(fake)\n    return true\nend\n"
}
alexanderrogling commented 1 year ago

@starbrights instead of us "flooding" this report/req. you could send me e-mail to aa_patch@rar-network.se (an redirect e-mail so the reply from me will come from different e-mail adress) or if using Discord join https://discord.gg/py5HauWNPj and we could talk on one of those options :)

As I have some ideas that I would love to bounce with somebody that seems to have at least so much knowledge about programming if not more then I do.

bblacher commented 1 year ago

I finally got it working for me, planning on adding the instructions myself. In the meantime, would you care to take a look at this, I would love to add update instructions as well.

alexanderrogling commented 1 year ago

IF you e-mail me on above e-mail. Then we could probably make up a new patch and do a pull request, stupid to reinvent the wheel IF you havet fix it better then I have

bblacher commented 1 year ago

@alexanderrogling I'll get on it this weekend.

bblacher commented 1 year ago

We don't need this anymore because of this.