Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

App in crash after enabling the calendar option #14

Open
woody4165 opened this issue Mar 5, 2021 · 59 comments
Open

App in crash after enabling the calendar option #14

woody4165 opened this issue Mar 5, 2021 · 59 comments

Comments

@woody4165
Copy link

Hi

I've enabled some of the options, but after enabling the calendar one, leaving 1 day, and after rebooting the phone, when entering again in the app, after clicking the "I understand" button, the app crashes and continue crashing

This is the message I get

Screenshot_2021-03-05-16-20-30-796_com miui bugreport

Screenshot_2021-03-05-16-20-37-462_com miui bugreport

What can I do now to let the app works again?

Thanks

@woody4165
Copy link
Author

woody4165 commented Mar 5, 2021

I've cleared all the data and then also uninstalled and reinstalled the app, but it still crashes.
What can I check to let it work again?

Thanks

Logcat

FATAL EXCEPTION: main
Process: sksa.aa.tweaker, PID: 13658
java.lang.RuntimeException: Unable to start activity ComponentInfo{sksa.aa.tweaker/sksa.aa.tweaker.MainActivity}: java.lang.NumberFormatException: For input string: ""
	at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3313)
	at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3462)
	at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:83)
	at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135)
	at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95)
	at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2049)
	at android.os.Handler.dispatchMessage(Handler.java:107)
	at android.os.Looper.loop(Looper.java:224)
	at android.app.ActivityThread.main(ActivityThread.java:7565)
	at java.lang.reflect.Method.invoke(Native Method)
	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:539)
	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:950)
Caused by: java.lang.NumberFormatException: For input string: ""
	at java.lang.Integer.parseInt(Integer.java:627)
	at java.lang.Integer.parseInt(Integer.java:650)
	at sksa.aa.tweaker.MainActivity$u1.run(Unknown Source:187)
	at android.app.Activity.runOnUiThread(Activity.java:6989)
	at sksa.aa.tweaker.MainActivity.J0(Unknown Source:19)
	at sksa.aa.tweaker.MainActivity.onCreate(Unknown Source:13)
	at android.app.Activity.performCreate(Activity.java:7916)
	at android.app.Activity.performCreate(Activity.java:7903)
	at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1307)
	at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3288)
	... 11 more
checkOperation
java.lang.SecurityException: Specified package sksa.aa.tweaker under uid 10219 but it is really -1
	at com.android.server.appop.AppOpsService.verifyAndGetIsPrivileged(AppOpsService.java:2829)
	at com.android.server.appop.AppOpsService.checkOperationUnchecked(AppOpsService.java:1903)
	at com.android.server.appop.AppOpsService.checkOperationUnchecked(AppOpsService.java:1885)
	at com.android.server.appop.AppOpsService.checkOperationImpl(AppOpsService.java:1870)
	at com.android.server.appop.AppOpsService.checkOperationInternal(AppOpsService.java:1849)
	at com.android.server.appop.AppOpsService.checkOperation(AppOpsService.java:1840)
	at com.android.server.am.AutoStartManagerService.canRestartServiceLocked(AutoStartManagerService.java:144)
	at com.android.server.am.AutoStartManagerService.canRestartServiceLocked(AutoStartManagerService.java:133)
	at com.android.server.am.AutoStartManagerService.signalStopProcessesLocked(AutoStartManagerService.java:157)
	at com.android.server.am.ProcessList.killPackageProcessesLocked(ProcessList.java:2262)
	at com.android.server.am.ActivityManagerService.forceStopPackageLocked(ActivityManagerService.java:4838)
	at com.android.server.am.ActivityManagerService.broadcastIntentLocked(ActivityManagerService.java:15471)
	at com.android.server.am.ActivityManagerService.broadcastIntentLocked(ActivityManagerService.java:15212)
	at com.android.server.am.ActivityManagerService.broadcastIntent(ActivityManagerService.java:16006)
	at com.android.server.pm.PackageManagerService.doSendBroadcast(PackageManagerService.java:13556)
	at com.android.server.pm.PackageManagerService.lambda$sendPackageBroadcast$8$PackageManagerService(PackageManagerService.java:13454)
	at com.android.server.pm.-$$Lambda$PackageManagerService$UtVCpL0mJ1ePNHwGgkapgCkTreo.run(Unknown Source:18)
	at android.os.Handler.handleCallback(Handler.java:883)
	at android.os.Handler.dispatchMessage(Handler.java:100)
	at android.os.Looper.loop(Looper.java:224)
	at android.os.HandlerThread.run(HandlerThread.java:67)
	at com.android.server.ServiceThread.run(ServiceThread.java:45)

