getOpenSourceSoftwareLicenseInfo is returning null now

前端 未结 4 594
北恋
北恋 2021-02-15 00:45

A trivial but annoying issue has come up in the last few days. Previously my menu option which popped up a dialog to show the legal text for using Google Services was very full

4条回答
  •  广开言路
    2021-02-15 01:34

    If you're maintaining an old app and can't reasonably update from a very old version of Google Play Services without breaking a whole lot of ancient features, there's a viable workaround:

    Decompile the getOpenSourceSoftwareLicenseInfo() method with Android Studio, copy the method into your project, and change the line to point from "oss_notice" to "third_party_licenses".

        Uri var1 = (new android.net.Uri.Builder()).scheme("android.resource").authority("com.google.android.gms").appendPath("raw").appendPath("oss_notice").build();
    

    to

        Uri var1 = (new android.net.Uri.Builder()).scheme("android.resource").authority("com.google.android.gms").appendPath("raw").appendPath("third_party_licenses").build();
    

提交回复
热议问题