之前我從中國帶回來了小愛AI音箱,在加上台灣買的石頭掃地機器人, APP使用大陸區域,結果找不到掃地機器人, 在不同地區買的機器,結果這兩個機器不能放在同個APP裡, 非常的麻煩,花了點時間找了一下解決方法。
以下為參考 米家APP 地區限制支援台灣版本 ANDROID
原連結提供了有兩種方式可以解除限制,
- 備份後還原米家APP
之前我從中國帶回來了小愛AI音箱,在加上台灣買的石頭掃地機器人, APP使用大陸區域,結果找不到掃地機器人, 在不同地區買的機器,結果這兩個機器不能放在同個APP裡, 非常的麻煩,花了點時間找了一下解決方法。
以下為參考 米家APP 地區限制支援台灣版本 ANDROID
原連結提供了有兩種方式可以解除限制,
| import sys | |
| import json | |
| from datetime import datetime | |
| def fixup_str(text): | |
| return text.encode('latin1').decode('utf8') | |
| def fixup_list(l): |
| 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) |
| <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"/> |
| package com.cyrilmottier.android.citybikes.provider; | |
| import android.net.Uri; | |
| import com.cyrilmottier.android.avelov.BuildConfig; | |
| /** | |
| * @author Cyril Mottier | |
| */ | |
| public class CityBikesContract { |
| 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 |
| <?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" |
| 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 |
| 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) |
| <?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> |