@shmykelsa
Copy link
Owner

Please try version 3.2 and let me know if this is fixed

@woody4165
Copy link
Author

Thanks @shmykelsa

This version solved the app crash and now it's working again...

Choosing again Calendar option, I have to choose a value higher than 1 (is it correct?).
If I choose 2 (and maybe another value), tells me that command did not succeed and tells me to wait a minute and retry.
I did it and I see the option on, but with value 0.
So, I disabled again the option, rebooted, chosed another value (tried 2-3-4) and I get again the same message.
I see that now it's possible to send issue directly here, should I send it?

Thanks

@shmykelsa
Copy link
Owner

Thanks @shmykelsa

This version solved the app crash and now it's working again...

Choosing again Calendar option, I have to choose a value higher than 1 (is it correct?).

Yes it is. 1 is default value so makes no sense to apply 1

If I choose 2 (and maybe another value), tells me that command did not succeed and tells me to wait a minute and retry.

When you were doing this, did you have a green status near the button?

I did it and I see the option on, but with value 0.
So, I disabled again the option, rebooted, chosed another value (tried 2-3-4) and I get again the same message.

Probably it's a good idea to choose to revert everything and start from a clean base

I see that now it's possible to send issue directly here, should I send it?

Thanks

@woody4165
Copy link
Author

I've reverted everything, then rebooted phone, restarted with all options red, started only with calendar sat to 2 and I get same error

@shmykelsa
Copy link
Owner

When you apply the option, does the log show an error like "ERROR: Database is locked"?

@woody4165
Copy link
Author

woody4165 commented Mar 7, 2021

8I get this message

Screenshot_2021-03-07-10-19-48-463_sksa aa tweaker

And this log

REGISTRO:


-- Drop Triggers  --
	OutputStream:
		/data/user/0/sksa.aa.tweaker/sqlite3 /data/data/com.google.android.gms/databases/phenotype.db 'DROP TRIGGER IF EXISTS calendar_aa_tweak;'

--  run SQL method   --
	OutputStream:
		/data/user/0/sksa.aa.tweaker/sqlite3 /data/data/com.google.android.gms/databases/phenotype.db 'DELETE FROM Flags WHERE name="McFly__num_days_in_agenda_view";
		INSERT OR REPLACE INTO FlagOverrides (packageName, flagType, name, user, intVal, committed) VALUES ("com.google.android.projection.gearhead",0,"McFly__num_days_in_agenda_view", (SELECT DISTINCT user FROM Flags WHERE user != ""LIMIT 0,1),2,1);
		INSERT OR REPLACE INTO FlagOverrides (packageName, flagType, name, user, intVal, committed) VALUES ("com.google.android.projection.gearhead",0,"McFly__num_days_in_agenda_view", (SELECT DISTINCT user FROM Flags WHERE user != ""LIMIT 1,1),2,1);
		INSERT OR REPLACE INTO FlagOverrides (packageName, flagType, name, user, intVal, committed) VALUES ("com.google.android.projection.gearhead",0,"McFly__num_days_in_agenda_view", (SELECT DISTINCT user FROM Flags WHERE user != ""LIMIT 2,1),2,1);
		'
	ErrorStream:
		Error: unable to open database file
	OutputStream:
		/data/user/0/sksa.aa.tweaker/sqlite3 /data/data/com.google.android.gms/databases/phenotype.db 'CREATE TRIGGER calendar_aa_tweak AFTER DELETE
		ON FlagOverrides
		BEGIN
		INSERT OR REPLACE INTO FlagOverrides (packageName, flagType, name, user, intVal, committed) VALUES ("com.google.android.projection.gearhead",0,"McFly__num_days_in_agenda_view", (SELECT DISTINCT user FROM Flags WHERE user != ""LIMIT 0,1),2,1);
		INSERT OR REPLACE INTO FlagOverrides (packageName, flagType, name, user, intVal, committed) VALUES ("com.google.android.projection.gearhead",0,"McFly__num_days_in_agenda_view", (SELECT DISTINCT user FROM Flags WHERE user != ""LIMIT 1,1),2,1);
		INSERT OR REPLACE INTO FlagOverrides (packageName, flagType, name, user, intVal, committed) VALUES ("com.google.android.projection.gearhead",0,"McFly__num_days_in_agenda_view", (SELECT DISTINCT user FROM Flags WHERE user != ""LIMIT 2,1),2,1);
		END;'

