Skip to content

Instantly share code, notes, and snippets.

View ads901119's full-sized avatar

Alan Sha ads901119

View GitHub Profile

之前我從中國帶回來了小愛AI音箱,在加上台灣買的石頭掃地機器人, APP使用大陸區域,結果找不到掃地機器人, 在不同地區買的機器,結果這兩個機器不能放在同個APP裡, 非常的麻煩,花了點時間找了一下解決方法。

以下為參考 米家APP 地區限制支援台灣版本 ANDROID

原連結提供了有兩種方式可以解除限制,

  1. 備份後還原米家APP
@multun
multun / message_json_parser.py
Created December 26, 2018 22:51
Pretty-print a facebook message.json, fixing up broken encoding
import sys
import json
from datetime import datetime
def fixup_str(text):
return text.encode('latin1').decode('utf8')
def fixup_list(l):
@paour
paour / build_extras.gradle
Last active October 5, 2016 12:04
A simpler and more fool-proof way to handle search providers in Android Gradle builds
def overrideProviderAuthority(packageName, inFile, outFile) {
def xml = new XmlParser().parse(inFile)
xml.findAll{it.name() == 'string'}.each{item ->
if (!item.value().isEmpty() && item.value()[0] instanceof String && item.value()[0].startsWith(".res-auto")) {
item.value()[0] = item.value()[0].replace(".res-auto", packageName)
}
}
saveXML(outFile, xml)
@jnagels
jnagels / AndroidManifest.xml
Created January 6, 2014 10:01
Building with Android Gradle Plugin 0.7.+
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.myapp">
<!-- {packagename} will be replaced by the actual packagename -->
<!-- Custom permission to safely send broadcasts between processes -->
<permission
android:name="{packagename}.permission.RECEIVE_BROADCASTS"
android:protectionLevel="signature"/>
@cyrilmottier
cyrilmottier / CityBikesContract.java
Last active January 12, 2024 18:04
Using the new Gradle-based Android build system: a second example
package com.cyrilmottier.android.citybikes.provider;
import android.net.Uri;
import com.cyrilmottier.android.avelov.BuildConfig;
/**
* @author Cyril Mottier
*/
public class CityBikesContract {
@cyrilmottier
cyrilmottier / ResourcesAdditions.java
Last active January 12, 2024 17:55
Lightweight key-value pairs resources for Android applications.
package com.cyrilmottier.android.resourcesadditions;
import android.content.res.Resources;
import android.content.res.XmlResourceParser;
import android.os.Bundle;
import org.xmlpull.v1.XmlPullParser;
import org.xmlpull.v1.XmlPullParserException;
/**
* @author Cyril Mottier
@cmelchior
cmelchior / AndroidManifest.xml
Last active December 25, 2015 13:59
Adding support for ".res-auto" in ContentProvider authorities in AndroidManifest.xml. This replaces ".res-auto" with the current package name, making it possible to install multiple build variants on the same devices without getting [INSTALL_FAILED_CONFLICTING_PROVIDER]
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.trifork.example"
android:installLocation="auto"
android:versionName="@string/client_info" >
<!-- ... -->
<application
android:hardwareAccelerated="true"
@mderazon
mderazon / ClearableAutoCompleteTextView.java
Last active November 30, 2018 16:42
a sub class of AutoCompleteTextView that has a dismiss button with OnClearListener when the clear button is clicked
import android.content.Context;
import android.graphics.drawable.Drawable;
import android.util.AttributeSet;
import android.view.MotionEvent;
import android.view.View;
import android.widget.AutoCompleteTextView;
/**
* sub class of {@link android.widget.AutoCompleteTextView} that includes a clear (dismiss / close) button with
* a OnClearListener to handle the event of clicking the button
@makisarvin
makisarvin / ParsingExample.scala
Last active December 20, 2015 05:29
working with Serializers and Deserializers in MongoDB Casbah
package com.arvanitis
import org.bson.{BSON, Transformer}
import com.mongodb.casbah.Imports._
import com.mongodb.casbah.commons.conversions.MongoConversionHelper
// The business classes for the example
case class Offer(name: String, product:Option[Product])
case class Product(name: String, description: String, price: Double)
@cyrilmottier
cyrilmottier / _app_avelibRelease_res_values_config.xml
Last active November 20, 2020 11:27
Using the new Gradle-based Android build system: an example
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="config_app_name">AVélib</string>
<string name="config_authority">com.cyrilmottier.android.avelib.citybikes</string>
<string name="config_com.google.android.maps.v2.api_key">XXX</string>
</resources>