Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

181
Views
bloquear imagen/jpeg;base64 usando filtro de URL

Uso la función shouldInterceptRequest de shouldInterceptRequest para filtrar fotos en mi webView de Android.

El problema
Estoy tratando de bloquear las fotos URL base64 de Google (como: data:image/jpeg;base64,+ ) usando esta expresión regular data:image/(jpg|png|jpeg);base64, pero sin éxito.

Investigué y descubrí que :

estas imágenes de fondo base64 se inyectan con JS.

pero no sé continuar.

mi código:

 @Override public WebResourceResponse shouldInterceptRequest(WebView view, WebResourceRequest request) { String url = request.getUrl().toString(); if (imgCheck(url,res)) { return new WebResourceResponse( BrowserUnit.MIME_TYPE_TEXT_PLAIN, BrowserUnit.URL_ENCODING, new ByteArrayInputStream("".getBytes()) ); } return super.shouldInterceptRequest(view, request); }

 private static boolean isImage(String url, Resources res) { BufferedReader imageUrlRegex = openRawFile(res, R.raw.image_regex); try { String line = imageUrlRegex.readLine(); while (line != null) { Pattern pattern = Pattern.compile(line); if (pattern.matcher(url).find()) return true; line = imageUrlRegex.readLine(); } } catch (IOException e) { e.printStackTrace(); return true; } return false; }

 data:image/(jpg|png|jpeg|svg|ico|webp|tif|tiff|bmp|eps|apng|avif|jfif|pjpeg|pjp|cur);base64,

**nota: probé un bloque como este return url.contains("data:image"); aún nada

about 4 years ago · Santiago Trujillo
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!