Then I see this

IMG_20210307_105751

@shmykelsa
Copy link
Owner

Uhm, it seems like many operations are giving hard time to the database.

Is this the only tweak not working?

@woody4165
Copy link
Author

woody4165 commented Mar 7, 2021

I will try now.
Just one clarification, if I want to apply several options, should I apply them one by one and then reboot everytime, or can I apply some or all I want all in one time?

@shmykelsa
Copy link
Owner

There should be no contraindications in doing them all in one time, however there's the risk that after doing many of them the database locks itself because of the too many operations. In that case, with the latest update, the app has been made stronger to handle this errors better and have a bit of a cooldown before making a new move.

@woody4165
Copy link
Author

I had another crash setting up 3 options together when choosing also the "enable cards in multimedia app"
Reverting the option after a reboot, I get this log.

REGISTRO:


-- Reverting the hack  --
	OutputStream:
		/data/user/0/sksa.aa.tweaker/sqlite3 /data/data/com.google.android.gms/databases/phenotype.db 'DROP TRIGGER IF EXISTS aa_media_tabs;'
	OutputStream:
		/data/user/0/sksa.aa.tweaker/sqlite3 /data/data/com.google.android.gms/databases/phenotype.db 'DELETE FROM FlagOverrides;'
	ErrorStream:
		Error: database is locked

@shmykelsa
Copy link
Owner

And other tweaks are reverted/applied fine?

@woody4165
Copy link
Author

Also another option gives me error
The one for enabling cards in multimedia apps

REGISTRO:


-- Drop Triggers  --
	OutputStream:
		/data/user/0/sksa.aa.tweaker/sqlite3 /data/data/com.google.android.gms/databases/phenotype.db 'DROP TRIGGER IF EXISTS aa_media_tabs;'

