[Android Auto General] Jen94:
SOLUTION FOR A MIRROR ON LAST GMS/AA WITHOUT DANCING AROUND IT

inserted 10.12.2018
Meet the AA Phenotype Patcher: https://xdaforums.com/showpost.php?p=78402151&postcount=317
Stated that he does everything for you completely, even sql puts, but personally did not check.

1. First of all, delete all your unlockers. They are not needed anymore

2. Turn back on Chimera and all previously disabled Google services. They do not interfere with the work of the mirror.

3. Switch Android Auto to Release mode, uncheck Unknown sources

4. Install Termux https://play.google.com/store/apps/details?id=com.termux&hl=ru

5. Install Sqlite3 for root, launch it and click Install. https://play.google.com/store/apps/details?id=com.kanolato.sqlite&hl=ru

6. Go to Termux.

Perform successive commands and restart the phone. After that, AAMirror will always remain in the list of Android Auto applications, with the latest versions of services and the application itself. No loss anymore.

0

su

1. Open DB

sqlite3 /data/data/com.google.android.gms/databases/phenotype.db

2. Insert flags

INSERT OR REPLACE INTO Flags (packageName, version, flagType, partitionId, user, name, stringVal, committed) VALUES ("com.google.android.gms.car#car", 234, 0, 0, "", "app_white_list", "com.github.slashmax.aamirror",1);
INSERT OR REPLACE INTO Flags (packageName, version, flagType, partitionId, user, name, stringVal, committed) VALUES ("com.google.android.gms.car#car", 230, 0, 0, "", "app_white_list", "com.github.slashmax.aamirror",1);
INSERT OR REPLACE INTO Flags (packageName, version, flagType, partitionId, user, name, stringVal, committed) VALUES ("com.google.android.gms.car", 234, 0, 0, "", "app_white_list", "com.github.slashmax.aamirror",1);
INSERT OR REPLACE INTO Flags (packageName, version, flagType, partitionId, user, name, stringVal, committed) VALUES ("com.google.android.gms.car", 230, 0, 0, "", "app_white_list", "com.github.slashmax.aamirror",1);
INSERT OR REPLACE INTO Flags (packageName, version, flagType, partitionId, user, name, stringVal, committed) VALUES ("com.google.android.gms.car#car_setup", 234, 0, 0, "", "app_white_list", "com.github.slashmax.aamirror",1);
INSERT OR REPLACE INTO Flags (packageName, version, flagType, partitionId, user, name, stringVal, committed) VALUES ("com.google.android.gms.car#car_setup", 230, 0, 0, "", "app_white_list", "com.github.slashmax.aamirror",1);
INSERT OR REPLACE INTO Flags (packageName, version, flagType, partitionId, user, name, stringVal, committed) VALUES ("com.google.android.gms.car#car", (SELECT version FROM Packages WHERE packageName="com.google.android.gms.car#car"), 0, 0, "", "app_white_list", "com.github.slashmax.aamirror",1);
INSERT OR REPLACE INTO Flags (packageName, version, flagType, partitionId, user, name, stringVal, committed) VALUES ("com.google.android.gms.car", (SELECT version FROM Packages WHERE packageName="com.google.android.gms.car"), 0, 0, "", "app_white_list", "com.github.slashmax.aamirror",1);
INSERT OR REPLACE INTO Flags (packageName, version, flagType, partitionId, user, name, stringVal, committed) VALUES ("com.google.android.gms.car#car_setup", (SELECT version FROM Packages WHERE packageName="com.google.android.gms.car#car"), 0, 0, "", "app_white_list", "com.github.slashmax.aamirror",1);

