Enhance your Proguard and Gson skills by transforming variable names within an arraylist

During debugging, my code works perfectly fine. However, when I release my apk with Proguard 5, it obfuscates my variables. As a result, the string generated after "Jsonifying" is also obfuscated, causing issues with my PHP script.

Here's an example of my code:

ArrayList lCapturas=...;

if (lCapturas != null) {
            Gson gson = new Gson();
            Type listOfCapturaObject = new TypeToken<List<Captura>>() {
            }.getType();
            json = gson.toJson(lCapturas, listOfCapturaObject);
        }

And here is the resulting Json string:

[{"j":"2014-09-10 17:35:25","e":"2014-09-  10","f":"19.3641107,-99.1785061","d":28809,"c":85,"b":2705,"a":1,"l":1,"m":0}]

I believe that Proguard is obfuscating Captura Objects. Is there a way to disable this option? How should I proceed in this situation?

Answer №1

The problem has been successfully resolved:

-keep class com.pkg.vo.myClass { *; }

It is important to keep the variable names for each class.

Unfortunately, StackOverflow was not able to provide the solution I needed :(

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Assistance requested for utilizing stripos() and substr() functions

Is there a way to remove everything before the word "sentido" in this given string? $string = "#BLitz da #PM na est do pontal sentido prainha perto do camping"; The desired new string is: $string = "prainha perto do camping"; I have tried using stripos ...

Implementing PHP echo alerts using Javascript

My current task involves validating the IP address entered in a textbox using PHP. $('#check_ip').click(function() { var iptext = $('#Ip_Txt').val(); $.ajax({ type : "POST", url : "mypage.php", data : { iptext : ip ...

Show a custom field value of a product in Woocommerce emails sent to administrators

I'm looking for a way to display the value of a field in my function.php file within the admin mail order. Any tips on how I can achieve this? Thanks in advance! //1.1 Want to show custom field in the admin section add_action('woocommerce_produ ...

Compose an email containing customized content for the group of recipients pulled from the database

Hello, I am facing an issue with sending personalized emails to a list of users from my database. Each user needs to receive a unique link in their email. Here is the content of the email: Dear User, There is an important message for you. Click on the l ...

Fetch the information, insert following, and trigger a slide toggle

I am new to jQuery and I want to create a sliding table. The original table has 3 levels: <ul class="categories"> <li id="category1">1 element</li> //parentid=0 <li id="category2">2 element</li> //parentid=0 <ul> < ...

"CachePathException" Ensure a proper cache path is provided in Laravel 8

Upon returning to a project after a week without making any changes, my php artisan command suddenly stopped working. Strangely, this issue only affects this specific project, as other projects are running fine with php artisan. When attempting to execute ...

Ways to showcase a directory and its files in PHP with the ability to download the files

As I embark on the journey of setting up a file server, The basic idea is to have multiple folders containing files that users can download by clicking on them, and if it's a folder, they can navigate inside to see its contents. I'm currently g ...

Help! I can't find the simplexml node anymore - how do I retrieve the attribute value?

After spending more than 6 hours, I'm finally reaching out for help with my issue. My goal is to retrieve the attribute value from a SimpleXMLElement: Below is the output of my var_dump: object(SimpleXMLElement)#5 (1) { ["@attributes"]=> array ...

Managing Positioning of PHP Print Statement

Recently, I developed a PHP script for my site that facilitates user registration and login specifically for membership purposes. If a user successfully logs in, the script redirects them to a landing page for members. However, if the login fails, the scri ...

Challenges with regular expressions (preg_match)

Apologies if this question has already been asked, but I'm having trouble finding a clear answer online today! I'm trying to validate a form field and ensure that it contains exactly 3 uppercase letters, no more and no less. My various attempts ...

PHP - Issue with JSON formatting when removing a value

Whenever a user clicks on a button, the videoId of the clicked video gets added to an array. If the same button is clicked again, the code checks if the videoId is already in the array and removes it if found. The array is then saved to a JSON file in th ...

What is the best way to retrieve a response from a PHP file as an array through Ajax?

Seeking assistance in retrieving a complete address by entering the postal code in an HTML form textbox and clicking a button. The setup involves two files - one containing the ajax function and the other housing the PHP code. Uncertainty looms over whethe ...

What is the best way to display a variable (string/int) from a PHP file onto an HTML file?

I've searched online multiple times for a solution, but most of the results I found only show how to echo HTML code from a PHP file by changing the file extension to .php. However, my goal is to echo a variable from a PHP file and display it in an HTM ...

Best practices for converting and reconstructing form elements as a single string in PHP

Due to the website's customization function, the form content may contain an unpredictable number of fields. This could result in submitting over 1000 form fields to the server, exceeding the max_input_vars limit. To address this issue without arbitra ...

Tips for organizing the output of wp_query

I'm looking to organize the results of my wp_query, wanting to arrange them by different parameters without needing to run the query again. Here is what I have so far: $the_query = new WP_Query( $args ); I’d like to sort $the_query; WP_Query gives ...

extracting data from a javascript array

While facing an issue with scraping a website , I received helpful solutions from Fatherstorm and marcog. Despite the great solution provided by Fatherstorm, there were some minor bugs related to start time and the number of image sources being retrieved a ...

The site cache appears to be deactivated, but the source of the deactivation remains unclear. Can you help identify the issue?

On my PHP website, the <head> tag in the HTML includes: <meta http-equiv="Cache-Control" content="max-age=300"/> However, when checking the headers, it shows: Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre- ch ...

Retrieve all tag values from the field and store them in an array

UPDATE : I require obtaining all values in the tags field! MY Query : $query = db_select('node', 'node'); $query->fields('tagsdata',array('name')); $query->fields('node', array('nid')); $ ...

PHP Thread/Topic Class: Exploring the Power of Threads in

During my college class today, we tackled the task of transforming a simple forum built in procedural PHP into an object-oriented programming (OOP) structure. However, I find myself stuck at this point while working on my homework. In OOP principles, it i ...

What is the most efficient method to retrieve the final key/value pair from an associative array in PHP?

Is there a streamlined and efficient method to retrieve the last key/value pair of an associative array in PHP, without resorting to verbose solutions? ...