--  run SQL method   --
	OutputStream:
		/data/user/0/sksa.aa.tweaker/sqlite3 /data/data/com.google.android.gms/databases/phenotype.db 'INSERT OR REPLACE INTO FlagOverrides (packageName, flagType,  name, user, boolVal, committed) VALUES ("com.google.android.projection.gearhead",0,"Tabbouleh__tabs_media_enabled", (SELECT DISTINCT user FROM Flags WHERE user != ""LIMIT 0,1) ,1,1);
		INSERT OR REPLACE INTO FlagOverrides (packageName, flagType,  name, user, boolVal, committed) VALUES ("com.google.android.projection.gearhead",0,"Tabbouleh__media_browse_back_to_top_level_button_enabled", (SELECT DISTINCT user FROM Flags WHERE user != ""LIMIT 0,1) ,1,1);
		INSERT OR REPLACE INTO FlagOverrides (packageName, flagType,  name, user, boolVal, committed) VALUES ("com.google.android.projection.gearhead",0,"Tabbouleh__tabs_media_sticky_tab_enabled", (SELECT DISTINCT user FROM Flags WHERE user != ""LIMIT 0,1) ,1,1);
		INSERT OR REPLACE INTO FlagOverrides (packageName, flagType,  name, user, boolVal, committed) VALUES ("com.google.android.projection.gearhead",0,"Tabbouleh__tabs_media_enabled", (SELECT DISTINCT user FROM Flags WHERE user != ""LIMIT 1,1) ,1,1);
		INSERT OR REPLACE INTO FlagOverrides (packageName, flagType,  name, user, boolVal, committed) VALUES ("com.google.android.projection.gearhead",0,"Tabbouleh__media_browse_back_to_top_level_button_enabled", (SELECT DISTINCT user FROM Flags WHERE user != ""LIMIT 1,1) ,1,1);
		INSERT OR REPLACE INTO FlagOverrides (packageName, flagType,  name, user, boolVal, committed) VALUES ("com.google.android.projection.gearhead",0,"Tabbouleh__tabs_media_sticky_tab_enabled", (SELECT DISTINCT user FROM Flags WHERE user != ""LIMIT 1,1) ,1,1);
		INSERT OR REPLACE INTO FlagOverrides (packageName, flagType,  name, user, boolVal, committed) VALUES ("com.google.android.projection.gearhead",0,"Tabbouleh__tabs_media_enabled", (SELECT DISTINCT user FROM Flags WHERE user != ""LIMIT 2,1) ,1,1);
		INSERT OR REPLACE INTO FlagOverrides (packageName, flagType,  name, user, boolVal, committed) VALUES ("com.google.android.projection.gearhead",0,"Tabbouleh__media_browse_back_to_top_level_button_enabled", (SELECT DISTINCT user FROM Flags WHERE user != ""LIMIT 2,1) ,1,1);
		INSERT OR REPLACE INTO FlagOverrides (packageName, flagType,  name, user, boolVal, committed) VALUES ("com.google.android.projection.gearhead",0,"Tabbouleh__tabs_media_sticky_tab_enabled", (SELECT DISTINCT user FROM Flags WHERE user != ""LIMIT 2,1) ,1,1);
		'
	ErrorStream:
		Error: unable to open database file
	OutputStream:
		/data/user/0/sksa.aa.tweaker/sqlite3 /data/data/com.google.android.gms/databases/phenotype.db 'CREATE TRIGGER aa_media_tabs AFTER DELETE
		ON FlagOverrides
		BEGIN
		INSERT OR REPLACE INTO FlagOverrides (packageName, flagType,  name, user, boolVal, committed) VALUES ("com.google.android.projection.gearhead",0,"Tabbouleh__tabs_media_enabled", (SELECT DISTINCT user FROM Flags WHERE user != ""LIMIT 0,1) ,1,1);
		INSERT OR REPLACE INTO FlagOverrides (packageName, flagType,  name, user, boolVal, committed) VALUES ("com.google.android.projection.gearhead",0,"Tabbouleh__media_browse_back_to_top_level_button_enabled", (SELECT DISTINCT user FROM Flags WHERE user != ""LIMIT 0,1) ,1,1);
		INSERT OR REPLACE INTO FlagOverrides (packageName, flagType,  name, user, boolVal, committed) VALUES ("com.google.android.projection.gearhead",0,"Tabbouleh__tabs_media_sticky_tab_enabled", (SELECT DISTINCT user FROM Flags WHERE user != ""LIMIT 0,1) ,1,1);
		INSERT OR REPLACE INTO FlagOverrides (packageName, flagType,  name, user, boolVal, committed) VALUES ("com.google.android.projection.gearhead",0,"Tabbouleh__tabs_media_enabled", (SELECT DISTINCT user FROM Flags WHERE user != ""LIMIT 1,1) ,1,1);
		INSERT OR REPLACE INTO FlagOverrides (packageName, flagType,  name, user, boolVal, committed) VALUES ("com.google.android.projection.gearhead",0,"Tabbouleh__media_browse_back_to_top_level_button_enabled", (SELECT DISTINCT user FROM Flags WHERE user != ""LIMIT 1,1) ,1,1);
		INSERT OR REPLACE INTO FlagOverrides (packageName, flagType,  name, user, boolVal, committed) VALUES ("com.google.android.projection.gearhead",0,"Tabbouleh__tabs_media_sticky_tab_enabled", (SELECT DISTINCT user FROM Flags WHERE user != ""LIMIT 1,1) ,1,1);
		INSERT OR REPLACE INTO FlagOverrides (packageName, flagType,  name, user, boolVal, committed) VALUES ("com.google.android.projection.gearhead",0,"Tabbouleh__tabs_media_enabled", (SELECT DISTINCT user FROM Flags WHERE user != ""LIMIT 2,1) ,1,1);
		INSERT OR REPLACE INTO FlagOverrides (packageName, flagType,  name, user, boolVal, committed) VALUES ("com.google.android.projection.gearhead",0,"Tabbouleh__media_browse_back_to_top_level_button_enabled", (SELECT DISTINCT user FROM Flags WHERE user != ""LIMIT 2,1) ,1,1);
		INSERT OR REPLACE INTO FlagOverrides (packageName, flagType,  name, user, boolVal, committed) VALUES ("com.google.android.projection.gearhead",0,"Tabbouleh__tabs_media_sticky_tab_enabled", (SELECT DISTINCT user FROM Flags WHERE user != ""LIMIT 2,1) ,1,1);
		END;'
	ErrorStream:
		Error: database is locked

@shmykelsa
Copy link
Owner

Seems like you are in the case of Google Play Services database not working properly, see #12 for troubleshooting

@woody4165
Copy link
Author

On MIUI I can't uninstall updates nor uninstall Google Play Services...
Only delete cache or data

@shmykelsa
Copy link
Owner

That's really bizarre. Not even on three-dots menu?
However, you can also visit the Play Store page and uninstall updates from there. Just hit uninstall.

@woody4165
Copy link
Author

I found the way to disable updates (removing admin right to Find My device app), and now the disable icon appeared, but it's greyed out.
Should I clear all data first?

@shmykelsa
Copy link
Owner

