| | | | |
| Offset 2035, 14 lines modified | Offset 2035, 25 lines modified |
| 2035 | ························continue; | 2035 | ························continue; |
| 2036 | ····················} | 2036 | ····················} |
| 2037 | ················} | 2037 | ················} |
| 2038 | ············} | 2038 | ············} |
| 2039 | ········} | 2039 | ········} |
| 2040 | ····} | 2040 | ····} |
| 2041 | ···· | 2041 | ···· |
| | 2042 | ····private·int[]·checkUriPermissions(final·List·list,·final·int·n,·final·int·n2,·final·boolean·b)·{ |
| | 2043 | ········int·n3; |
| | 2044 | ········if·(b)·{ |
| | 2045 | ············n3·=·2; |
| | 2046 | ········} |
| | 2047 | ········else·{ |
| | 2048 | ············n3·=·1; |
| | 2049 | ········} |
| | 2050 | ········return·this.getContext().checkUriPermissions(list,·n,·n2,·n3); |
| | 2051 | ····} |
| | 2052 | ···· |
| 2042 | ····public·static·void·checkWorldReadAccess(String·string)·{ | 2053 | ····public·static·void·checkWorldReadAccess(String·string)·{ |
| 2043 | ········int·n; | 2054 | ········int·n; |
| 2044 | ········if·(string.startsWith("/storage/"))·{ | 2055 | ········if·(string.startsWith("/storage/"))·{ |
| 2045 | ············n·=·OsConstants.S_IRGRP; | 2056 | ············n·=·OsConstants.S_IRGRP; |
| 2046 | ········} | 2057 | ········} |
| 2047 | ········else·{ | 2058 | ········else·{ |
| 2048 | ············n·=·OsConstants.S_IROTH; | 2059 | ············n·=·OsConstants.S_IROTH; |
| Offset 2251, 33 lines modified | Offset 2262, 14 lines modified |
| 2251 | ····private·static·int·deleteFileUnchecked(final·String·pathname)·{ | 2262 | ····private·static·int·deleteFileUnchecked(final·String·pathname)·{ |
| 2252 | ········if·(new·File(pathname).delete())·{ | 2263 | ········if·(new·File(pathname).delete())·{ |
| 2253 | ············return·0; | 2264 | ············return·0; |
| 2254 | ········} | 2265 | ········} |
| 2255 | ········return·OsConstants.ENOENT; | 2266 | ········return·OsConstants.ENOENT; |
| 2256 | ····} | 2267 | ····} |
| 2257 | ···· | 2268 | ···· |
| 2258 | ····private·boolean·deleteForFuseRename(final·DatabaseHelper·databaseHelper,·final·String·s,·final·String·s2,·final·Bundle·bundle,·final·String·s3,·final·boolean·b)·{ | |
| 2259 | ········final·Uri·contentUriForPath·=·FileUtils.getContentUriForPath(s); | |
| 2260 | ········final·SQLiteQueryBuilder·queryBuilder·=·this.getQueryBuilder(3,·this.matchUri(contentUriForPath,·b),·contentUriForPath,·bundle,·null); | |
| 2261 | ········int·n·=·1; | |
| 2262 | ········final·String[]·array·=·new·String[n]; | |
| 2263 | ········array[0]·=·s2; | |
| 2264 | ········if·(queryBuilder.delete(databaseHelper,·s3,·array)·==·n)·{ | |
| 2265 | ············return·n·!=·0; | |
| 2266 | ········} | |
| 2267 | ········final·String[]·array2·=·{·"media_type",·"_data",·"_id",·"is_download",·"mime_type"·}; | |
| 2268 | ········final·Uri·contentUriForPath2·=·FileUtils.getContentUriForPath(s2); | |
| 2269 | ········final·String[]·array3·=·new·String[n]; | |
| 2270 | ········array3[0]·=·s2; | |
| 2271 | ········if·(this.deleteWithOtherUriGrants(contentUriForPath2,·databaseHelper,·array2,·s3,·array3,·bundle)·!=·n)·{ | |
| 2272 | ············n·=·0; | |
| 2273 | ········} | |
| 2274 | ········return·n·!=·0; | |
| 2275 | ····} | |
| 2276 | ···· | |
| 2277 | ····private·void·deleteIfAllowed(final·Uri·uri,·final·Bundle·bundle,·final·String·s)·{ | 2269 | ····private·void·deleteIfAllowed(final·Uri·uri,·final·Bundle·bundle,·final·String·s)·{ |
| 2278 | ········try·{ | 2270 | ········try·{ |
| 2279 | ············final·File·file·=·new·File(s); | 2271 | ············final·File·file·=·new·File(s); |
| 2280 | ············this.checkAccess(uri,·bundle,·file,·true); | 2272 | ············this.checkAccess(uri,·bundle,·file,·true); |
| 2281 | ············try·{ | 2273 | ············try·{ |
| 2282 | ················this.deleteAndInvalidate(file); | 2274 | ················this.deleteAndInvalidate(file); |
| 2283 | ············} | 2275 | ············} |
| Offset 4606, 17 lines modified | Offset 4598, 30 lines modified |
| 4606 | ········sb.append(".transforms/synthetic/redacted"); | 4598 | ········sb.append(".transforms/synthetic/redacted"); |
| 4607 | ········sb.append(s); | 4599 | ········sb.append(s); |
| 4608 | ········sb.append(str); | 4600 | ········sb.append(str); |
| 4609 | ········return·sb.toString(); | 4601 | ········return·sb.toString(); |
| 4610 | ····} | 4602 | ····} |
| 4611 | ···· | 4603 | ···· |
| 4612 | ····private·Uri·getPermissionGrantedUri(final·List·list,·final·boolean·b)·{ | 4604 | ····private·Uri·getPermissionGrantedUri(final·List·list,·final·boolean·b)·{ |
| | 4605 | ········if·(SdkLevel.isAtLeastS())·{ |
| | 4606 | ············final·int[]·checkUriPermissions·=·this.checkUriPermissions(list,·((LocalCallingIdentity)this.mCallingIdentity.get()).pid,·((LocalCallingIdentity)this.mCallingIdentity.get()).uid,·b); |
| | 4607 | ············if·(checkUriPermissions.length·!=·list.size())·{ |
| | 4608 | ················return·null; |
| | 4609 | ············} |
| | 4610 | ············for·(int·i·=·0;·i·<·list.size();·++i)·{ |
| | 4611 | ················if·(checkUriPermissions[i]·==·0)·{ |
| | 4612 | ····················return·list.get(i); |
| | 4613 | ················} |
| | 4614 | ············} |
| | 4615 | ········} |
| | 4616 | ········else·{ |
| 4613 | ········for·(final·Uri·uri·:·list)·{ | 4617 | ············for·(final·Uri·uri·:·list)·{ |
| 4614 | ············if·(this.isUriPermissionGranted(uri,·b))·{ | 4618 | ················if·(this.isUriPermissionGranted(uri,·b))·{ |
| 4615 | ················return·uri; | 4619 | ····················return·uri; |
| | 4620 | ················} |
| 4616 | ············} | 4621 | ············} |
| 4617 | ········} | 4622 | ········} |
| 4618 | ········return·null; | 4623 | ········return·null; |
| 4619 | ····} | 4624 | ····} |
| 4620 | ···· | 4625 | ···· |
| 4621 | ····private·SQLiteQueryBuilder·getQueryBuilder(final·int·n,·final·int·n2,·final·Uri·uri,·final·Bundle·bundle,·final·Consumer·consumer)·{ | 4626 | ····private·SQLiteQueryBuilder·getQueryBuilder(final·int·n,·final·int·n2,·final·Uri·uri,·final·Bundle·bundle,·final·Consumer·consumer)·{ |
| 4622 | ········Trace.beginSection("getQueryBuilder"); | 4627 | ········Trace.beginSection("getQueryBuilder"); |
| Offset 10122, 21 lines modified | Offset 10127, 25 lines modified |
| 10122 | ············sb.append("Database·update·failed·while·renaming·"); | 10127 | ············sb.append("Database·update·failed·while·renaming·"); |
| 10123 | ············sb.append(str); | 10128 | ············sb.append(str); |
| 10124 | ············Log.w(s2,·sb.toString(),·(Throwable)ex); | 10129 | ············Log.w(s2,·sb.toString(),·(Throwable)ex); |
| 10125 | ············n3·=·n; | 10130 | ············n3·=·n; |
| 10126 | ············n2·=·0; | 10131 | ············n2·=·0; |
| 10127 | ········} | 10132 | ········} |
| 10128 | ········if·(n3·!=·0)·{ | 10133 | ········if·(n3·!=·0)·{ |
| 10129 | ············if·(!this.deleteForFuseRename(databaseHelper,·str,·s,·bundle,·"_data·=?·",·callingPackageAllowedHidden))·{ | 10134 | ············final·Uri·contentUriForPath·=·FileUtils.getContentUriForPath(str); |
| | 10135 | ············final·SQLiteQueryBuilder·queryBuilder2·=·this.getQueryBuilder(3,·this.matchUri(contentUriForPath,·callingPackageAllowedHidden),·contentUriForPath,·bundle,·null); |
| | 10136 | ············final·String[]·array2·=·new·String[n]; |
| | 10137 | ············array2[0]·=·s; |
| | 10138 | ············if·(queryBuilder2.delete(databaseHelper,·s3,·array2)·!=·n)·{ |
| 10130 | ················return·false; | 10139 | ················return·false; |
| 10131 | ············} | 10140 | ············} |
| 10132 | ············Log.i(s2,·"Retrying·database·update·after·deleting·conflicting·entry"); | 10141 | ············Log.i(s2,·"Retrying·database·update·after·deleting·conflicting·entry"); |
| 10133 | ············final·String[]·array2·=·new·String[n]; | 10142 | ············final·String[]·array3·=·new·String[n]; |
| 10134 | ············array2[0]·=·str; | 10143 | ············array3[0]·=·str; |
| 10135 | ············n2·=·queryBuilder.update(databaseHelper,·contentValues,·s3,·array2); | 10144 | ············n2·=·queryBuilder.update(databaseHelper,·contentValues,·s3,·array3); |
| 10136 | ········} | 10145 | ········} |
| 10137 | ········if·(n2·!=·n)·{ | 10146 | ········if·(n2·!=·n)·{ |
| 10138 | ············n·=·0; | 10147 | ············n·=·0; |
| 10139 | ········} | 10148 | ········} |
| 10140 | ········return·n·!=·0; | 10149 | ········return·n·!=·0; |
| 10141 | ····} | 10150 | ····} |
| 10142 | ···· | 10151 | ···· |
| Offset 12664, 19 lines modified | Offset 12673, 19 lines modified |
| 12664 | ························break·Label_0040; | 12673 | ························break·Label_0040; |
| 12665 | ····················} | 12674 | ····················} |
| 12666 | ····················try·{ | 12675 | ····················try·{ |
| 12667 | ························final·StorageManager·mStorageManager·=·this.mStorageManager; | 12676 | ························final·StorageManager·mStorageManager·=·this.mStorageManager; |
| 12668 | ························n·=·0; | 12677 | ························n·=·0; |
| 12669 | ························mStorageManager.updateExternalStorageFileQuotaType(file,·0); | 12678 | ························mStorageManager.updateExternalStorageFileQuotaType(file,·0); |
| 12670 | ························return; | 12679 | ························return; |
| | 12680 | ························this.mStorageManager.updateExternalStorageFileQuotaType(file,·n4); |
| | 12681 | ························return; |
| 12671 | ························this.mStorageManager.updateExternalStorageFileQuotaType(file,·n3); | 12682 | ························this.mStorageManager.updateExternalStorageFileQuotaType(file,·n3); |
| 12672 | ························return; | 12683 | ························return; |
| 12673 | ························this.mStorageManager.updateExternalStorageFileQuotaType(file,·n2); | 12684 | ························this.mStorageManager.updateExternalStorageFileQuotaType(file,·n2); |
| 12674 | ························return; | |
| 12675 | ························this.mStorageManager.updateExternalStorageFileQuotaType(file,·n4); | |
| 12676 | ····················} | 12685 | ····················} |
| 12677 | ····················catch·(IOException·ex)·{ | 12686 | ····················catch·(IOException·ex)·{ |
| 12678 | ························final·StringBuilder·sb·=·new·StringBuilder(); | 12687 | ························final·StringBuilder·sb·=·new·StringBuilder(); |
| 12679 | ························sb.append("Failed·to·update·quota·type·for·"); | 12688 | ························sb.append("Failed·to·update·quota·type·for·"); |
| 12680 | ························sb.append(file.getPath()); | 12689 | ························sb.append(file.getPath()); |
| 12681 | ························Log.w("MediaProvider",·sb.toString(),·(Throwable)ex); | 12690 | ························Log.w("MediaProvider",·sb.toString(),·(Throwable)ex); |
| 12682 | ····················} | 12691 | ····················} |
| Offset 13161, 32 lines modified | Offset 13170, 29 lines modified |
| 13161 | ····························} | 13170 | ····························} |
| 13162 | ····························finally·{ | 13171 | ····························finally·{ |
| 13163 | ································final·Throwable·t; | 13172 | ································final·Throwable·t; |
| 13164 | ································final·Throwable·exception; | 13173 | ································final·Throwable·exception; |
| 13165 | ································t.addSuppressed(exception); | 13174 | ································t.addSuppressed(exception); |
| 13166 | ····························} | 13175 | ····························} |
| 13167 | ························} | 13176 | ························} |
| | 13177 | ························final·String·string·=·queryForSingleItem.getString(queryForSingleItem.getColumnIndexOrThrow(s)); |
| 13168 | ························//·iftrue(Label_0223:,·TextUtils.isEmpty((CharSequence)string)) | 13178 | ························//·iftrue(Label_0223:,·TextUtils.isEmpty((CharSequence)string)) |
| 13169 | ························//·iftrue(Label_0275:,·queryForSingleItem·==·null) | |
| 13170 | ························String·string·=·null; | |
| 13171 | ····················Block_12: | 13179 | ························Block_12:·{ |
| 13172 | ························while·(true)·{ | 13180 | ····························break·Block_12; |
| 13173 | ····························queryForSingleItem.close(); | 13181 | ····························queryForSingleItem.close(); |
| 13174 | ····························return·null; | 13182 | ····························return·null; |
| 13175 | ····························string·=·queryForSingleItem.getString(queryForSingleItem.getColumnIndexOrThrow(s)); | |
| 13176 | ····························break·Block_12; | |
| 13177 | ····························continue; | |
| 13178 | ························} | 13183 | ························} |
| 13179 | ························final·Uri$Builder·buildUpon2·=·uri.buildUpon(); | 13184 | ························final·Uri$Builder·buildUpon2·=·uri.buildUpon(); |
| 13180 | ························buildUpon2.appendQueryParameter(s,·string); | 13185 | ························buildUpon2.appendQueryParameter(s,·string); |
| 13181 | ························buildUpon2.appendQueryParameter(s2,·s3); | 13186 | ························buildUpon2.appendQueryParameter(s2,·s3); |
| 13182 | ························final·Uri·build2·=·buildUpon2.build(); | 13187 | ························final·Uri·build2·=·buildUpon2.build(); |
| 13183 | ························queryForSingleItem.close(); | 13188 | ························queryForSingleItem.close(); |
| 13184 | ························return·build2; | 13189 | ························return·build2; |
| 13185 | ····················} | 13190 | ····················} |
| | 13191 | ····················//·iftrue(Label_0275:,·queryForSingleItem·==·null) |
| 13186 | ················} | 13192 | ················} |
| 13187 | ············} | 13193 | ············} |
| 13188 | ········} | 13194 | ········} |
| 13189 | ········catch·(FileNotFoundException·ex)·{ | 13195 | ········catch·(FileNotFoundException·ex)·{ |
| 13190 | ············Log.w("MediaProvider",·ex.getMessage()); | 13196 | ············Log.w("MediaProvider",·ex.getMessage()); |
| 13191 | ········} | 13197 | ········} |
| 13192 | ········Label_0275:·{ | 13198 | ········Label_0275:·{ |