// Path: app/src/main/java/rkr/simplekeyboard/inputmethod/latin/settings/SettingsValues.java
// public class SettingsValues {
//     public static final float DEFAULT_SIZE_SCALE = 1.0f; // 100%
// 
//     // From resources:
//     public final SpacingAndPunctuations mSpacingAndPunctuations;
//     // From configuration:
//     public final boolean mHasHardwareKeyboard;
//     public final int mDisplayOrientation;
//     // From preferences, in the same order as xml/prefs.xml:
//     public final boolean mAutoCap;
//     public final boolean mVibrateOn;
//     public final boolean mSoundOn;
//     public final boolean mKeyPreviewPopupOn;
//     public final boolean mShowsLanguageSwitchKey;
//     public final boolean mImeSwitchEnabled;
//     public final int mKeyLongpressTimeout;
//     public final boolean mHideSpecialChars;
//     public final boolean mShowNumberRow;
//     public final boolean mSpaceSwipeEnabled;
//     public final boolean mDeleteSwipeEnabled;
//     public final boolean mUseMatchingNavbarColor;
// 
//     // From the input box
//     public final InputAttributes mInputAttributes;
// 
//     // Deduced settings
//     public final int mKeypressVibrationDuration;
//     public final float mKeypressSoundVolume;
//     public final int mKeyPreviewPopupDismissDelay;
// 
//     // Debug settings
//     public final float mKeyboardHeightScale;
// 
//     public SettingsValues(final SharedPreferences prefs, final Resources res,
//             final InputAttributes inputAttributes) {
//         // Get the resources
//         mSpacingAndPunctuations = new SpacingAndPunctuations(res);
// 
//         // Store the input attributes
//         mInputAttributes = inputAttributes;
// 
//         // Get the settings preferences
//         mAutoCap = prefs.getBoolean(Settings.PREF_AUTO_CAP, true);
//         mVibrateOn = Settings.readVibrationEnabled(prefs, res);
//         mSoundOn = Settings.readKeypressSoundEnabled(prefs, res);
//         mKeyPreviewPopupOn = Settings.readKeyPreviewPopupEnabled(prefs, res);
//         mShowsLanguageSwitchKey = Settings.readShowLanguageSwitchKey(prefs);
//         mImeSwitchEnabled = Settings.readEnableImeSwitch(prefs);
//         mHasHardwareKeyboard = Settings.readHasHardwareKeyboard(res.getConfiguration());
// 
//         // Compute other readable settings
//         mKeyLongpressTimeout = Settings.readKeyLongpressTimeout(prefs, res);
//         mKeypressVibrationDuration = Settings.readKeypressVibrationDuration(prefs, res);
//         mKeypressSoundVolume = Settings.readKeypressSoundVolume(prefs, res);
//         mKeyPreviewPopupDismissDelay = res.getInteger(R.integer.config_key_preview_linger_timeout);
//         mKeyboardHeightScale = Settings.readKeyboardHeight(prefs, DEFAULT_SIZE_SCALE);
//         mDisplayOrientation = res.getConfiguration().orientation;
//         mHideSpecialChars = Settings.readHideSpecialChars(prefs);
//         mShowNumberRow = Settings.readShowNumberRow(prefs);
//         mSpaceSwipeEnabled = Settings.readSpaceSwipeEnabled(prefs);
//         mDeleteSwipeEnabled = Settings.readDeleteSwipeEnabled(prefs);
//         mUseMatchingNavbarColor = Settings.readUseMatchingNavbarColor(prefs);
//     }
// 
//     public boolean isWordSeparator(final int code) {
//         return mSpacingAndPunctuations.isWordSeparator(code);
//     }
// 
//     public boolean isLanguageSwitchKeyDisabled() {
//         return !mShowsLanguageSwitchKey;
//     }
// 
//     public boolean isSameInputType(final EditorInfo editorInfo) {
//         return mInputAttributes.isSameInputType(editorInfo);
//     }
// 
//     public boolean hasSameOrientation(final Configuration configuration) {
//         return mDisplayOrientation == configuration.orientation;
//     }
// }


import rkr.simplekeyboard.inputmethod.latin.settings.SettingsValues;
import android.content.res.Resources;
import android.content.res.TypedArray;
import android.graphics.Color;
import android.os.Build;
import android.text.TextUtils;
import android.util.DisplayMetrics;
import android.util.Log;
import android.util.TypedValue;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.regex.PatternSyntaxException;
import rkr.simplekeyboard.inputmethod.R;
    }

    private static boolean fulfillsCondition(final HashMap<String,String> keyValuePairs,
            final String condition) throws DeviceOverridePatternSyntaxError {
        final String[] patterns = condition.split(":");
        // Check all patterns in a condition are true
        boolean matchedAll = true;
        for (final String pattern : patterns) {
            final int posEqual = pattern.indexOf('=');
            if (posEqual < 0) {
                throw new DeviceOverridePatternSyntaxError("Pattern has no '='", condition);
            }
            final String key = pattern.substring(0, posEqual);
            final String value = keyValuePairs.get(key);
            if (value == null) {
                throw new DeviceOverridePatternSyntaxError("Unknown key", condition);
            }
            final String patternRegexpValue = pattern.substring(posEqual + 1);
            try {
                if (!value.matches(patternRegexpValue)) {
                    matchedAll = false;
                    // And continue walking through all patterns.
                }
            } catch (final PatternSyntaxException e) {
                throw new DeviceOverridePatternSyntaxError("Syntax error", condition, e);
            }
        }
        return matchedAll;
    }