@woody4165 Clear all datas and skip disabling

@woody4165
Copy link
Author

woody4165 commented Mar 7, 2021

Done, activated all the ones I needs.

It's better to activate one per time and reboot.

On the calendar one I still get the error.
Also on the Multimedia cards one, I had first same error, on second time the app closed itself, but after restarting, the option is green, but I don't know if it's working.

@shmykelsa
Copy link
Owner

Are you able to replicate the issue and generate a bug report as done in the very first post?

@woody4165
Copy link
Author

You mean the last error I'm receiving, on the calendar?

@shmykelsa
Copy link
Owner

@woody4165 Yes

@woody4165
Copy link
Author

I've tried with Github credentials and with email, but in both cases it fails

@shmykelsa
Copy link
Owner

Don't worry about GitHub right now. Does a dialog like the one on the original post appear?

@woody4165
Copy link
Author

woody4165 commented Mar 8, 2021

No, that one appeared because the app was crashing, this time the error report is something managed directly by the app and the app it's not crashing..

@woody4165
Copy link
Author

Hi @shmykelsa

just downloaded the 3.2.1 and I get a similar crashing like first post in this thread.

Do you want me to send the screenshot of that log?

Thanks

@shmykelsa
Copy link
Owner

Do you want me to send the screenshot of that log?

Yes please!

@woody4165
Copy link
Author

Here they are.

Screenshot_2021-03-10-13-43-40-685_com miui bugreport

Screenshot_2021-03-10-13-43-45-263_com miui bugreport

@shmykelsa
Copy link
Owner

I think this is happening because of the original problem. You have the calendar tweak with a null value. It's a border line situation really.

AA-AIO-TWEAKER--debug.zip

This version should help. Let me know if it crashes. You should be able to set any value to the agenda now. Set it and then install the official release of AA AIO TWEAKER

@woody4165
Copy link
Author

woody4165 commented Mar 10, 2021

should I uninstall the actual version, install the debug version and the install the 3.2.1 version?

Thanks

@shmykelsa
Copy link
Owner

@woody4165 Yes, correct

@woody4165
Copy link
Author

The debug version didn't work.

I always get this grey icon.

image

Instead, I have installed the 3.2 version, then I have disabled the calendar option, uninstalled the 3.2 and installed 3.2.1 and it worked this way.

Now I have set calendar to 3 days and I haven't got any error.
In an hour I will test it in car.

Thanks

@woody4165
Copy link
Author

Even if it seems to be ok, 3 days, pressing the Calendar icon in AA, I see only 1 day.

image

@shmykelsa
Copy link
Owner

Please note that Android Auto only shows days with events.

If you have an event tomorrow, a event the day after tomorrow and one on sunday, it will just show tomorrow, the day after tomorrow and sunday and not the days between (or today).

@woody4165
Copy link
Author

woody4165 commented Mar 10, 2021

I have events every day in my calendar... ;-) weekdays and weekends

@shmykelsa
Copy link
Owner

I have events every day in my calendar... ;-)

Could you please try to undo and redo the patch once again and send a log right here?

@woody4165
Copy link
Author

