Page MenuHomeGitPull.it

Revoking location permission at system setting crashes app on version 1.14
Closed, ResolvedPublic

Description

Hi, there, I've found an issue in version 1.14, which is downloaded from F-Droid.

Reproduce

  1. enter the app from the home screen and allow the location permission request.
  2. go to system setting and revoke the location permission
  3. go back to the app and it crashes

Here the info:

version code:
31

version name:
1.14

android version:
10

phone:
MIX 2S

brand:
Xiaomi

stack:
java.lang.SecurityException: "gps" location provider requires ACCESS_FINE_LOCATION permission.
	at android.os.Parcel.createException(Parcel.java:2074)
	at android.os.Parcel.readException(Parcel.java:2042)
	at android.os.Parcel.readException(Parcel.java:1990)
	at android.location.ILocationManager$Stub$Proxy.requestLocationUpdates(ILocationManager.java:1151)
	at android.location.LocationManager.requestLocationUpdates(LocationManager.java:1033)
	at android.location.LocationManager.requestLocationUpdates(LocationManager.java:561)
	at it.reyboz.bustorino.ActivityMain$NearbyStopsRequester.run(ActivityMain.java:664)
	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.app.ActivityThread.main(ActivityThread.java:7562)
	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)

Here is the video about how I found this crash.

Could you help me review this issue? very thanks !!

Revisions and Commits

Event Timeline

Hi @wowhhh can you please share the crash report instead of this video? You can do it pressing "Yes" on our message dialog.

Thank you so much :)

Hello!
I exported the crash report and pasted it below!
Thank you for your reply!

Thank you I've edited the description with the info extracted from your JSON using

1<?php
2# Android Crash Dump exporter for Phabricator
3# Copyright (C) 2021-2025 Valerio Bozzolan, crash report contributors
4#
5# This program is free software: you can redistribute it and/or modify
6# it under the terms of the GNU Affero General Public License as published by
7# the Free Software Foundation, either version 3 of the License, or
8# (at your option) any later version.
9#
10# This program is distributed in the hope that it will be useful,
11# but WITHOUT ANY WARRANTY; without even the implied warranty of
12# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13# GNU Affero General Public License for more details.
14#
15# You should have received a copy of the GNU General Public License
16# along with this program. If not, see <http://www.gnu.org/licenses/>
17
18/**
19 * Quick and dirty Android Crash Dump analyzer
20 *
21 * https://gitpull.it/P15
22 */
23
24// This should be less than 50 to avoid "Request-URI Too Long" when creating the task using
25// a super-long GET URL...
26//$logcat_max_lines = 20;
27$logcat_max_lines = 30;
28
29// base of your Phabricator
30define( 'BASE_URI', 'https://gitpull.it/maniphest/task/edit/form/3/?' );
31
32// received data from textarea
33$data_raw = $_POST['data'] ?? null;
34
35// or, receive data from file
36if (!$data_raw && isset($_FILES['data_file']['tmp_name'])) {
37 $data_raw = file_get_contents($_FILES['data_file']['tmp_name']);
38}
39
40$data_clean_text = null;
41$task_args = null;
42if( $data_raw ) {
43
44 $data = @json_decode( $data_raw );
45
46 if( $data ) {
47
48 $data_raw = json_encode( $data, JSON_PRETTY_PRINT );
49
50 $app_version_name = $data->APP_VERSION_NAME ?? null;
51
52 // Take only some lines of logcat.
53 $logcat_reduced = null;
54 $logcat = $data->LOGCAT ?? null;
55 if ($logcat) {
56 $lines = explode("\n", $logcat);
57
58 // Pop last lines, until limit is reached.
59 $last_lines = [];
60 do {
61 $last_line = null;
62 if ($lines) {
63 $last_line = array_pop($lines);
64 }
65 if ($last_line !== null) {
66 // Check if the line is in scope. The 'ACRA' is shit.
67 if (mb_strpos($last_line, ' E/ACRA ') === false) {
68 $last_lines[] = $last_line;
69 }
70 }
71 } while($last_line !== null && count($last_lines) < $logcat_max_lines);
72
73 $last_lines = array_reverse($last_lines);
74 $logcat_reduced = implode("\n", $last_lines);
75 }
76
77 // some useful informations
78 $data_clean = [
79 'Version code' => $data->APP_VERSION_CODE ?? null,
80 'Version name' => $app_version_name,
81 'Android version' => $data->ANDROID_VERSION ?? null,
82 'Phone' => $data->PHONE_MODEL ?? null,
83 'Brand' => $data->BRAND ?? null,
84 'Stack' => $data->STACK_TRACE ?? null,
85 "logcat (last $logcat_max_lines lines)" => $logcat_reduced,
86 ];
87
88 // build an human phrase
89 $data_clean_parts = [];
90 foreach( $data_clean as $k => $v ) {
91 $data_clean_parts[] = "$k:\n$v";
92 }
93 $data_clean_text = implode( "\n\n", $data_clean_parts );
94 $data_clean_text = trim($data_clean_text);
95
96 // build query string
97 $task_args = [
98 'title' => "Fix crash caused by ... on version $app_version_name",
99 'description' => implode( "\n", [
100 "Dear Developers of the amazing Free/Libre and Open Source app #libre_busto,",
101 "Please triage my crash:",
102 '',
103 '```',
104 $data_clean_text,
105 '```',
106 '',
107 '',
108 "Thank you! :)",
109 '',
110 '',
111 "> Generated with https://lab.reyboz.it/libre-busto/crash-report/ (P15)",
112 ] ),
113 ];
114
115 } else {
116 $data_raw = 'invalid';
117 }
118
119}
120
121?>
122<html>
123<head>
124 <title>Libre BusTO - crash report dump</title>
125</head>
126<body>
127
128 <h1>Libre BusTO - crash report dump</h1>
129
130 <form method="post" enctype="multipart/form-data">
131 <?php if( $data_clean_text ): ?>
132 <h2>Generated Crash report</h2>
133 <?php if( $task_args ): ?>
134 <p>
135 <a href="<?= htmlspecialchars( BASE_URI . http_build_query( $task_args ) )?>" target="_blank">Create New Task in Phorge</a>
136 </p>
137 <?php endif ?>
138 <p>Preview of Task Content:<br />
139 <textarea readonly><?= htmlentities( $data_clean_text ) ?></textarea>
140 </p>
141
142 <hr />
143 <?php endif ?>
144
145 <h2>Generate New Crash Report</h2>
146
147 <p>Upload here our JSON crash report:</p>
148 <p><input type="file" name="data_file" accept="application/json" /></p>
149
150 <p>or, paste here our JSON crash report:</p>
151 <p><textarea name="data"><?= htmlentities( $data_raw ) ?></textarea></p>
152
153 <p><button type="submit">OK</button></p>
154 </form>
155
156 <hr />
157
158 <p><a href="https://gitpull.it/tag/libre_busto/">Workboard</a></p>
159
160 <hr />
161
162 <p><a href="https://gitpull.it/P15" target="_blank">Source code and license</a></p>
163
164</body>
165</html>
166
.

We will debug soon!

valerio.bozzolan renamed this task from Revoking location permission at system setting crashes app to Revoking location permission at system setting crashes app on version 1.14.Jul 20 2021, 10:03

This is probably fixed by now. Can you check if the issue is still present with the latest version? @wowhhh

Hello, I test it again on the latest version. This crash has been fixed.
I review the commits and I think this bug has been fixed in 6d35b0c0367e.

Very useful apps. Thanks for your reply!