// Path: app/src/main/java/rkr/simplekeyboard/inputmethod/latin/settings/SettingsValues.java
// public class SettingsValues {
//     public static final float DEFAULT_SIZE_SCALE = 1.0f; // 100%
// 
//     // From resources:
//     public final SpacingAndPunctuations mSpacingAndPunctuations;
//     // From configuration:
//     public final boolean mHasHardwareKeyboard;
//     public final int mDisplayOrientation;
//     // From preferences, in the same order as xml/prefs.xml:
//     public final boolean mAutoCap;
//     public final boolean mVibrateOn;
//     public final boolean mSoundOn;
//     public final boolean mKeyPreviewPopupOn;
//     public final boolean mShowsLanguageSwitchKey;
//     public final boolean mImeSwitchEnabled;
//     public final int mKeyLongpressTimeout;
//     public final boolean mHideSpecialChars;
//     public final boolean mShowNumberRow;
//     public final boolean mSpaceSwipeEnabled;
//     public final boolean mDeleteSwipeEnabled;
//     public final boolean mUseMatchingNavbarColor;
// 
//     // From the input box
//     public final InputAttributes mInputAttributes;
// 
//     // Deduced settings
//     public final int mKeypressVibrationDuration;
//     public final float mKeypressSoundVolume;
//     public final int mKeyPreviewPopupDismissDelay;
// 
//     // Debug settings
//     public final float mKeyboardHeightScale;
// 
//     public SettingsValues(final SharedPreferences prefs, final Resources res,
//             final InputAttributes inputAttributes) {
//         // Get the resources
//         mSpacingAndPunctuations = new SpacingAndPunctuations(res);
// 
//         // Store the input attributes
//         mInputAttributes = inputAttributes;
// 
//         // Get the settings preferences
//         mAutoCap = prefs.getBoolean(Settings.PREF_AUTO_CAP, true);
//         mVibrateOn = Settings.readVibrationEnabled(prefs, res);
//         mSoundOn = Settings.readKeypressSoundEnabled(prefs, res);
//         mKeyPreviewPopupOn = Settings.readKeyPreviewPopupEnabled(prefs, res);
//         mShowsLanguageSwitchKey = Settings.readShowLanguageSwitchKey(prefs);
//         mImeSwitchEnabled = Settings.readEnableImeSwitch(prefs);
//         mHasHardwareKeyboard = Settings.readHasHardwareKeyboard(res.getConfiguration());
// 
//         // Compute other readable settings
//         mKeyLongpressTimeout = Settings.readKeyLongpressTimeout(prefs, res);
//         mKeypressVibrationDuration = Settings.readKeypressVibrationDuration(prefs, res);
//         mKeypressSoundVolume = Settings.readKeypressSoundVolume(prefs, res);
//         mKeyPreviewPopupDismissDelay = res.getInteger(R.integer.config_key_preview_linger_timeout);
//         mKeyboardHeightScale = Settings.readKeyboardHeight(prefs, DEFAULT_SIZE_SCALE);
//         mDisplayOrientation = res.getConfiguration().orientation;
//         mHideSpecialChars = Settings.readHideSpecialChars(prefs);
//         mShowNumberRow = Settings.readShowNumberRow(prefs);
//         mSpaceSwipeEnabled = Settings.readSpaceSwipeEnabled(prefs);
//         mDeleteSwipeEnabled = Settings.readDeleteSwipeEnabled(prefs);
//         mUseMatchingNavbarColor = Settings.readUseMatchingNavbarColor(prefs);
//     }
// 
//     public boolean isWordSeparator(final int code) {
//         return mSpacingAndPunctuations.isWordSeparator(code);
//     }
// 
//     public boolean isLanguageSwitchKeyDisabled() {
//         return !mShowsLanguageSwitchKey;
//     }
// 
//     public boolean isSameInputType(final EditorInfo editorInfo) {
//         return mInputAttributes.isSameInputType(editorInfo);
//     }
// 
//     public boolean hasSameOrientation(final Configuration configuration) {
//         return mDisplayOrientation == configuration.orientation;
//     }
// }


// Path: app/src/main/java/rkr/simplekeyboard/inputmethod/latin/utils/ResourceUtils.java
import rkr.simplekeyboard.inputmethod.latin.settings.SettingsValues;
import android.content.res.Resources;
import android.content.res.TypedArray;
import android.graphics.Color;
import android.os.Build;
import android.text.TextUtils;
import android.util.DisplayMetrics;
import android.util.Log;
import android.util.TypedValue;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.regex.PatternSyntaxException;
import rkr.simplekeyboard.inputmethod.R;

    }

    private static boolean fulfillsCondition(final HashMap<String,String> keyValuePairs,
            final String condition) throws DeviceOverridePatternSyntaxError {
        final String[] patterns = condition.split(":");
        // Check all patterns in a condition are true
        boolean matchedAll = true;
        for (final String pattern : patterns) {
            final int posEqual = pattern.indexOf('=');
            if (posEqual < 0) {
                throw new DeviceOverridePatternSyntaxError("Pattern has no '='", condition);
            }
            final String key = pattern.substring(0, posEqual);
            final String value = keyValuePairs.get(key);
            if (value == null) {
                throw new DeviceOverridePatternSyntaxError("Unknown key", condition);
            }
            final String patternRegexpValue = pattern.substring(posEqual + 1);
            try {
                if (!value.matches(patternRegexpValue)) {
                    matchedAll = false;
                    // And continue walking through all patterns.
                }
            } catch (final PatternSyntaxException e) {
                throw new DeviceOverridePatternSyntaxError("Syntax error", condition, e);
            }
        }
        return matchedAll;
    }

    public static int getKeyboardHeight(final Resources res, final SettingsValues settingsValues) {