`
REGISTRO:


-- Drop Triggers  --
	OutputStream:
		/data/user/0/sksa.aa.tweaker/sqlite3 /data/data/com.google.android.gms/databases/phenotype.db 'DROP TRIGGER IF EXISTS calendar_aa_tweak;'

--  run SQL method   --
	OutputStream:
		/data/user/0/sksa.aa.tweaker/sqlite3 /data/data/com.google.android.gms/databases/phenotype.db 'CREATE TRIGGER calendar_aa_tweak AFTER DELETE
		ON FlagOverrides
		BEGIN
		INSERT OR REPLACE INTO FlagOverrides (packageName, flagType, name, user, intVal, committed) VALUES ("com.google.android.projection.gearhead",0,"McFly__num_days_in_agenda_view", (SELECT DISTINCT user FROM Flags WHERE user != ""LIMIT 0,1),3,1);
		INSERT OR REPLACE INTO FlagOverrides (packageName, flagType, name, user, intVal, committed) VALUES ("com.google.android.projection.gearhead",0,"McFly__num_days_in_agenda_view", (SELECT DISTINCT user FROM Flags WHERE user != ""LIMIT 1,1),3,1);
		INSERT OR REPLACE INTO FlagOverrides (packageName, flagType, name, user, intVal, committed) VALUES ("com.google.android.projection.gearhead",0,"McFly__num_days_in_agenda_view", (SELECT DISTINCT user FROM Flags WHERE user != ""LIMIT 2,1),3,1);
		END;'
	OutputStream:
		/data/user/0/sksa.aa.tweaker/sqlite3 /data/data/com.google.android.gms/databases/phenotype.db 'DELETE FROM Flags WHERE name="McFly__num_days_in_agenda_view";
		INSERT OR REPLACE INTO FlagOverrides (packageName, flagType, name, user, intVal, committed) VALUES ("com.google.android.projection.gearhead",0,"McFly__num_days_in_agenda_view", (SELECT DISTINCT user FROM Flags WHERE user != ""LIMIT 0,1),3,1);
		INSERT OR REPLACE INTO FlagOverrides (packageName, flagType, name, user, intVal, committed) VALUES ("com.google.android.projection.gearhead",0,"McFly__num_days_in_agenda_view", (SELECT DISTINCT user FROM Flags WHERE user != ""LIMIT 1,1),3,1);
		INSERT OR REPLACE INTO FlagOverrides (packageName, flagType, name, user, intVal, committed) VALUES ("com.google.android.projection.gearhead",0,"McFly__num_days_in_agenda_view", (SELECT DISTINCT user FROM Flags WHERE user != ""LIMIT 2,1),3,1);
		'
	ErrorStream:
		Error: unable to open database file
--  end SQL method   --

@shmykelsa
Copy link
Owner

Seems like you are having troubles again modifying the database, cause the log outputs

 ErrorStream:
		Error: unable to open database file

@woody4165
Copy link
Author

can I check something locally with some android tool (sql, terminal)?

@shmykelsa
Copy link
Owner

can I check something locally with some android tool (sql, terminal)?

Yes. You could use an elevated shell on the phone (even via ADB) and with sqlite3 you can try to manually open/manipulate the database.

@woody4165
Copy link
Author

Thanks, can you tell the name and path of the db and what I can try?

In the meantime, I'm preparing an old (but with Android 10 custom ROM) clean smartphone with AA and AA AIO Tweaker.
At the moment, I haven't received errors enabling the options I normally use, so later I will try to use connected in the car and using the hotspot on my normal phone (but I will loose notifications from messaging apps)...

@shmykelsa
Copy link
Owner

Thanks, can you tell the name and path of the db and what I can try?

As for calendar tweak, try the following:

adb shell su /data/user/0/sksa.aa.tweaker/sqlite3 /data/data/com.google.android.gms/databases/phenotype.db

Shell should have sqlite3> as output

Then

SELECT name,intVal, FROM FlagOverrides WHERE name="McFly__num_days_in_agenda_view";

You should see something like
McFly__num_days_in_agenda_view, 3 McFly__num_days_in_agenda_view, 3 McFly__num_days_in_agenda_view, 3

Then let's check if the trigger was created successfully
SELECT * FROM sqlite_master WHERE name="calendar_aa_tweak";

@woody4165
Copy link
Author

I've used an android app to access the phenotype.db

the first SELECT produce no data

I don't find the table sqlite_master

@shmykelsa
Copy link
Owner

the first SELECT produce no data

Okay something has gone wrong with AA AIO TWEAKER's agenda tweak

I don't find the table sqlite_master

Normally it's not displayed, hence why I suggested to do it via shell

Anyways, try to undo and re-do the agenda tweak with this version.

AA-AIO-TWEAKER-debug.zip

@woody4165
Copy link
Author

woody4165 commented Mar 11, 2021

Here is the output from the terminal

sqlite> SELECT name,intVal FROM FlagOverrides WHERE name="McFly__num_days_in_agenda_view";
sqlite> SELECT * FROM sqlite_master WHERE name="calendar_aa_tweak";
trigger|calendar_aa_tweak|FlagOverrides|0|CREATE TRIGGER calendar_aa_tweak AFTER DELETE
ON FlagOverrides
BEGIN
INSERT OR REPLACE INTO FlagOverrides (packageName, flagType, name, user, intVal, committed) VALUES ("com.google.android.projection.gearhead",0,"McFly__num_days_in_agenda_view", (SELECT DISTINCT user FROM Flags WHERE user != ""LIMIT 0,1),3,1);
INSERT OR REPLACE INTO FlagOverrides (packageName, flagType, name, user, intVal, committed) VALUES ("com.google.android.projection.gearhead",0,"McFly__num_days_in_agenda_view", (SELECT DISTINCT user FROM Flags WHERE user != ""LIMIT 1,1),3,1);
INSERT OR REPLACE INTO FlagOverrides (packageName, flagType, name, user, intVal, committed) VALUES ("com.google.android.projection.gearhead",0,"McFly__num_days_in_agenda_view", (SELECT DISTINCT user FROM Flags WHERE user != ""LIMIT 2,1),3,1);
END

@shmykelsa
Copy link
Owner

Okay. Try out the new version I've attached.

@woody4165
Copy link
Author

woody4165 commented Mar 11, 2021

Anyways, try to undo and re-do the agenda tweak with this version.

AA-AIO-TWEAKER-debug.zip

With this version, the app crashes

java.lang.RuntimeException: Unable to start activity ComponentInfo{sksa.aa.tweaker/sksa.aa.tweaker.MainActivity}: java.lang.NumberFormatException: For input string: ""
	at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3313)
	at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3462)
	at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:83)
	at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135)
	at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95)
	at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2049)
	at android.os.Handler.dispatchMessage(Handler.java:107)
	at android.os.Looper.loop(Looper.java:224)
	at android.app.ActivityThread.main(ActivityThread.java:7565)
	at java.lang.reflect.Method.invoke(Native Method)
	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:539)
	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:950)
Caused by: java.lang.NumberFormatException: For input string: ""
	at java.lang.Integer.parseInt(Integer.java:627)
	at java.lang.Integer.parseInt(Integer.java:650)
	at sksa.aa.tweaker.MainActivity.onCreate(MainActivity.java:1117)
	at android.app.Activity.performCreate(Activity.java:7916)
	at android.app.Activity.performCreate(Activity.java:7903)
	at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1307)
	at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3288)
	... 11 more

@woody4165
Copy link
Author

I tried on the other phone the debug version, and it runs ok.
Now I try to reset all the settings in the 3.2.1. app and start from scratch with the debug version

@woody4165
Copy link
Author

woody4165 commented Mar 11, 2021

Now I'm blocked, I tried the debug version, 3.2.1 and 3.1 (that was working yesterday, while the newer and debug versions were crashing) and the app always crashes...

What can I do now ?

Thanks

@shmykelsa
Copy link
Owner

Does it crash past the initial warning screen?

@woody4165
Copy link
Author

woody4165 commented Mar 11, 2021

Yes, clicking after 5 seconds countdown

@shmykelsa
Copy link
Owner

Are you able to reproduce a bug report like in the original post?

@woody4165
Copy link
Author

Here it is.

java.lang.RuntimeException: Unable to start activity ComponentInfo{sksa.aa.tweaker/sksa.aa.tweaker.MainActivity}: java.lang.NumberFormatException: For input string: ""
	at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3313)
	at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3462)
	at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:83)
	at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135)
	at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95)
	at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2049)
	at android.os.Handler.dispatchMessage(Handler.java:107)
	at android.os.Looper.loop(Looper.java:224)
	at android.app.ActivityThread.main(ActivityThread.java:7565)
	at java.lang.reflect.Method.invoke(Native Method)
	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:539)
	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:950)
Caused by: java.lang.NumberFormatException: For input string: ""
	at java.lang.Integer.parseInt(Integer.java:627)
	at java.lang.Integer.parseInt(Integer.java:650)
	at sksa.aa.tweaker.MainActivity.onCreate(Unknown Source:2251)
	at android.app.Activity.performCreate(Activity.java:7916)
	at android.app.Activity.performCreate(Activity.java:7903)
	at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1307)
	at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3288)
	... 11 more

@woody4165
Copy link
Author

I've tried the test phone and the Calendar option is working, but not as I was expecting.
It's a list of events without any divider between different days and the heading remains on the first day with events.

But now, my issue is try to solve the crash issue.
I've also cleared alla app data and reinstalled the latest version and also the latest debug version you sent me, but still the same....

In the next days or week, if I have time, I will try to switch from stock MIUI 12 to Resurrection Remix, on my Poco X3

Thanks

@shmykelsa
Copy link
Owner

I've tried the test phone and the Calendar option is working, but not as I was expecting.
It's a list of events without any divider between different days and the heading remains on the first day with events.

That's clearly mentioned in the built-in tutorial

But now, my issue is try to solve the crash issue.
I've also cleared alla app data and reinstalled the latest version and also the latest debug version you sent me, but still the same....

Try this: uninstall actual version, try version 2.6, if status is green near the agenda tweak, deactivate the tweak. Select a day and do the tweak. Try then to install latest version.

In the next days or week, if I have time, I will try to switch from stock MIUI 12 to Resurrection Remix, on my Poco X3

Thanks

@woody4165
Copy link
Author

woody4165 commented Mar 12, 2021

That's clearly mentioned in the built-in tutorial

ok, thanks, I haven't checked this before.

Try this: uninstall actual version, try version 2.6, if status is green near the agenda tweak, deactivate the tweak. Select a day and do the tweak. Try then to install latest version.
Done and now crash has ended and I check that I had no error messages during uncheck and check calendar option in 2.6.0

Now I've reinstalled 3.2.1 and calendar option is green but with 0 day .

What do you suggest?
Uncheck it, reboot, check it again with x days (checking that I have no errors) and reboot again?
Or leave it like it is ?

Thanks

PS: even if I see 0 days in the app (latest version), I see 3 days in AA, that is what I've sat in the 2.6.0 version

@shmykelsa
Copy link
Owner

That's a visual bug that will be fixed in next version

@shmykelsa
Copy link
Owner

@woody4165 could you please report the working status on latest version?

@woody4165
Copy link
Author

woody4165 commented Mar 19, 2021

Hi

I've just tested removing the calendar option (since was showing 1 day, but it's set to 3.

This is reverting the hack

-- Reverting the hack  --
	OutputStream:
		/data/user/0/sksa.aa.tweaker/sqlite3 /data/data/com.google.android.gms/databases/phenotype.db 'DROP TRIGGER IF EXISTS calendar_aa_tweak;'
	OutputStream:
		/data/user/0/sksa.aa.tweaker/sqlite3 /data/data/com.google.android.gms/databases/phenotype.db 'DELETE FROM FlagOverrides;'
	ErrorStream:
		Error: unable to open database file

And, after a reboot, this is installing the hack

-- Drop Triggers  --
	OutputStream:
		/data/user/0/sksa.aa.tweaker/sqlite3 /data/data/com.google.android.gms/databases/phenotype.db 'DROP TRIGGER IF EXISTS calendar_aa_tweak;'
	OutputStream:
		/data/user/0/sksa.aa.tweaker/sqlite3 /data/data/com.google.android.gms/databases/phenotype.db 'DELETE FROM Flags WHERE name="McFly__num_days_in_agenda_view";
		INSERT OR REPLACE INTO FlagOverrides (packageName, flagType, name, user, intVal, committed) VALUES ("com.google.android.projection.gearhead",0,"McFly__num_days_in_agenda_view", (SELECT DISTINCT user FROM Flags WHERE user != ""LIMIT 0,1),3,1);
		INSERT OR REPLACE INTO FlagOverrides (packageName, flagType, name, user, intVal, committed) VALUES ("com.google.android.projection.gearhead",0,"McFly__num_days_in_agenda_view", (SELECT DISTINCT user FROM Flags WHERE user != ""LIMIT 1,1),3,1);
		INSERT OR REPLACE INTO FlagOverrides (packageName, flagType, name, user, intVal, committed) VALUES ("com.google.android.projection.gearhead",0,"McFly__num_days_in_agenda_view", (SELECT DISTINCT user FROM Flags WHERE user != ""LIMIT 2,1),3,1);
		'
	ErrorStream:
		Error: unable to open database file

--  run SQL method   --
	OutputStream:
		/data/user/0/sksa.aa.tweaker/sqlite3 /data/data/com.google.android.gms/databases/phenotype.db 'CREATE TRIGGER calendar_aa_tweak AFTER DELETE
		ON FlagOverrides
		BEGIN
		INSERT OR REPLACE INTO FlagOverrides (packageName, flagType, name, user, intVal, committed) VALUES ("com.google.android.projection.gearhead",0,"McFly__num_days_in_agenda_view", (SELECT DISTINCT user FROM Flags WHERE user != ""LIMIT 0,1),3,1);
		INSERT OR REPLACE INTO FlagOverrides (packageName, flagType, name, user, intVal, committed) VALUES ("com.google.android.projection.gearhead",0,"McFly__num_days_in_agenda_view", (SELECT DISTINCT user FROM Flags WHERE user != ""LIMIT 1,1),3,1);
		INSERT OR REPLACE INTO FlagOverrides (packageName, flagType, name, user, intVal, committed) VALUES ("com.google.android.projection.gearhead",0,"McFly__num_days_in_agenda_view", (SELECT DISTINCT user FROM Flags WHERE user != ""LIMIT 2,1),3,1);
		END;'

And now it shows it good.
I've to test in AA..

IMG_20210319_130308

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

No branches or pull requests

2 participants