If you encounter Error NOT NULL constraintfailed: Flags.version (and only in this case, because car instead of car # car is used extremely rarely on phones and there is no way to check, it may not work!) Try

INSERT OR REPLACE INTO Flags (packageName, version, flagType, partitionId, user, name, stringVal, committed) VALUES ("com.google.android.gms.car#car", 234, 0, 0, "", "app_white_list", "com.github.slashmax.aamirror",1);
INSERT OR REPLACE INTO Flags (packageName, version, flagType, partitionId, user, name, stringVal, committed) VALUES ("com.google.android.gms.car#car", 230, 0, 0, "", "app_white_list", "com.github.slashmax.aamirror",1);
INSERT OR REPLACE INTO Flags (packageName, version, flagType, partitionId, user, name, stringVal, committed) VALUES ("com.google.android.gms.car", 234, 0, 0, "", "app_white_list", "com.github.slashmax.aamirror",1);
INSERT OR REPLACE INTO Flags (packageName, version, flagType, partitionId, user, name, stringVal, committed) VALUES ("com.google.android.gms.car", 230, 0, 0, "", "app_white_list", "com.github.slashmax.aamirror",1);
INSERT OR REPLACE INTO Flags (packageName, version, flagType, partitionId, user, name, stringVal, committed) VALUES ("com.google.android.gms.car#car_setup", 234, 0, 0, "", "app_white_list", "com.github.slashmax.aamirror",1);
INSERT OR REPLACE INTO Flags (packageName, version, flagType, partitionId, user, name, stringVal, committed) VALUES ("com.google.android.gms.car#car_setup", 230, 0, 0, "", "app_white_list", "com.github.slashmax.aamirror",1);
INSERT OR REPLACE INTO Flags (packageName, version, flagType, partitionId, user, name, stringVal, committed) VALUES ("com.google.android.gms.car#car", (SELECT version FROM Packages WHERE packageName="com.google.android.gms.car"), 0, 0, "", "app_white_list", "com.github.slashmax.aamirror",1);
INSERT OR REPLACE INTO Flags (packageName, version, flagType, partitionId, user, name, stringVal, committed) VALUES ("com.google.android.gms.car", (SELECT version FROM Packages WHERE packageName="com.google.android.gms.car"), 0, 0, "", "app_white_list", "com.github.slashmax.aamirror",1);
INSERT OR REPLACE INTO Flags (packageName, version, flagType, partitionId, user, name, stringVal, committed) VALUES ("com.google.android.gms.car#car_setup", (SELECT version FROM Packages WHERE packageName="com.google.android.gms.car"), 0, 0, "", "app_white_list", "com.github.slashmax.aamirror",1);

If there is a failure here, try the third option (often does not work, but try to do it)

INSERT OR REPLACE INTO Flags (packageName, version, flagType, partitionId, user, name, stringVal, committed) VALUES ("com.google.android.gms.car#car", 240, 0, 0, "", "app_white_list", "com.github.slashmax.aamirror",1);
INSERT OR REPLACE INTO Flags (packageName, version, flagType, partitionId, user, name, stringVal, committed) VALUES ("com.google.android.gms.car#car", (SELECT version FROM ApplicationStates WHERE packageName="com.google.android.gms.car#car"), 0, 0, "", "app_white_list", "com.github.slashmax.aamirror",1);
INSERT OR REPLACE INTO Flags (packageName, version, flagType, partitionId, user, name, stringVal, committed) VALUES ("com.google.android.gms.car", 240, 0, 0, "", "app_white_list", "com.github.slashmax.aamirror",1);
INSERT OR REPLACE INTO Flags (packageName, version, flagType, partitionId, user, name, stringVal, committed) VALUES ("com.google.android.gms.car", (SELECT version FROM ApplicationStates WHERE packageName="com.google.android.gms.car"), 0, 0, "", "app_white_list", "com.github.slashmax.aamirror",1);

And fourth solution

INSERT OR REPLACE INTO Flags (packageName, version, flagType, partitionId, user, name, stringVal, committed) VALUES ("com.google.android.gms.car", 240, 0, 0, "", "app_white_list", "com.github.slashmax.aamirror",1);
INSERT OR REPLACE INTO Flags (packageName, version, flagType, partitionId, user, name, stringVal, committed) VALUES ("com.google.android.gms.car", (SELECT version FROM ApplicationStates WHERE packageName="com.google.android.gms.car"), 0, 0, "", "app_white_list", "com.github.slashmax.aamirror",1);

3. Make a trigger to prevent their removal (only if there were no errors in the previous paragraph)

If in the last paragraph there were no errors:

CREATE TRIGGER after_delete AFTER DELETE
ON Flags
BEGIN
INSERT OR REPLACE INTO Flags (packageName, version, flagType, partitionId, user, name, stringVal, committed) VALUES ("com.google.android.gms.car#car", (SELECT version FROM Packages WHERE packageName="com.google.android.gms.car#car"), 0, 0, "", "app_white_list", "com.github.slashmax.aamirror",1);
INSERT OR REPLACE INTO Flags (packageName, version, flagType, partitionId, user, name, stringVal, committed) VALUES ("com.google.android.gms.car#car", 230, 0, 0, "", "app_white_list", "com.github.slashmax.aamirror",1);
INSERT OR REPLACE INTO Flags (packageName, version, flagType, partitionId, user, name, stringVal, committed) VALUES ("com.google.android.gms.car#car", 234, 0, 0, "", "app_white_list", "com.github.slashmax.aamirror",1);
INSERT OR REPLACE INTO Flags (packageName, version, flagType, partitionId, user, name, stringVal, committed) VALUES ("com.google.android.gms.car", (SELECT version FROM Packages WHERE packageName="com.google.android.gms.car"), 0, 0, "", "app_white_list", "com.github.slashmax.aamirror",1);
INSERT OR REPLACE INTO Flags (packageName, version, flagType, partitionId, user, name, stringVal, committed) VALUES ("com.google.android.gms.car", 230, 0, 0, "", "app_white_list", "com.github.slashmax.aamirror",1);
INSERT OR REPLACE INTO Flags (packageName, version, flagType, partitionId, user, name, stringVal, committed) VALUES ("com.google.android.gms.car", 234, 0, 0, "", "app_white_list", "com.github.slashmax.aamirror",1);
INSERT OR REPLACE INTO Flags (packageName, version, flagType, partitionId, user, name, stringVal, committed) VALUES ("com.google.android.gms.car#car_setup", (SELECT version FROM Packages WHERE packageName="com.google.android.gms.car#car"), 0, 0, "", "app_white_list", "com.github.slashmax.aamirror",1);
INSERT OR REPLACE INTO Flags (packageName, version, flagType, partitionId, user, name, stringVal, committed) VALUES ("com.google.android.gms.car#car_setup", 230, 0, 0, "", "app_white_list", "com.github.slashmax.aamirror",1);
INSERT OR REPLACE INTO Flags (packageName, version, flagType, partitionId, user, name, stringVal, committed) VALUES ("com.google.android.gms.car#car_setup", 234, 0, 0, "", "app_white_list", "com.github.slashmax.aamirror",1);
END;

If in the previous paragraph you had to use an first alternative option:

CREATE TRIGGER after_delete AFTER DELETE
ON Flags
BEGIN
INSERT OR REPLACE INTO Flags (packageName, version, flagType, partitionId, user, name, stringVal, committed) VALUES ("com.google.android.gms.car#car", (SELECT version FROM Packages WHERE packageName="com.google.android.gms.car"), 0, 0, "", "app_white_list", "com.github.slashmax.aamirror",1);
INSERT OR REPLACE INTO Flags (packageName, version, flagType, partitionId, user, name, stringVal, committed) VALUES ("com.google.android.gms.car#car", 230, 0, 0, "", "app_white_list", "com.github.slashmax.aamirror",1);
INSERT OR REPLACE INTO Flags (packageName, version, flagType, partitionId, user, name, stringVal, committed) VALUES ("com.google.android.gms.car#car", 234, 0, 0, "", "app_white_list", "com.github.slashmax.aamirror",1);
INSERT OR REPLACE INTO Flags (packageName, version, flagType, partitionId, user, name, stringVal, committed) VALUES ("com.google.android.gms.car", (SELECT version FROM Packages WHERE packageName="com.google.android.gms.car"), 0, 0, "", "app_white_list", "com.github.slashmax.aamirror",1);
INSERT OR REPLACE INTO Flags (packageName, version, flagType, partitionId, user, name, stringVal, committed) VALUES ("com.google.android.gms.car", 230, 0, 0, "", "app_white_list", "com.github.slashmax.aamirror",1);
INSERT OR REPLACE INTO Flags (packageName, version, flagType, partitionId, user, name, stringVal, committed) VALUES ("com.google.android.gms.car", 234, 0, 0, "", "app_white_list", "com.github.slashmax.aamirror",1);
INSERT OR REPLACE INTO Flags (packageName, version, flagType, partitionId, user, name, stringVal, committed) VALUES ("com.google.android.gms.car#car_setup", (SELECT version FROM Packages WHERE packageName="com.google.android.gms.car"), 0, 0, "", "app_white_list", "com.github.slashmax.aamirror",1);
INSERT OR REPLACE INTO Flags (packageName, version, flagType, partitionId, user, name, stringVal, committed) VALUES ("com.google.android.gms.car#car_setup", 230, 0, 0, "", "app_white_list", "com.github.slashmax.aamirror",1);
INSERT OR REPLACE INTO Flags (packageName, version, flagType, partitionId, user, name, stringVal, committed) VALUES ("com.google.android.gms.car#car_setup", 234, 0, 0, "", "app_white_list", "com.github.slashmax.aamirror",1);
END;

If in the previous paragraph the third option worked

CREATE TRIGGER after_delete AFTER DELETE
ON Flags
BEGIN
INSERT OR REPLACE INTO Flags (packageName, version, flagType, partitionId, user, name, stringVal, committed) VALUES ("com.google.android.gms.car#car", 240, 0, 0, "", "app_white_list", "com.github.slashmax.aamirror",1);
INSERT OR REPLACE INTO Flags (packageName, version, flagType, partitionId, user, name, stringVal, committed) VALUES ("com.google.android.gms.car#car", (SELECT version FROM ApplicationStates WHERE packageName="com.google.android.gms.car#car"), 0, 0, "", "app_white_list", "com.github.slashmax.aamirror",1);
INSERT OR REPLACE INTO Flags (packageName, version, flagType, partitionId, user, name, stringVal, committed) VALUES ("com.google.android.gms.car", 240, 0, 0, "", "app_white_list", "com.github.slashmax.aamirror",1);
INSERT OR REPLACE INTO Flags (packageName, version, flagType, partitionId, user, name, stringVal, committed) VALUES ("com.google.android.gms.car", (SELECT version FROM ApplicationStates WHERE packageName="com.google.android.gms.car"), 0, 0, "", "app_white_list", "com.github.slashmax.aamirror",1);
END;

If in the previous paragraph only the fourth option worked

CREATE TRIGGER after_delete AFTER DELETE
ON Flags
BEGIN
INSERT OR REPLACE INTO Flags (packageName, version, flagType, partitionId, user, name, stringVal, committed) VALUES ("com.google.android.gms.car", 240, 0, 0, "", "app_white_list", "com.github.slashmax.aamirror",1);
INSERT OR REPLACE INTO Flags (packageName, version, flagType, partitionId, user, name, stringVal, committed) VALUES ("com.google.android.gms.car", (SELECT version FROM ApplicationStates WHERE packageName="com.google.android.gms.car"), 0, 0, "", "app_white_list", "com.github.slashmax.aamirror",1);
END;

Note

If, when creating a trigger, you see ERROR: trigger after_delete already exists, but you want to recreate it, execute

DROP TRIGGER after_delete;

Then create anew

Check your trigger to prevent messages "not working, go away". Just execute:

SELECT * FROM Flags WHERE name="app_white_list";

You may see 6 or more added by you flags.

Then, try to remove it!

DELETE FROM Flags WHERE name="app_white_list";

And select again:

SELECT * FROM Flags WHERE name="app_white_list";

Only if result not empty (maybe not equal 2 commands ago, but not empty), you do all correctly. Else not.

If you raise the version of the car # car application, a temporary loss of AAMirror is possible (until a trigger is triggered, which determines the new version). To fix it quickly, repeat step 2. This fact should be taken into account.

Hint: you can add any other AA-applications, separated by a comma, not only aamirror

Example: "com.github.slashmax.aamirror,com.app.test"

Important! If you see "sqlite3 not found" in the terminal as root, then sqlite3 has not been established for the root and you need to find a solution for your phone!

Until you install it, nothing will work. If existing installers do not work (or work, but still sqlite3 not found), try to turn to the theme of the firmware specifically for your device.

All I can offer is to try from root /system/xbin/sqlite3 or /system/bin/sqlite3 instead of just sqlite3.

Still, perhaps it will help: i added the xbin folder to the system folder. The error is gone.

For the future: https://xdaforums.com/showpost.php?p=78347721&postcount=1313

If you get black screen: https://xdaforums.com/showpost.php?p=78548457&postcount=383