app/src/main/java/com/example/androidverifier/JSONBuilder.java
/**
     *
     * @param context
     * @return return an  JSONObject config, inside JSONArray with all attributes of the configuration
     * @throws JSONException
     */
@param context
@return return an  JSONObject config, inside JSONArray with all attributes of the configuration
@throws JSONException
@param context @return return an JSONObject config inside JSONArray with all attributes of the configuration @throws JSONException
public JSONObject makeJSONVerifyBody(Context context, String email_user) throws JSONException {
        JSONObject localObject = new JSONObject();
        JSONArray jsonArray = new JSONArray();
        try {
            Log.d("email before", email_user);
            if(email_user != null && !email_user.isEmpty()){
                localObject.put("email_user", email_user);
                Log.d("email", email_user);
            }
            localObject.put(JSONBuilder.DEVICE_ANDROID_VERSION, Verify.getVersion());
            localObject.put(JSONBuilder.DEVICE_SDK_VERSION, Verify.getSDK());
            localObject.put(JSONBuilder.DEVICE_SECURE, Verify.doesDeviceHaveSecuritySetup(context));
            localObject.put(JSONBuilder.BLUETOOTH, Verify.isBluetoothEnabled());
            localObject.put(JSONBuilder.NFC, Verify.isNFCEnabled(context));
            localObject.put(JSONBuilder.GPS, Verify.isGPSEnabled(context));
            localObject.put(JSONBuilder.WIFI_HOSTPOT, Verify.isWifiHotspotEnabled(context));
            localObject.put(JSONBuilder.POWER_SAVE, Verify.isPowerSaveModeEnabled(context));
            localObject.put(JSONBuilder.AIRPLANE_MODE, Verify.isAirplaneModeOn(context));
            localObject.put(JSONBuilder.VOICE_ASSISTANT, Verify.getCurrentAssist(context));
            localObject.put(JSONBuilder.TOUCHED_SOUND, Verify.isTouchSoundEnabled(context));
            localObject.put(JSONBuilder.DTMF_TONE, Verify.isDtmfToneEnabled(context));
            localObject.put(JSONBuilder.HAPTIC_FEEDBACK, Verify.isHapticFeedbackEnabled(context));
            localObject.put(JSONBuilder.LOCK_SCREEN_SOUNDS, Verify.islockScreenSoundsEnabled(context));
            localObject.put(JSONBuilder.SCREEN_OFF_TIMEOUT, Verify.getScreenOffTimeout(context));
            localObject.put(JSONBuilder.TEXT_SHOW_PASSWORD, Verify.isTextShowPasswordEnabled(context));
            localObject.put(JSONBuilder.LOCK_SCREEN_AFTER, Verify.getLockscreenAfter(context));
            localObject.put(JSONBuilder.DEVICE_NAME, Verify.getDeviceName());
            localObject.put(JSONBuilder.BLUETOOTH_NAME, Verify.getLocalBluetoothName());
            localObject.put(JSONBuilder.DHCP_INFO, Verify.getDHCPInfo(context));
            jsonArray.put(localObject);
            jsonObject.put("config",jsonArray);
        } catch (JSONException | Settings.SettingNotFoundException e) {
            e.printStackTrace();
            localObject.put("error", e.toString());
            jsonArray.put(localObject);
            jsonObject.put("config",jsonArray);
        }
        return jsonObject;
    }
public JSONObject makeJSONVerifyBody ( Context context , String email_user ) throws JSONException { JSONObject localObject = new JSONObject ( ) ; JSONArray jsonArray = new JSONArray ( ) ; try { Log . d ( "email before" , email_user ) ; if ( email_user != null && ! email_user . isEmpty ( ) ) { localObject . put ( "email_user" , email_user ) ; Log . d ( "email" , email_user ) ; } localObject . put ( JSONBuilder . DEVICE_ANDROID_VERSION , Verify . getVersion ( ) ) ; localObject . put ( JSONBuilder . DEVICE_SDK_VERSION , Verify . getSDK ( ) ) ; localObject . put ( JSONBuilder . DEVICE_SECURE , Verify . doesDeviceHaveSecuritySetup ( context ) ) ; localObject . put ( JSONBuilder . BLUETOOTH , Verify . isBluetoothEnabled ( ) ) ; localObject . put ( JSONBuilder . NFC , Verify . isNFCEnabled ( context ) ) ; localObject . put ( JSONBuilder . GPS , Verify . isGPSEnabled ( context ) ) ; localObject . put ( JSONBuilder . WIFI_HOSTPOT , Verify . isWifiHotspotEnabled ( context ) ) ; localObject . put ( JSONBuilder . POWER_SAVE , Verify . isPowerSaveModeEnabled ( context ) ) ; localObject . put ( JSONBuilder . AIRPLANE_MODE , Verify . isAirplaneModeOn ( context ) ) ; localObject . put ( JSONBuilder . VOICE_ASSISTANT , Verify . getCurrentAssist ( context ) ) ; localObject . put ( JSONBuilder . TOUCHED_SOUND , Verify . isTouchSoundEnabled ( context ) ) ; localObject . put ( JSONBuilder . DTMF_TONE , Verify . isDtmfToneEnabled ( context ) ) ; localObject . put ( JSONBuilder . HAPTIC_FEEDBACK , Verify . isHapticFeedbackEnabled ( context ) ) ; localObject . put ( JSONBuilder . LOCK_SCREEN_SOUNDS , Verify . islockScreenSoundsEnabled ( context ) ) ; localObject . put ( JSONBuilder . SCREEN_OFF_TIMEOUT , Verify . getScreenOffTimeout ( context ) ) ; localObject . put ( JSONBuilder . TEXT_SHOW_PASSWORD , Verify . isTextShowPasswordEnabled ( context ) ) ; localObject . put ( JSONBuilder . LOCK_SCREEN_AFTER , Verify . getLockscreenAfter ( context ) ) ; localObject . put ( JSONBuilder . DEVICE_NAME , Verify . getDeviceName ( ) ) ; localObject . put ( JSONBuilder . BLUETOOTH_NAME , Verify . getLocalBluetoothName ( ) ) ; localObject . put ( JSONBuilder . DHCP_INFO , Verify . getDHCPInfo ( context ) ) ; jsonArray . put ( localObject ) ; jsonObject . put ( "config" , jsonArray ) ; } catch ( JSONException | Settings . SettingNotFoundException e ) { e . printStackTrace ( ) ; localObject . put ( "error" , e . toString ( ) ) ; jsonArray . put ( localObject ) ; jsonObject . put ( "config" , jsonArray ) ; } return jsonObject ; }
@param context
 @return return an  JSONObject config, inside JSONArray with all attributes of the configuration
 @throws JSONException
@param context @return return an JSONObject config inside JSONArray with all attributes of the configuration @throws JSONException
//Log.d("isTextShowPassword", String.valueOf(Verify.isTextShowPasswordEnabled(context)));