Skip to content

Instantly share code, notes, and snippets.

View sdex's full-sized avatar
🇺🇦

Yuriy Mysochenko sdex

🇺🇦
View GitHub Profile
@sdex
sdex / config.xml
Last active March 10, 2023 09:03
The Android system config files that https://github.com/sdex/ConfigViewer displays
<?xml version='1.0' encoding='UTF-8' standalone='yes' ?>
<settings version="-1">
<setting id="453" name="adservices/fledge_custom_audience_max_ads_size_b" value="10240" package="com.google.android.gms" preserve_in_restore="true" />
<setting id="445" name="adservices/fledge_background_fetch_enabled" value="true" package="com.google.android.gms" preserve_in_restore="true" />
<setting id="372" name="telephony/is_telephony_anomaly_report_enabled" value="true" package="com.google.android.gms" preserve_in_restore="true" />
<setting id="388" name="runtime_native/use_app_image_startup_cache" value="true" package="com.google.android.gms" preserve_in_restore="true" />
<setting id="767" name="storage_native_boot/target_dirty_ratio" value="80" package="com.google.android.gms" preserve_in_restore="true" />
<setting id="139" name="runtime_native/metrics.reporting-spec-server" value="null" package="com.google.android.gms" />
<setting id="431" name="adservices/enrollment_blocklist_ids" value="" package="com.goo
# Python 3 !!
# folder structures:
'''
haominshi@MacBook-Pro-de-Haomin:~/Desktop$ tree diff
diff
├── Android_xml_content.txt
├── Android_xml_key.txt
├── Android_xml_key_stylized.txt
├── android_string_sorted.txt
├── android_string_sorted_final.txt
<?xml version='1.0' encoding='UTF-8' standalone='yes' ?>
<settings version="-1">
<setting id="0" name="userkey" value="E82393FC2FCC01D402B6CAFA37AFB7964FBBEE938C45BC41FBE2D971FDF6D306" package="android" defaultValue="E82393FC2FCC01D402B6CAFA37AFB7964FBBEE938C45BC41FBE2D971FDF6D306" defaultSysSet="true" tag="null" />
<setting id="5" name="10010" value="FFF852E5419D7067" package="com.sdex.androididchanger" defaultValue="FFF852E5419D7067" defaultSysSet="false" tag="null" />
<setting id="3" name="10070" value="AAA3FA682D1561BA" package="com.sdex.activityrunner" defaultValue="AAA3FA682D1561BA" defaultSysSet="false" tag="null" />
<setting id="6" name="10072" value="79fcd0d800b9ded9" package="com.google.android.gms" defaultValue="79fcd0d800b9ded9" defaultSysSet="false" tag="null" />
<setting id="4" name="10075" value="79fcd0d800b9ded9" package="com.android.vending" defaultValue="79fcd0d800b9ded9" defaultSysSet="false" tag="null" />
<setting id="7" name="10082" value="79fcd0d800b9ded9" package="com.google
@sdex
sdex / manifest
Created April 14, 2016 08:40
Remove permissions during manifest merge
<uses-permission
android:name="android.permission.VIBRATE"
tools:node="remove"
tools:selector="com.libpackage">
</uses-permission>
@sdex
sdex / CountryAutoCompleteAdapter.java
Created November 20, 2015 11:28
Android: AutoCompleteTextView with Realm.io database
/*
* Copyright 2015 Yuriy Mysochenko
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
@sdex
sdex / CursorRecyclerAdapter.java
Last active August 29, 2015 14:26 — forked from quanturium/CursorRecyclerAdapter.java
A simple implementation of CursorAdapter for the new RecyclerView. It is designed to work with CursorLoaders and do not register any content observer (which can cause leaks if not handled properly)
/*
* The MIT License (MIT)
*
* Copyright (c) 2015 ARNAUD FRUGIER
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
private void debugIntent(Intent intent, String tag) {
Log.v(tag, "action: " + intent.getAction());
Log.v(tag, "component: " + intent.getComponent());
Bundle extras = intent.getExtras();
if (extras != null) {
for (String key: extras.keySet()) {
Log.v(tag, "key [" + key + "]: " +
extras.get(key));
}
@sdex
sdex / point_position.py
Last active August 29, 2015 14:11
Determining point position
# https://pp.vk.me/c625329/v625329501/1e47/wWQSR_4v0bA.jpg
import math
def spo(color, x, y):
result = {
'red': lambda x,y: x + 10/(x+y),
'blue': lambda x,y: x + 1/y,
'yellow': lambda x,y: x/(y-x),
'white' : lambda x,y: x * y
import android.view.View;
import android.view.ViewGroup.MarginLayoutParams;
/**
* Allows an ObjectAnimator to set/get margins of a view
* how to use:
* MarginProxy marginProxy = new MarginProxy(noteContainer);
* ObjectAnimator marginAnimation = ObjectAnimator.ofInt(marginProxy, "topMargin", oldTopMargin, newTopMargin).setDuration(300);
*/
public class MarginProxy {