<commit_before>package com.gamesys.plugin;

import org.apache.cordova.*;

import android.webkit.WebSettings;
import android.webkit.WebView;

public class UserAgent extends CordovaPlugin {
    @Override
	public void initialize(CordovaInterface cordova, CordovaWebView webView) {
	    super.initialize(cordova, webView);
        // TODO: Load cordova settings
        String userAgent = null;
        // TODO: Set user agent
        WebSettings settings = ((WebView) webView.getEngine().getView()).getSettings();
        settings.setUserAgentString();
	}
}<commit_msg>Implemented Android part.<commit_after>package com.gamesys.plugin;

import org.apache.cordova.*;

import android.webkit.WebSettings;
import android.webkit.WebView;

public class UserAgent extends CordovaPlugin {
    private static final String kUserAgent = "useragent";
    private static final String kUserAgentPrefix = "useragentprefix";
    private static final String kUserAgentPostfix = "useragentpostfix";

    @Override
    public void initialize(CordovaInterface cordova, CordovaWebView webView) {
        super.initialize(cordova, webView);
        // Load cordova settings
        String userAgent = cordova.getActivity().getIntent().getStringExtra(kUserAgent);
        String userAgentPrefix = cordova.getActivity().getIntent().getStringExtra(kUserAgentPrefix);
        String userAgentPostfix = cordova.getActivity().getIntent().getStringExtra(kUserAgentPostfix);

        // Build user agent
        WebSettings settings = ((WebView) webView.getEngine().getView()).getSettings();
        if (userAgent == null) {
            userAgent = settings.getUserAgentString();
        }
        if (userAgentPrefix != null) {
            userAgent = userAgentPrefix + " " + userAgent;
        }
        if (userAgentPostfix != null) {
            userAgent = userAgent + " " + userAgentPostfix;
        }

        // Set user agent
        settings.setUserAgentString(userAgent);
    }
}
{'fraction_non_alphanumeric': 0.09862033725089422, 'fraction_numerical': 0.0, 'mean_word_length': 3.351111111111111, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7119545', 'n_tokens_mistral': 524, 'n_tokens_neox': 512, 'n_words': 120}