Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Permission issue with PION WebRTC under GOMOBILE Android >= 11 (SDK 30) - EDIT: SOLVED BY https://github.com/golang/go/pull/61089 #2640

Closed
neilyoung opened this issue Dec 28, 2023 · 87 comments
Labels
bug Something isn't working difficulty:easy

Comments

@neilyoung
Copy link

Your environment.

  • Version: latest
  • Browser: doesn't matter
  • Other Information -none

What did you do?

I did choose https://github.com/pion/webrtc/tree/master/examples/custom-logger

Took the code from main.go and used it to build an *.AAR to import that into my Android app. Main was exported
Android called Main and this is what I got:

I/GoLog: Creating logger for pc 
I/GoLog: Creating logger for ice 
I/GoLog: Creating logger for ortc 
I/GoLog: Creating logger for DTLSTransport 
I/GoLog: Creating logger for ortc 
I/GoLog: Creating logger for pc 
I/GoLog: Creating logger for ice 
I/GoLog: Creating logger for ortc 
I/GoLog: Creating logger for DTLSTransport 
I/GoLog: Creating logger for ortc 
I/GoLog: Creating logger for ice 
W/Thread-2: type=1400 audit(0.0:48): avc: denied { bind } for scontext=u:r:untrusted_app:s0:c157,c256,c512,c768 tcontext=u:r:untrusted_app:s0:c157,c256,c512,c768 tclass=netlink_route_socket permissive=0 bug=b/155595000 app=com.vx.myapplication
E/Go: panic: failed to create network: route ip+net: netlinkrib: permission denied
A/libc: Fatal signal 6 (SIGABRT), code -6 (SI_TKILL) in tid 28814 (Thread-2), pid 28615 (x.myapplication)

What did you expect?

I think there should be no permission issue. This permission thing btw is only affecting Android devices with Android > 10 (as documented in the Android SDK). I don't know who has to work around, I would just like to raise this problem (and of course get a solution on a longer run, if possible)

What happened?

Permission issue as shown above, likely because of the new restrictions introduced by Android SDK 30. More details in discussions:

#2636 Permission issue with PION WebRTC under GOMOBILE Android >= 11
https://github.com/[pion/webrtc](https://github.com/pion/webrtc)|pion/webrtcpion/webrtc | 13. Dez. | Hinzugefügt von GitHub

@suutaku
Copy link

suutaku commented Dec 29, 2023

same problem. but after did some research, it's a golang issue. to fix it, maybe we need modify golang source code and build a new binary to build our aar.

@neilyoung
Copy link
Author

Yes, you might be right. I was just "knocking on the bush". However, even there is a patch, this seems to introduce a circular reference, if I get that right. Other than that I don't know where to patch these files on my local machine

@suutaku
Copy link

suutaku commented Dec 29, 2023

ok...just clone golang source code, modify files as mentioned on this, fix the circular reference issue by remove os.IsPermission(err), build a new version of go and replace your local binaries. see install go from souce.

@neilyoung
Copy link
Author

Did you already try that? Did it work?

@suutaku
Copy link

suutaku commented Dec 29, 2023

Did you already try that? Did it work?

No, But worth to try. I removed webrtc communication from my application temporarily. after other work finished i will try it.

@neilyoung
Copy link
Author

OK, I'm on it right now. GOLANG compilation ok. Patching now. Will report

@neilyoung
Copy link
Author

neilyoung commented Dec 29, 2023

Stuck. It started well. Initial compilation on Ubuntu 20.04 fine. Then I patched the code. I have the feeling that the patch of this file can be omitted at all https://go-review.googlesource.com/c/go/+/507415/5/src/syscall/netlink_linux.go, but for now I just dropped the permission error check. Additional compilation fine.

I replaced the two binaries found in /usr/local/go/bin by the newly generated in ./goroot/bin. Basically go and gofmt.

Now when I run my gomobile command I'm getting a new error. Seems, I'm missing some architectures support now.

(base) ubuntu@simulator:~/AndroidStudioProjects/me/MyApplication/app/golang$ gomobile bind -target=android -o livekit.aar
gomobile: err: exit status 1: stderr: compile: invalid GOARM: must be 5, 6, 7
go: error obtaining buildID for go tool compile: exit status 2

EDIT: Seems it was a version mismatch. I initially patched master, but my previous binary installation was 1.21.5. I then checked out 1.21.5 and made the changes again. This time my gomobile command went through, but at runtime the same problem appeared: Permission issue, panic.

Either this patch doesn't change anything or there are still other places to change or I'm unable to make use of the changed version somehow (not sure, how go dependencies are bound, but I could imagine I would have to change some dependencies in my go.mod too in order to use the patched stuff)

@neilyoung
Copy link
Author

neilyoung commented Dec 29, 2023

Update. I believe I will have to build the packages net and sys instead of the compiler itself...

@suutaku
Copy link

suutaku commented Jan 1, 2024

sorry. after some testing. i had modified GO_ROOT/libexec/src/net/interface_linux.go, in this way we don't need compile go or gomobile, but result is same, still got route ip+net: netlinkrib: permission denied error. maybe we should dig it deeper by adding some debug info.

@suutaku
Copy link

suutaku commented Jan 1, 2024

OK, the error comes from syscall.NetlinkRIB(syscall.RTM_GETADDR, syscall.AF_UNSPEC), so we can say, the RTM_GETADDR + ioctl approach to obtain network card information not working.

@neilyoung
Copy link
Author

Happy new year to you.

OK, the error comes from syscall.NetlinkRIB(syscall.RTM_GETADDR, syscall.AF_UNSPEC), so we can say, the RTM_GETADDR + ioctl approach to obtain network card information not working.

I'm not that confident to find the problem in the compiler itself. I have changed the signature of the panic in interfaceTableAndroid:

func interfaceTableAndroid(ifindex int) ([]Interface, error) {
	tab, err := syscall.NetlinkRIB(syscall.RTM_GETADDR, syscall.AF_UNSPEC)
	if err != nil {
//		return nil, os.NewSyscallError("netlinkrib", err)
		return nil, os.NewSyscallError("BlaBla", err)
	}

expecting to see that "blabla" instead of "netlinkrib" to no avail.

I more believe to find the root of the problem somewhere in these modules, which are bound to my project implicitly:

golang.org/x/mobile v0.0.0-20231127183840-76ac6878050a // indirect
golang.org/x/mod v0.14.0 // indirect
golang.org/x/net v0.19.0 // indirect
golang.org/x/sync v0.5.0 // indirect
golang.org/x/sys v0.15.0 // indirect
golang.org/x/text v0.14.0 // indirect
golang.org/x/tools v0.16.0 // indirect

@suutaku
Copy link

suutaku commented Jan 1, 2024

is interfaceTableAndroid in your GOROOT/libexec/src/interface_linux.go ? i'm pretty sure logs in interface_linux.go will print out because that's exactly what i did.

@neilyoung
Copy link
Author

Can you post your changed interface_linux.go please?

@neilyoung
Copy link
Author

Confused. Where is GOROOT/libexec/src/interface_linux.go? I'm not having that path. Mine is goroot/src/interface_linux.go. Are we talking about different things?

@suutaku
Copy link

suutaku commented Jan 1, 2024

basically, GOROOT should be your golang install path. I installed golang with homebrew, and the path is /opt/homebrew/Cellar/go/1.21.5/libexec/src/net, if you are using ubuntu, it should be /usr/local/go

@suutaku
Copy link

suutaku commented Jan 1, 2024

Can you post your changed interface_linux.go please?

i just reset the code when i found it's not working as excepted. but it's same with this, to resolve build issue, change:

os.IsPermission(err) 

to

if e, ok := err.(Errno); !ok && !e.Is(oserror.ErrPermission) {
	return nil, err
}

as netlink_linux.go did

@neilyoung
Copy link
Author

I really have doubts that this is the right place for the change. I can't see any reaction of the code other than that permission error, regardless of how I change the things.

@neilyoung
Copy link
Author

basically, GOROOT should be your golang install path. I installed golang with homebrew, and the path is /opt/homebrew/Cellar/go/1.21.5/libexec/src/net, if you are using ubuntu, it should be /usr/local/go

I agree, /usr/local/go is the path for Ubuntu, but there is no libexec.

One thing is maybe wrong on my side. I cloned the sources to ~/home/goroot. I applied the changes in that dir and ran from src/all.bash. The results are two binaries in ~/home/goroot/bin: go and gofmt. I just copied those two bins to /usr/local/go/bin.

Should I apply the changes in /usr/local/go instead?

@neilyoung
Copy link
Author

No, not working either...

(base) ubuntu@simulator:/usr/local/go/src$ ./all.bash
ERROR: Cannot find /home/ubuntu/go1.4/bin/go.
Set $GOROOT_BOOTSTRAP to a working Go tree >= Go 1.17.13.
(base) ubuntu@simulator:/usr/local/go/src$ ^C

@neilyoung
Copy link
Author

I'm going to drop this. I'm not the go expert, it is just a means to reach some target, don't like that either.

Thanks for your efforts

@suutaku
Copy link

suutaku commented Jan 1, 2024

@neilyoung fixed android 11 netlink issue by modify transport package and created a PR.
before code merged, you can modify code by yourself as PR did.

@neilyoung
Copy link
Author

You fixed it for pion by replacing net by a fork anet, right? I think I tried that anet too already, it didn't fix my issue (discussion here golang/go#40569). I was using net.Listen, which is not covered by the anet fix. Thanks anyway.

@suutaku
Copy link

suutaku commented Jan 2, 2024

@neilyoung i don't know if tcp listen will works, but if you are using UDP, just change l, mdnsErr := n.ListenUDP("udp4", addr) to l, mdnsErr := net.Listen("unixgram", mdns.DefaultAddress) at createMulticastDNS in github.com/pion/ice/v2@v2.3.11/mdns.go, and listen will works.

func createMulticastDNS(n transport.Net, mDNSMode MulticastDNSMode, mDNSName string, log logging.LeveledLogger) (*mdns.Conn, MulticastDNSMode, error) {
	if mDNSMode == MulticastDNSModeDisabled {
		return nil, mDNSMode, nil
	}

	// addr, mdnsErr := n.ResolveUDPAddr("udp4", mdns.DefaultAddress)
	// if mdnsErr != nil {
	// 	return nil, mDNSMode, mdnsErr
	// }
	l, mdnsErr := net.Listen("unixgram", mdns.DefaultAddress)
	// l, mdnsErr := n.ListenUDP("udp4", addr)
	if mdnsErr != nil {
		// If ICE fails to start MulticastDNS server just warn the user and continue
		log.Errorf("Failed to enable mDNS, continuing in mDNS disabled mode: (%s)", mdnsErr)
		return nil, MulticastDNSModeDisabled, nil
	}

	switch mDNSMode {
	case MulticastDNSModeQueryOnly:
		conn, err := mdns.Server(ipv4.NewPacketConn(l.(net.PacketConn)), &mdns.Config{})
		return conn, mDNSMode, err
	case MulticastDNSModeQueryAndGather:
		conn, err := mdns.Server(ipv4.NewPacketConn(l.(net.PacketConn)), &mdns.Config{
			LocalNames: []string{mDNSName},
		})
		return conn, mDNSMode, err
	default:
		return nil, mDNSMode, nil
	}
}

@neilyoung
Copy link
Author

Thanks for your patience, very much appreciated.

I need to listen to a UnixSocket.

BTW: This link doesn't work for me github.com/pion/ice/v2@v2.3.11/mdns.go, could you please double check?

@suutaku
Copy link

suutaku commented Jan 2, 2024

github.com/pion/ice

sorry, that's my local path, the package is github.com/pion/ice, i'm forked it and creating PR now.

@neilyoung
Copy link
Author

Not a problem. What I can't currently see is this:

  • I'm using the LifeKit Server GO SDK in my Android GO module
  • This in turn utilizes PION webrtc

Say, I would be able to have a local copy of the PION webrtc which is patched with your PRs. How could I make LifeKit server SDK use this version instead of the web based versions? Would that be only a matter of replacing some dependencies in my go.mod?

This is my current go.mod (which doesn't work with Android 11+ devices):

module [github.com/neilyoung/livekit](http://github.com/neilyoung/livekit)

go 1.21.5

require (
   [github.com/livekit/protocol](http://github.com/livekit/protocol) v1.9.3
   [github.com/livekit/server-sdk-go](http://github.com/livekit/server-sdk-go) v1.1.4
   [github.com/pion/webrtc/v3](http://github.com/pion/webrtc/v3) v3.2.24
)

require (
   [github.com/beorn7/perks](http://github.com/beorn7/perks) v1.0.1 // indirect
   [github.com/bep/debounce](http://github.com/bep/debounce) v1.2.1 // indirect
   [github.com/cespare/xxhash/v2](http://github.com/cespare/xxhash/v2) v2.2.0 // indirect
   [github.com/davecgh/go-spew](http://github.com/davecgh/go-spew) v1.1.1 // indirect
   [github.com/dgryski/go-rendezvous](http://github.com/dgryski/go-rendezvous) v0.0.0-20200823014737-9f7001d12a5f // indirect
   [github.com/eapache/channels](http://github.com/eapache/channels) v1.1.0 // indirect
   [github.com/eapache/queue](http://github.com/eapache/queue) v1.1.0 // indirect
   [github.com/frostbyte73/core](http://github.com/frostbyte73/core) v0.0.9 // indirect
   [github.com/gammazero/deque](http://github.com/gammazero/deque) v0.2.1 // indirect
   [github.com/go-jose/go-jose/v3](http://github.com/go-jose/go-jose/v3) v3.0.1 // indirect
   [github.com/go-logr/logr](http://github.com/go-logr/logr) v1.3.0 // indirect
   [github.com/go-logr/stdr](http://github.com/go-logr/stdr) v1.2.2 // indirect
   [github.com/golang/protobuf](http://github.com/golang/protobuf) v1.5.3 // indirect
   [github.com/google/uuid](http://github.com/google/uuid) v1.3.1 // indirect
   [github.com/gorilla/websocket](http://github.com/gorilla/websocket) v1.5.1 // indirect
   [github.com/jxskiss/base62](http://github.com/jxskiss/base62) v1.1.0 // indirect
   [github.com/klauspost/compress](http://github.com/klauspost/compress) v1.17.2 // indirect
   [github.com/klauspost/cpuid/v2](http://github.com/klauspost/cpuid/v2) v2.2.5 // indirect
   [github.com/lithammer/shortuuid/v4](http://github.com/lithammer/shortuuid/v4) v4.0.0 // indirect
   [github.com/livekit/mageutil](http://github.com/livekit/mageutil) v0.0.0-20230125210925-54e8a70427c1 // indirect
   [github.com/livekit/mediatransportutil](http://github.com/livekit/mediatransportutil) v0.0.0-20231130090133-bd1456add80a // indirect
   [github.com/livekit/psrpc](http://github.com/livekit/psrpc) v0.5.2 // indirect
   [github.com/mackerelio/go-osstat](http://github.com/mackerelio/go-osstat) v0.2.4 // indirect
   [github.com/magefile/mage](http://github.com/magefile/mage) v1.15.0 // indirect
   [github.com/matttproud/golang_protobuf_extensions](http://github.com/matttproud/golang_protobuf_extensions) v1.0.4 // indirect
   [github.com/nats-io/nats.go](http://github.com/nats-io/nats.go) v1.31.0 // indirect
   [github.com/nats-io/nkeys](http://github.com/nats-io/nkeys) v0.4.6 // indirect
   [github.com/nats-io/nuid](http://github.com/nats-io/nuid) v1.0.1 // indirect
   [github.com/pion/datachannel](http://github.com/pion/datachannel) v1.5.5 // indirect
   [github.com/pion/dtls/v2](http://github.com/pion/dtls/v2) v2.2.8 // indirect
   [github.com/pion/ice/v2](http://github.com/pion/ice/v2) v2.3.11 // indirect
   [github.com/pion/interceptor](http://github.com/pion/interceptor) v0.1.25 // indirect
   [github.com/pion/logging](http://github.com/pion/logging) v0.2.2 // indirect
   [github.com/pion/mdns](http://github.com/pion/mdns) v0.0.9 // indirect
   [github.com/pion/randutil](http://github.com/pion/randutil) v0.1.0 // indirect
   [github.com/pion/rtcp](http://github.com/pion/rtcp) v1.2.12 // indirect
   [github.com/pion/rtp](http://github.com/pion/rtp) v1.8.3 // indirect
   [github.com/pion/sctp](http://github.com/pion/sctp) v1.8.9 // indirect
   [github.com/pion/sdp/v3](http://github.com/pion/sdp/v3) v3.0.6 // indirect
   [github.com/pion/srtp/v2](http://github.com/pion/srtp/v2) v2.0.18 // indirect
   [github.com/pion/stun](http://github.com/pion/stun) v0.6.1 // indirect
   [github.com/pion/transport/v2](http://github.com/pion/transport/v2) v2.2.4 // indirect
   [github.com/pion/turn/v2](http://github.com/pion/turn/v2) v2.1.3 // indirect
   [github.com/pmezard/go-difflib](http://github.com/pmezard/go-difflib) v1.0.0 // indirect
   [github.com/prometheus/client_golang](http://github.com/prometheus/client_golang) v1.17.0 // indirect
   [github.com/prometheus/client_model](http://github.com/prometheus/client_model) v0.4.1-0.20230718164431-9a2bf3000d16 // indirect
   [github.com/prometheus/common](http://github.com/prometheus/common) v0.44.0 // indirect
   [github.com/prometheus/procfs](http://github.com/prometheus/procfs) v0.11.1 // indirect
   [github.com/redis/go-redis/v9](http://github.com/redis/go-redis/v9) v9.3.0 // indirect
   [github.com/stretchr/testify](http://github.com/stretchr/testify) v1.8.4 // indirect
   [github.com/thoas/go-funk](http://github.com/thoas/go-funk) v0.9.3 // indirect
   [github.com/twitchtv/twirp](http://github.com/twitchtv/twirp) v8.1.3+incompatible // indirect
   [github.com/zeebo/xxh3](http://github.com/zeebo/xxh3) v1.0.2 // indirect
   [go.uber.org/atomic](http://go.uber.org/atomic) v1.11.0 // indirect
   [go.uber.org/multierr](http://go.uber.org/multierr) v1.11.0 // indirect
   [go.uber.org/zap](http://go.uber.org/zap) v1.26.0 // indirect
   [golang.org/x/crypto](http://golang.org/x/crypto) v0.16.0 // indirect
   [golang.org/x/exp](http://golang.org/x/exp) v0.0.0-20231110203233-9a3e6036ecaa // indirect
   [golang.org/x/net](http://golang.org/x/net) v0.19.0 // indirect
   [golang.org/x/sync](http://golang.org/x/sync) v0.5.0 // indirect
   [golang.org/x/sys](http://golang.org/x/sys) v0.15.0 // indirect
   [golang.org/x/text](http://golang.org/x/text) v0.14.0 // indirect
   [google.golang.org/genproto/googleapis/rpc](http://google.golang.org/genproto/googleapis/rpc) v0.0.0-20231106174013-bbf56f31fb17 // indirect
   [google.golang.org/grpc](http://google.golang.org/grpc) v1.59.0 // indirect
   [google.golang.org/protobuf](http://google.golang.org/protobuf) v1.31.0 // indirect
   [gopkg.in/yaml.v3](http://gopkg.in/yaml.v3) v3.0.1 // indirect
)

As said, I'm an absolute GO newbie. I suppose I would have to replace at least this [github.com/pion/webrtc/v3](http://github.com/pion/webrtc/v3) v3.2.24 by the file system version then. But what about all the other, indirect references?

@suutaku
Copy link

suutaku commented Jan 2, 2024

append to your go.mod file:

replace github.com/pion/transport/v2 => /local/path/to/transport/v2

replace github.com/pion/transport/v3 => /local/path/to/transport/v3

replace github.com/pion/ice/v2 => /local/path/to/ice/v2

replace github.com/pion/ice/v3 => /local/path/to/ice/v3

webRTC deps was not clean, so we need clone both v2 and v3 and replace them.

or you just modify package which go get downloaded. i test my code with that way, it's simple, but not elegant.

@neilyoung
Copy link
Author

or you just modify package which go get downloaded. i test my code with that way, it's simple, but not elegant.

I suppose those would be overwritten with each go mod tidy?

@suutaku
Copy link

suutaku commented Jan 2, 2024

or you just modify package which go get downloaded. i test my code with that way, it's simple, but not elegant.

I suppose those would be overwritten with each go mod tidy?

not really, you can append replace code or find transport and ice package in your local and modify source code directly.

@neilyoung
Copy link
Author

or you just modify package which go get downloaded. i test my code with that way, it's simple, but not elegant.

I suppose those would be overwritten with each go mod tidy?

not really, you can append replace code or find transport and ice package in your local and modify source code directly.

Thanks. Learning something.

BTW: The initial compiler change is off the table, right? I mean the interfaceTableAndroid thingy?

@itpan8067
Copy link

@neilyoung Okay, I didn't use gomobile, I implemented it through cgo + ndk. I aslo encountered a network error in android > 11, but this method can solve it. I posted it for everyone.

@neilyoung
Copy link
Author

@itpan8067 And have you been using PION WebRTC? I m not sure if GOMOBILE is to blame, but for sure PION and this patch is not working at least not even with the simplest sample code mentioned in the beginning of this thread

@itpan8067
Copy link

@itpan8067 And have you been using PION WebRTC? I m not sure if GOMOBILE is to blame, but for sure PION and this patch is not working at least not even with the simplest sample code mentioned in the beginning of this thread

I do use pion webrtc. and my import is as follows:

package main
import (
        "io"
        "log"
        "os"
        "time"
        janus "github.com/notedit/janus-go"
        "github.com/pion/webrtc/v4"
        "github.com/pion/webrtc/v4/pkg/media"
        "github.com/pion/webrtc/v4/pkg/media/h264reader"
        "github.com/pion/interceptor"
        "github.com/pion/interceptor/pkg/cc"
        "github.com/pion/interceptor/pkg/gcc"
)

import "C"

//export StartJanus
func StartJanus(logFile *C.char, videoFile *C.char) {

}
func main(){}

compile into a dynamic library and reference .so/.h by Android NDK。

@neilyoung
Copy link
Author

Would be awesome if you could try your module with this code instead:

https://github.com/pion/webrtc/blob/master/examples/custom-logger/main.go

This example did not work here after the mentioned compiler patch.

TIA

@neilyoung
Copy link
Author

In the meantime I will try to return to the mentioned compiler patch and make the transport patch at least obsolote.

@suutaku
Copy link

suutaku commented Jan 4, 2024

@itpan8067 thanks, my friend. your method can fix half of our problems. once it's merged, i'll happy to use it.
@neilyoung about another half of our problems, disable mDNS by SettingEngine also not the best way to use. i know you are developing on android. my application both running on Android, Web, iOS, Mac, Linux. i found settingengine_js.go not defined SetICEMulticasetDNSMode . so i cannot write one code for all platforms but yon can just use it.
And the hardest problem is once we disabled mDNS, the connectivity was suck in some network environment. for now, i have no idea how to fix it bcs Android 11+ blocked socket bingding.

@neilyoung
Copy link
Author

@suutaku Agreed so far. But from may WebRTC knowledge mDNS is just an obfuscation of local private web addresses not not let them appear in the ICE negotiations. WebRTC before worked w/o this so it is just higher level privacy bullshit. Disabling it one way or the other you already mentioned shouldn't break everything.

I'm still trying to apply this patch and see if this works somehow.

@neilyoung
Copy link
Author

neilyoung commented Jan 4, 2024

@suutaku One think I could imagine to break w/o MDNS is if you are trying to communicate with Firefox in a local environment only. Firefox by default only delivers MDSN addresses by default. If these are the only candidates and the GO side cannot cope with this due to the hack, the connection might not be properly established.

But AFAIK all browsers have away to disable local address obfuscation by some flag

@itpan8067
Copy link

Would be awesome if you could try your module with this code instead:

https://github.com/pion/webrtc/blob/master/examples/custom-logger/main.go

This example did not work here after the mentioned compiler patch.

TIA

I simply wrote a demo, hope it will be helpful to you. https://github.com/itpan8067/customloggerdemo

@neilyoung
Copy link
Author

@itpan8067 Thank you very much. Meanwhile I can confirm your claim here

patches https://github.com/golang/go/pull/61089. Use this method to solve the problem. i already tried。

The reason why it works now and not a couple of days ago - unclear. But I must have made some mistakes.

At least now it is no longer necessary to patch PION transport and ice or to mess with disabling MDNS. The changes to GOLANG published here https://github.com/golang/go/pull/61089/commits by @wlynxg are fully sufficent to solve the problem with getting the networks and the listen/bind issue we had with PION. Really strange that we didn't see it.

At least this makes the problem easier to handle. I have a contact to @wlynxg, will inform him.

BTW: Why aren't u using GOMOBILE? It seems to be easier to use instead of messing with JNI and NDK, IMHO.

@neilyoung
Copy link
Author

One thing remains. I see a bunch of these traces on Android in proximity to ICE negotiation.

W/Thread-2: type=1400 audit(0.0:731): avc: denied { bind } for scontext=u:r:untrusted_app:s0:c220,c257,c512,c768 tcontext=u:r:untrusted_app:s0:c220,c257,c512,c768 tclass=netlink_route_socket permissive=0 bug=b/155595000 app=com.vx.myapplication
W/Thread-2: type=1400 audit(0.0:732): avc: denied { nlmsg_readpriv } for scontext=u:r:untrusted_app:s0:c220,c257,c512,c768 tcontext=u:r:untrusted_app:s0:c220,c257,c512,c768 tclass=netlink_route_socket permissive=0 bug=b/155595000 app=com.vx.myapplication
W/Thread-2: type=1400 audit(0.0:733): avc: denied { bind } for scontext=u:r:untrusted_app:s0:c220,c257,c512,c768 tcontext=u:r:untrusted_app:s0:c220,c257,c512,c768 tclass=netlink_route_socket permissive=0 bug=b/155595000 app=com.vx.myapplication
W/Thread-2: type=1400 audit(0.0:734): avc: denied { bind } for scontext=u:r:untrusted_app:s0:c220,c257,c512,c768 tcontext=u:r:untrusted_app:s0:c220,c257,c512,c768 tclass=netlink_route_socket permissive=0 bug=b/155595000 app=com.vx.myapplication
W/Thread-2: type=1400 audit(0.0:735): avc: denied { bind } for scontext=u:r:untrusted_app:s0:c220,c257,c512,c768 tcontext=u:r:untrusted_app:s0:c220,c257,c512,c768 tclass=netlink_route_socket permissive=0 bug=b/155595000 app=com.vx.myapplication

But it works seemingly

@neilyoung neilyoung changed the title Permission issue with PION WebRTC under GOMOBILE Android >= 11 (SDK 30) Permission issue with PION WebRTC under GOMOBILE Android >= 11 (SDK 30) - EDIT: SOLVED BY https://github.com/golang/go/pull/61089 Jan 4, 2024
@suutaku
Copy link

suutaku commented Jan 4, 2024

https://github.com/itpan8067/customloggerdemo

this bcs UPD not bind but android not returned any error message, just warning logs, so GO side didn't know what happened and continue use a broken mDNS service. but in your network environment, that's fine.

@neilyoung
Copy link
Author

You mean the errors I see?

@suutaku
Copy link

suutaku commented Jan 4, 2024

You mean the errors I see?

yes. it's come from ListenUDP, if you disabled mDNS, it's gone.

@neilyoung
Copy link
Author

OK, but despite the fact, that MDNS will not work: Can you confirm, that just applying the compiler PR now seems to be sufficient to overcome the "permission" issue. And that - except for MDNS - there need to be no patch required for ice and transport anymore?

@suutaku
Copy link

suutaku commented Jan 4, 2024

if compiler PR patched, we don't need changes for ice and transport.

@neilyoung
Copy link
Author

Where do you see the MDNS problem? In the GO module for outgoing MDNS candidates or for incoming candidates? Looks like for incoming, right?

@suutaku
Copy link

suutaku commented Jan 4, 2024

Something like oncandidate callback not called. Tomorrow i will put more details with my office network environment.

@neilyoung
Copy link
Author

Would be awesome if you could try your module with this code instead:
https://github.com/pion/webrtc/blob/master/examples/custom-logger/main.go
This example did not work here after the mentioned compiler patch.
TIA

I simply wrote a demo, hope it will be helpful to you. https://github.com/itpan8067/customloggerdemo

What is this app supposed to do?

I was running it on my OnePlus. Nothing happened so far. Just this as trace. Pressed START and SEND, not sure what shall happen. At least I see the same traces I saw w.r.t the avc denied issue


2024-01-04 18:43:33.229 18171-18171 studio.deploy           installer                            E  Could not get package user id: run-as: unknown package: com.pc.cgodemo
2024-01-04 18:43:33.256 18171-18171 studio.deploy           installer                            E  Could not find apks for this package: com.pc.cgodemo
2024-01-04 18:43:33.293 18171-18171 studio.deploy           installer                            E  Could not get package user id: run-as: unknown package: com.pc.cgodemo
2024-01-04 18:43:33.325 18171-18171 studio.deploy           installer                            E  Could not find apks for this package: com.pc.cgodemo
2024-01-04 18:43:34.260  1682-1899  PackageMan...ilsExtImpl system_server                        E  Fix up user restrict data of pkg: com.pc.cgodemo
2024-01-04 18:43:34.390  1682-1899  ArtManagerService       system_server                        E  Failed to prepare profile for com.pc.cgodemo:/data/app/~~I7dJyozGS1orTsZNGQnjfQ==/com.pc.cgodemo-OnrMEniCqUxuLpziPtkcow==/base.apk
2024-01-04 18:43:34.737  1682-1891  VerityUtils             system_server                        E  Failed to measure fs-verity, errno 1: /data/app/~~I7dJyozGS1orTsZNGQnjfQ==/com.pc.cgodemo-OnrMEniCqUxuLpziPtkcow==/base.apk
2024-01-04 18:43:34.968 13855-13855 libc                    com.pc.cgodemo                       I  SetHeapTaggingLevel: tag level set to 0
2024-01-04 18:43:34.988 13855-13855 com.pc.cgodemo          com.pc.cgodemo                       I  Late-enabling -Xcheck:jni
2024-01-04 18:43:35.007 13855-13855 com.pc.cgodemo          com.pc.cgodemo                       E  Unknown bits set in runtime_flags: 0x40000000
2024-01-04 18:43:35.007 13855-13855 com.pc.cgodemo          com.pc.cgodemo                       I  Using CollectorTypeCC GC.
2024-01-04 18:43:35.017 13855-13855 ziparchive              com.pc.cgodemo                       W  Unable to open '/system/framework/mediatek-framework.dm': No such file or directory
2024-01-04 18:43:35.018 13855-13855 ziparchive              com.pc.cgodemo                       W  Unable to open '/system/framework/mediatek-framework.dm': No such file or directory
2024-01-04 18:43:35.022 13855-13855 OneTrace                com.pc.cgodemo                       I  Mark active for pid=13855? true
2024-01-04 18:43:35.022 13855-13855 cutils-dev              com.pc.cgodemo                       D  otrace_set_tracing_enabled? true
2024-01-04 18:43:35.023 13855-18360 cutils-dev              com.pc.cgodemo                       D  properties changed in otrace_seq_number_changed!
2024-01-04 18:43:35.046 13855-13855 Compatibil...geReporter com.pc.cgodemo                       D  Compat change id reported: 171979766; UID 10401; state: DISABLED
2024-01-04 18:43:35.047 13855-13855 oplus.andr...actoryImpl com.pc.cgodemo                       I  get feature:IOplusAutoResolutionFeature
2024-01-04 18:43:35.047 13855-13855 oplus.andr...actoryImpl com.pc.cgodemo                       I  getOplusAutoResolutionFeature
2024-01-04 18:43:35.048  1682-1780  OplusThermalStats       system_server                        E  Error getting package info: com.pc.cgodemo
2024-01-04 18:43:35.070 13855-13855 OplusFeatureCache       com.pc.cgodemo                       I  Milliseconds spent on init(): 23
2024-01-04 18:43:35.072 13855-13855 CompactWindowAppManager com.pc.cgodemo                       D  initCompactApplicationInfo 
2024-01-04 18:43:35.084 13855-13855 libc                    com.pc.cgodemo                       W  Access denied finding property "ro.odm.prev.product.name"
2024-01-04 18:43:35.085 13855-13855 ActivityThread          com.pc.cgodemo                       W  Application com.pc.cgodemo is waiting for the debugger on port 8100...
2024-01-04 18:43:35.086 13855-13855 System.out              com.pc.cgodemo                       I  Sending WAIT chunk
2024-01-04 18:43:37.397 18073-18073 adbd                    adbd                                 E  failed to connect to socket 'localabstract:/com.pc.cgodemo-0/platform-1704390216400.sock': could not connect to localabstract address 'localabstract:/com.pc.cgodemo-0/platform-1704390216400.sock'
2024-01-04 18:43:37.424  1329-1329  OPLUS_KEVENT_RECORD     oplus_kevent                         E  OPLUS_KEVENT payload:10401,path@@/data/data/com.pc.cgodemo/lldb/bin/start_lldb_server.sh
2024-01-04 18:43:37.478  1329-1329  OPLUS_KEVENT_RECORD     oplus_kevent                         E  OPLUS_KEVENT payload:10401,path@@/data/data/com.pc.cgodemo/lldb/bin/lldb-server
2024-01-04 18:43:37.938  1329-1329  OPLUS_KEVENT_RECORD     oplus_kevent                         E  OPLUS_KEVENT payload:10401,path@@/data/data/com.pc.cgodemo/lldb/bin/lldb-server
2024-01-04 18:43:46.839 13855-13855 System.out              com.pc.cgodemo                       I  Debugger has connected
2024-01-04 18:43:46.839 13855-13855 System.out              com.pc.cgodemo                       I  waiting for debugger to settle...
2024-01-04 18:43:47.040 13855-13855 System.out              com.pc.cgodemo                       I  waiting for debugger to settle...
2024-01-04 18:43:47.255 13855-13855 System.out              com.pc.cgodemo                       I  waiting for debugger to settle...
2024-01-04 18:43:47.458 13855-13855 System.out              com.pc.cgodemo                       I  waiting for debugger to settle...
2024-01-04 18:43:47.660 13855-13855 System.out              com.pc.cgodemo                       I  waiting for debugger to settle...
2024-01-04 18:43:47.861 13855-13855 System.out              com.pc.cgodemo                       I  waiting for debugger to settle...
2024-01-04 18:43:48.063 13855-13855 System.out              com.pc.cgodemo                       I  waiting for debugger to settle...
2024-01-04 18:43:48.266 13855-13855 System.out              com.pc.cgodemo                       I  waiting for debugger to settle...
2024-01-04 18:43:48.468 13855-13855 System.out              com.pc.cgodemo                       I  waiting for debugger to settle...
2024-01-04 18:43:48.671 13855-13855 System.out              com.pc.cgodemo                       I  debugger has settled (1409)
2024-01-04 18:43:48.691 13855-13855 LoadedApk               com.pc.cgodemo                       D  mApplicationInfo overrideDisplayId:null
2024-01-04 18:43:48.704 13855-13855 ApplicationLoaders      com.pc.cgodemo                       D  Returning zygote-cached class loader: /system/framework/android.test.base.jar
2024-01-04 18:43:48.711 13855-13855 ziparchive              com.pc.cgodemo                       W  Unable to open '/data/app/~~I7dJyozGS1orTsZNGQnjfQ==/com.pc.cgodemo-OnrMEniCqUxuLpziPtkcow==/base.dm': No such file or directory
2024-01-04 18:43:48.711 13855-13855 ziparchive              com.pc.cgodemo                       W  Unable to open '/data/app/~~I7dJyozGS1orTsZNGQnjfQ==/com.pc.cgodemo-OnrMEniCqUxuLpziPtkcow==/base.dm': No such file or directory
2024-01-04 18:43:48.793 13855-13855 nativeloader            com.pc.cgodemo                       D  Configuring clns-4 for other apk /data/app/~~I7dJyozGS1orTsZNGQnjfQ==/com.pc.cgodemo-OnrMEniCqUxuLpziPtkcow==/base.apk. target_sdk_version=29, uses_libraries=, library_path=/data/app/~~I7dJyozGS1orTsZNGQnjfQ==/com.pc.cgodemo-OnrMEniCqUxuLpziPtkcow==/lib/arm64:/data/app/~~I7dJyozGS1orTsZNGQnjfQ==/com.pc.cgodemo-OnrMEniCqUxuLpziPtkcow==/base.apk!/lib/arm64-v8a, permitted_path=/data:/mnt/expand:/data/user/0/com.pc.cgodemo
2024-01-04 18:43:48.794 13855-13855 nativeloader            com.pc.cgodemo                       D  Extending system_exposed_libraries: libapuwareapusys.mtk.so:libapuwareapusys_v2.mtk.so:libapuwarexrp.mtk.so:libapuwarexrp_v2.mtk.so:libapuwareutils.mtk.so:libapuwareutils_v2.mtk.so:libapuwarehmp.mtk.so:libmcv_runtime_usdk.mtk.so:libneuron_graph_delegate.mtk.so:libneuronusdk_adapter.mtk.so:libtflite_mtk.mtk.so:libarmnn_ndk.mtk.so:libcmdl_ndk.mtk.so:libnir_neon_driver_ndk.mtk.so:libmvpu_runtime.mtk.so:libmvpu_runtime_pub.mtk.so:libmvpu_engine_pub.mtk.so:libmvpu_pattern_pub.mtk.so:libmvpuop_mtk_cv.mtk.so:libmvpuop_mtk_nn.mtk.so:libteeservice_client.trustonic.so:libSloganJni.oplus.so:libsuperNight.oplus.so
2024-01-04 18:43:49.002 13855-13855 GraphicsEnvironment     com.pc.cgodemo                       V  ANGLE Developer option for 'com.pc.cgodemo' set to: 'default'
2024-01-04 18:43:49.003 13855-13855 GraphicsEnvironment     com.pc.cgodemo                       V  ANGLE GameManagerService for com.pc.cgodemo: false
2024-01-04 18:43:49.004 13855-13855 GraphicsEnvironment     com.pc.cgodemo                       V  App is not on the allowlist for updatable production driver.
2024-01-04 18:43:49.018 13855-13855 NetworkSecurityConfig   com.pc.cgodemo                       D  No Network Security Config specified, using platform default
2024-01-04 18:43:49.020 13855-13855 NetworkSecurityConfig   com.pc.cgodemo                       D  No Network Security Config specified, using platform default
2024-01-04 18:43:49.022 13855-13855 Compatibil...geReporter com.pc.cgodemo                       D  Compat change id reported: 183155436; UID 10401; state: DISABLED
2024-01-04 18:43:49.034 13855-13855 OplusActivityManager    com.pc.cgodemo                       D  get AMS extension: android.os.BinderProxy@c349e7
2024-01-04 18:43:49.035 13855-13855 ANR_LOG                 com.pc.cgodemo                       E  >>> msg's executing time is too long
2024-01-04 18:43:49.035 13855-13855 ANR_LOG                 com.pc.cgodemo                       E  Blocked msg = { when=-13s999ms what=110 target=android.app.ActivityThread$H obj=AppBindData{appInfo=ApplicationInfo{3550994 com.pc.cgodemo}} } , cost  = 13988 ms
2024-01-04 18:43:49.035 13855-13855 ANR_LOG                 com.pc.cgodemo                       E  >>>Current msg List is:
2024-01-04 18:43:49.036 13855-13855 ANR_LOG                 com.pc.cgodemo                       E  Current msg <1> = { when=-13s974ms what=159 target=android.app.ActivityThread$H obj=android.app.servertransaction.ClientTransaction@317645b }
2024-01-04 18:43:49.036 13855-13855 ANR_LOG                 com.pc.cgodemo                       E  Current msg <2> = { when=-13s974ms what=159 target=android.app.ActivityThread$H obj=android.app.servertransaction.ClientTransaction@4dd3e8df }
2024-01-04 18:43:49.037 13855-13855 ANR_LOG                 com.pc.cgodemo                       E  Current msg <3> = { when=-13s939ms what=149 target=android.app.ActivityThread$H obj=android.os.BinderProxy@432b00 }
2024-01-04 18:43:49.037 13855-13855 ANR_LOG                 com.pc.cgodemo                       E  Current msg <4> = { when=-5ms what=164 target=android.app.ActivityThread$H obj=com.pc.cgodemo }
2024-01-04 18:43:49.037 13855-13855 ANR_LOG                 com.pc.cgodemo                       E  >>>CURRENT MSG DUMP OVER<<<
2024-01-04 18:43:49.040 13855-13855 Quality                 com.pc.cgodemo                       I  ActivityThread: bindApplication delay 13993 com.pc.cgodemo 13855
2024-01-04 18:43:49.042 13855-18502 Quality                 com.pc.cgodemo                       I  Blocked msg = Package name: com.pc.cgodemo [ schedGroup: 5 schedPolicy: 0 ] process the message: { when=-14s4ms what=110 target=android.app.ActivityThread$H obj=AppBindData{appInfo=ApplicationInfo{3550994 com.pc.cgodemo}} } took 13993 ms
2024-01-04 18:43:49.055 13855-18504 OplusGraphicsEvent      com.pc.cgodemo                       D  OplusGraphicsEventListener create now!
2024-01-04 18:43:49.056 13855-18504 OplusGraphicsEvent      com.pc.cgodemo                       D  addEventListener success!
2024-01-04 18:43:49.177 13855-18506 com.pc.cgodemo          com.pc.cgodemo                       E  Loaded layer handle (13843273398587540071) for layer /my_product/lib64/libcolorx-loader.so
2024-01-04 18:43:49.177 13855-18506 com.pc.cgodemo          com.pc.cgodemo                       E  Looking for entrypoint ColorX_Check
2024-01-04 18:43:49.177 13855-18506 com.pc.cgodemo          com.pc.cgodemo                       E  Found ColorX_Check for /my_product/lib64/libcolorx-loader.so
2024-01-04 18:43:49.177 13855-18506 com.pc.cgodemo          com.pc.cgodemo                       E  Check failed
2024-01-04 18:43:49.221 13855-18506 libMEOW                 com.pc.cgodemo                       D  meow new tls: 0x7ca0a87740
2024-01-04 18:43:49.221 13855-18506 libMEOW                 com.pc.cgodemo                       D  meow reload base cfg path: na
2024-01-04 18:43:49.221 13855-18506 libMEOW                 com.pc.cgodemo                       D  meow reload overlay cfg path: na
2024-01-04 18:43:49.221 13855-18506 QT                      com.pc.cgodemo                       W  qt_process_init() called
2024-01-04 18:43:49.221 13855-18506 QT                      com.pc.cgodemo                       E  [QT]file does not exist
2024-01-04 18:43:49.221 13855-18506 QT                      com.pc.cgodemo                       W  Support!!
2024-01-04 18:43:49.222 13855-18506 QT                      com.pc.cgodemo                       E  [QT]file does not exist
2024-01-04 18:43:49.222 13855-18506 libMEOW                 com.pc.cgodemo                       D  applied 1 plugins for [com.pc.cgodemo]:
2024-01-04 18:43:49.222 13855-18506 libMEOW                 com.pc.cgodemo                       D    plugin 1: [libMEOW_gift.so]: 0xb400007c90949740
2024-01-04 18:43:49.222 13855-18506 libMEOW                 com.pc.cgodemo                       D  rebuild call chain: 0x7ca0a960c0
2024-01-04 18:43:49.222 13855-18506 libMEOW                 com.pc.cgodemo                       D  meow delete tls: 0x7ca0a87740
2024-01-04 18:43:49.253 13855-13855 oplus.andr...actoryImpl com.pc.cgodemo                       I  Unknow feature:IOplusTextViewRTLUtilForUG
2024-01-04 18:43:49.261 13855-13855 OplusCusto...ionManager com.pc.cgodemo                       E  sInstance is null, start a new sInstance
2024-01-04 18:43:49.266 13855-13855 Compatibil...geReporter com.pc.cgodemo                       D  Compat change id reported: 210923482; UID 10401; state: DISABLED
2024-01-04 18:43:49.266 13855-13855 Compatibil...geReporter com.pc.cgodemo                       D  Compat change id reported: 37756858; UID 10401; state: ENABLED
2024-01-04 18:43:49.304 13855-13855 ScrollOpti...tionHelper com.pc.cgodemo                       D  can't find the config file for optimizaiton
2024-01-04 18:43:49.304 13855-13855 ScrollOpti...tionHelper com.pc.cgodemo                       D  will not debug for debug is false
2024-01-04 18:43:49.304 13855-13855 oplus.andr...actoryImpl com.pc.cgodemo                       I  get feature:IOplusDynamicVsyncFeature
2024-01-04 18:43:49.304 13855-13855 oplus.andr...actoryImpl com.pc.cgodemo                       I  get feature:IOplusDynamicVsyncFeature
2024-01-04 18:43:49.780 13855-18507 PowerHalWrapper         com.pc.cgodemo                       I  PowerHalWrapper.getInstance 
2024-01-04 18:43:49.781 13855-13855 PowerHalWrapper         com.pc.cgodemo                       I  PowerHalWrapper.getInstance 
2024-01-04 18:43:49.785 13855-13855 MSYNC3-Var...efreshRate com.pc.cgodemo                       I  Variable refreshrate is disabled
2024-01-04 18:43:49.786 13855-13855 oplus.andr...actoryImpl com.pc.cgodemo                       I  get feature:IOplusDynamicVsyncFeature
2024-01-04 18:43:49.887 13855-13855 com.pc.cgodemo          com.pc.cgodemo                       W  Accessing hidden method Landroid/view/View;->computeFitSystemWindows(Landroid/graphics/Rect;Landroid/graphics/Rect;)Z (unsupported, reflection, allowed)
2024-01-04 18:43:49.887 13855-13855 com.pc.cgodemo          com.pc.cgodemo                       W  Accessing hidden method Landroid/view/ViewGroup;->makeOptionalFitsSystemWindows()V (unsupported, reflection, allowed)
2024-01-04 18:43:49.971 13855-13855 Quality                 com.pc.cgodemo                       I  ActivityThread: activityStart delay 927 com.pc.cgodemo 13855
2024-01-04 18:43:50.055 13855-13855 ExtensionsLoader        com.pc.cgodemo                       D  createInstance(64bit) : createExtendedFactory
2024-01-04 18:43:50.130 13855-13855 ExtensionsLoader        com.pc.cgodemo                       D  Opened libSchedAssistExtImpl.so
2024-01-04 18:43:50.130 13855-13855 com.pc.cgodemo          com.pc.cgodemo                       E  ofbOpen failed with error=No such file or directory
2024-01-04 18:43:50.130 13855-13855 com.pc.cgodemo          com.pc.cgodemo                       E  sysOpen failed with error=No such file or directory
2024-01-04 18:43:50.132 13855-13855 OplusInputMethodUtil    com.pc.cgodemo                       D  init sDebug to false, init sDebugIme to false, init sAlwaysOn to false
2024-01-04 18:43:50.132 13855-13855 OplusInputMethodUtil    com.pc.cgodemo                       D  updateDebugToClass InputMethodManager.DEBUG = false
2024-01-04 18:43:50.133 13855-13855 OplusInputMethodUtil    com.pc.cgodemo                       D  updateDebugToClass ImeFocusController.DEBUG = false
2024-01-04 18:43:50.133 13855-13855 OplusInputMethodUtil    com.pc.cgodemo                       D  updateDebugToClass BaseInputConnection.DEBUG = false
2024-01-04 18:43:50.133 13855-13855 OplusInputMethodUtil    com.pc.cgodemo                       D  updateDebugToClass ImeFocusController.sDebugIme = false
2024-01-04 18:43:50.136 13855-13855 SurfaceFactory          com.pc.cgodemo                       I  [static] sSurfaceFactory = com.mediatek.view.impl.SurfaceFactoryImpl@286364a
2024-01-04 18:43:50.141 13855-18512 OplusSlideAnimOptHelper com.pc.cgodemo                       I  checkListMode: is blacklist mode = true
2024-01-04 18:43:50.142 13855-18512 OplusSlideAnimOptHelper com.pc.cgodemo                       D  com.pc.cgodemo scrollEffectOpt enable = true
2024-01-04 18:43:50.143 13855-13855 WindowManager           com.pc.cgodemo                       D  Add to mViews: DecorView@864ded8[MainActivity],pkg= com.pc.cgodemo
2024-01-04 18:43:50.145 13855-18504 ExtensionsLoader        com.pc.cgodemo                       D  createInstance(64bit) : createExtendedFactory
2024-01-04 18:43:50.336 13855-18504 ExtensionsLoader        com.pc.cgodemo                       D  Opened libhwuiextimpl.so
2024-01-04 18:43:50.336 13855-13855 ExtensionsLoader        com.pc.cgodemo                       D  createInstance(64bit) : createExtendedFactory
2024-01-04 18:43:50.336 13855-13855 ExtensionsLoader        com.pc.cgodemo                       D  Opened libSchedAssistExtImpl.so
2024-01-04 18:43:50.350 13855-13855 libMEOW                 com.pc.cgodemo                       D  meow new tls: 0x7c9e1a1b00
2024-01-04 18:43:50.350 13855-13855 libMEOW                 com.pc.cgodemo                       D  applied 1 plugins for [com.pc.cgodemo]:
2024-01-04 18:43:50.350 13855-13855 libMEOW                 com.pc.cgodemo                       D    plugin 1: [libMEOW_gift.so]: 0xb400007c90949740
2024-01-04 18:43:50.350 13855-13855 libMEOW                 com.pc.cgodemo                       D  rebuild call chain: 0x7c9e1d4440
2024-01-04 18:43:50.351 13855-13855 InputEventReceiver      com.pc.cgodemo                       D  Input log is disabled
2024-01-04 18:43:50.351 13855-13855 Quality                 com.pc.cgodemo                       I  ActivityThread: activityResume delay 379 com.pc.cgodemo 13855
2024-01-04 18:43:50.351 13855-13855 Quality                 com.pc.cgodemo                       I  ActivityThread: activityLifecycle delay 1310 com.pc.cgodemo 13855
2024-01-04 18:43:50.352 13855-18502 Quality                 com.pc.cgodemo                       I  Blocked msg = Package name: com.pc.cgodemo [ schedGroup: 5 schedPolicy: 0 ] process the message: { when=-15s291ms what=159 target=android.app.ActivityThread$H obj=android.app.servertransaction.ClientTransaction@317645b } took 1310 ms
2024-01-04 18:43:50.390 13855-13855 BufferQueueConsumer     com.pc.cgodemo                       D  [](id:361f00000000,api:0,p:-1,c:13855) connect: controlledByApp=false
2024-01-04 18:43:50.478 13855-13855 ExtensionsLoader        com.pc.cgodemo                       D  createInstance(64bit) : createExtendedFactory
2024-01-04 18:43:50.478 13855-13855 ExtensionsLoader        com.pc.cgodemo                       D  Opened libSchedAssistExtImpl.so
2024-01-04 18:43:50.589 13855-13855 FBI                     com.pc.cgodemo                       E  Can't load library: dlopen failed: library "libmagtsync.so" not found
2024-01-04 18:43:50.594 13855-13855 ZoomWindowDecorView     com.pc.cgodemo                       V  setLastReportedMergedConfiguration mZoomDisplayHeight: 2400 getDecorView.140828376
2024-01-04 18:43:50.594 13855-18504 libMEOW                 com.pc.cgodemo                       D  meow new tls: 0x7ca04e5fc0
2024-01-04 18:43:50.594 13855-18504 libMEOW                 com.pc.cgodemo                       D  applied 1 plugins for [com.pc.cgodemo]:
2024-01-04 18:43:50.594 13855-18504 libMEOW                 com.pc.cgodemo                       D    plugin 1: [libMEOW_gift.so]: 0xb400007c90949740
2024-01-04 18:43:50.595 13855-18504 libMEOW                 com.pc.cgodemo                       D  rebuild call chain: 0x7ca0476bc0
2024-01-04 18:43:50.600 13855-13855 VRI[MainActivity]       com.pc.cgodemo                       D  registerCallbacksForSync syncBuffer=false
2024-01-04 18:43:50.664 13855-18504 hw-ProcessState         com.pc.cgodemo                       D  Binder ioctl to enable oneway spam detection failed: Invalid argument
2024-01-04 18:43:50.703 13855-18504 BLASTBufferQueue        com.pc.cgodemo                       D  [VRI[MainActivity]#0](f:0,a:1) acquireNextBufferLocked size=1080x2400 mFrameNumber=1 applyTransaction=true mTimestamp=14996666777199(auto) mPendingTransactions.size=0 graphicBufferId=59506771886083 transform=0
2024-01-04 18:43:50.704 13855-18504 VRI[MainActivity]       com.pc.cgodemo                       D  Received frameCommittedCallback lastAttemptedDrawFrameNum=1 didProduceBuffer=true syncBuffer=false
2024-01-04 18:43:50.706 13855-18504 Parcel                  com.pc.cgodemo                       W  Expecting binder but got null!
2024-01-04 18:43:50.707 13855-13855 VRI[MainActivity]       com.pc.cgodemo                       D  draw finished.
2024-01-04 18:43:50.725 13855-13855 Choreographer           com.pc.cgodemo                       I  Skipped 31 frames!  The application may be doing too much work on its main thread.
2024-01-04 18:43:50.732 13855-13855 VRI[MainActivity]       com.pc.cgodemo                       D  registerCallbacksForSync syncBuffer=false
2024-01-04 18:43:50.737 13855-18504 VRI[MainActivity]       com.pc.cgodemo                       D  Received frameCommittedCallback lastAttemptedDrawFrameNum=3 didProduceBuffer=true syncBuffer=false
2024-01-04 18:43:50.737 13855-13855 VRI[MainActivity]       com.pc.cgodemo                       D  draw finished.
2024-01-04 18:43:55.450  3979-4724  Battery                 com.oplus.battery                    E  AppStats: com.pc.cgodemofirst la
2024-01-04 18:43:55.450  3979-4724  Battery                 com.oplus.battery                    E  AppStats: Uid = 10401; pkgName = com.pc.cgodemo; CpuFgTime = 0 ms; CpuBgTime = 0 ms.
2024-01-04 18:43:55.450  3979-4724  Battery                 com.oplus.battery                    E  AppStats: Uid = 10401; pkgName = com.pc.cgodemo; CpuKernelFgTime = 0 ms; CpuKernelBgTime = 0 ms.
2024-01-04 18:43:55.450  3979-4724  Battery                 com.oplus.battery                    E  AppStats: Uid = 10401; pkgName = com.pc.cgodemo; CpuUserFgTime = 0 ms ; CpuUserBgTime = 0 ms.
2024-01-04 18:43:55.450  3979-4724  Battery                 com.oplus.battery                    E  AppStats: Uid = 10401; pkgName = com.pc.cgodemo; CpuFgPower = 0.0 mAh.; CpuBgPower = 0.0 mAh.
2024-01-04 18:43:55.450  3979-4724  Battery                 com.oplus.battery                    E  AppStats: Uid = 10401; pkgName = com.pc.cgodemo; AlarmFgWakeupCount = 0; AlarmBgWakeupCount = 0
2024-01-04 18:43:55.450  3979-4724  Battery                 com.oplus.battery                    E  AppStats: Uid = 10401; pkgName = com.pc.cgodemo; JobFgCount = 0; JobBgCount = 0; JobFgTime = 0; JobBgTime = 0
2024-01-04 18:43:55.450  3979-4724  Battery                 com.oplus.battery                    E  AppStats: Uid = 10401; pkgName = com.pc.cgodemo; SyncFgCount = 0; SyncBgCount = 0; SyncFgTime = 0; SyncBgTime = 0
2024-01-04 18:43:55.451  3979-4724  Battery                 com.oplus.battery                    E  AppStats: Uid = 10401; pkgName = com.pc.cgodemo; WakeLockFgTime = 0 ms; WakeLockFgPower = 0.0 mAh.; WakeLockBgTime = 0 ms; WakeLockBgPower = 0.0 mAh.
2024-01-04 18:43:55.451  3979-4724  Battery                 com.oplus.battery                    E  AppStats: Uid = 10401; pkgName = com.pc.cgodemo; ScreenFgTime = 0 ms; ScreenFgPower = 0.0 mAh.
2024-01-04 18:43:55.451  3979-4724  Battery                 com.oplus.battery                    E  AppStats: Uid = 10401; pkgName = com.pc.cgodemo; FgWifiRxBytes = 0 Bytes; BgWifiRxBytes = 0 Bytes; FgWifiTxBytes = 0 Bytes; BgWifiTxBytes = 0 Bytes; FgWifiRxPackets = 0 ; BgWifiRxPackets = 0 ; FgWifiTxPackets = 0 ; BgWifiTxPackets = 0 ; FgWiFiScanTimeMs = 0 ; BgWiFiScanTimeMs = 0 ; FgWiFiBatchScanTimeMs = 0 ; BgWiFiBatchScanTimeMs = 0 
2024-01-04 18:43:55.451  3979-4724  Battery                 com.oplus.battery                    E  AppStats: Uid = 10401; pkgName = com.pc.cgodemo; FgWifiRxPacketsPower = 0.0 mAh; BgWifiRxPacketsPower = 0.0 mAh; FgWifiTxPacketsPower = 0.0 mAh; BgWifiTxPacketsPower = 0.0 mAh; FgWifiScanPower = 0.0 mAh; BgWifiScanPower = 0.0 mAh; FgWifiBatchScanPower = 0.0 mAh; BgWifiBatchScanPower = 0.0 mAh; FgWiFiTotalPower = 0.0 mAh; BgWiFiTotalPower = 0.0 mAh.
2024-01-04 18:43:55.451  3979-4724  Battery                 com.oplus.battery                    E  AppStats: Uid = 10401; pkgName = com.pc.cgodemo; FgGpsTime = 0 ms; BgGpsTime = 0 ms.
2024-01-04 18:43:55.451  3979-4724  Battery                 com.oplus.battery                    E  AppStats: Uid = 10401; pkgName = com.pc.cgodemo; FgGpsPower = 0.0 mAh; BgGpsPower = 0.0 mAh.
2024-01-04 18:43:55.451  3979-4724  Battery                 com.oplus.battery                    E  AppStats: Uid = 10401; pkgName = com.pc.cgodemo; FgSensorTime = 0 ms; BgSensorTime = 0 ms.
2024-01-04 18:43:55.451  3979-4724  Battery                 com.oplus.battery                    E  AppStats: Uid = 10401; pkgName = com.pc.cgodemo; FgSensorPower = 0.0 mAh; BgSensorPower = 0.0 mAh.
2024-01-04 18:43:55.451  3979-4724  Battery                 com.oplus.battery                    E  AppStats: Uid = 10401; pkgName = com.pc.cgodemo; FgCameraTime = 0 ms; BgCameraTime = 0 ms
2024-01-04 18:43:55.451  3979-4724  Battery                 com.oplus.battery                    E  AppStats: Uid = 10401; pkgName = com.pc.cgodemo; FgCameraPower = 0.0 mAh; BgCameraPower = 0.0 mAh
2024-01-04 18:43:55.451  3979-4724  Battery                 com.oplus.battery                    E  AppStats: Uid = 10401; pkgName = com.pc.cgodemo; FgFlashLightTime = 0 ms; BgFlashLightTime = 0 ms
2024-01-04 18:43:55.451  3979-4724  Battery                 com.oplus.battery                    E  AppStats: Uid = 10401; pkgName = com.pc.cgodemo; FgFlashLightPower = 0.0 mAh; BgFlashLightPower = 0.0 mAh
2024-01-04 18:43:55.456  3979-4724  Battery                 com.oplus.battery                    E  AppStats: Uid = 10401; pkgName = com.pc.cgodemo; CpuFgTime = 0 ms; CpuBgTime = 0 ms.
2024-01-04 18:43:55.456  3979-4724  Battery                 com.oplus.battery                    E  AppStats: Uid = 10401; pkgName = com.pc.cgodemo; CpuKernelFgTime = 0 ms; CpuKernelBgTime = 0 ms.
2024-01-04 18:43:55.456  3979-4724  Battery                 com.oplus.battery                    E  AppStats: Uid = 10401; pkgName = com.pc.cgodemo; CpuUserFgTime = 0 ms ; CpuUserBgTime = 0 ms.
2024-01-04 18:43:55.456  3979-4724  Battery                 com.oplus.battery                    E  AppStats: Uid = 10401; pkgName = com.pc.cgodemo; CpuFgPower = 0.0 mAh.; CpuBgPower = 0.0 mAh.
2024-01-04 18:43:55.456  3979-4724  Battery                 com.oplus.battery                    E  AppStats: Uid = 10401; pkgName = com.pc.cgodemo; AlarmFgWakeupCount = 0; AlarmBgWakeupCount = 0
2024-01-04 18:43:55.456  3979-4724  Battery                 com.oplus.battery                    E  AppStats: Uid = 10401; pkgName = com.pc.cgodemo; JobFgCount = 0; JobBgCount = 0; JobFgTime = 0; JobBgTime = 0
2024-01-04 18:43:55.456  3979-4724  Battery                 com.oplus.battery                    E  AppStats: Uid = 10401; pkgName = com.pc.cgodemo; SyncFgCount = 0; SyncBgCount = 0; SyncFgTime = 0; SyncBgTime = 0
2024-01-04 18:43:55.456  3979-4724  Battery                 com.oplus.battery                    E  AppStats: Uid = 10401; pkgName = com.pc.cgodemo; WakeLockFgTime = 0 ms; WakeLockFgPower = 0.0 mAh.; WakeLockBgTime = 0 ms; WakeLockBgPower = 0.0 mAh.
2024-01-04 18:43:55.456  3979-4724  Battery                 com.oplus.battery                    E  AppStats: Uid = 10401; pkgName = com.pc.cgodemo; ScreenFgTime = 6 ms; ScreenFgPower = 1.0E-4 mAh.
2024-01-04 18:43:55.456  3979-4724  Battery                 com.oplus.battery                    E  AppStats: Uid = 10401; pkgName = com.pc.cgodemo; FgWifiRxBytes = 0 Bytes; BgWifiRxBytes = 0 Bytes; FgWifiTxBytes = 0 Bytes; BgWifiTxBytes = 0 Bytes; FgWifiRxPackets = 0 ; BgWifiRxPackets = 0 ; FgWifiTxPackets = 0 ; BgWifiTxPackets = 0 ; FgWiFiScanTimeMs = 0 ; BgWiFiScanTimeMs = 0 ; FgWiFiBatchScanTimeMs = 0 ; BgWiFiBatchScanTimeMs = 0 
2024-01-04 18:43:55.456  3979-4724  Battery                 com.oplus.battery                    E  AppStats: Uid = 10401; pkgName = com.pc.cgodemo; FgWifiRxPacketsPower = 0.0 mAh; BgWifiRxPacketsPower = 0.0 mAh; FgWifiTxPacketsPower = 0.0 mAh; BgWifiTxPacketsPower = 0.0 mAh; FgWifiScanPower = 0.0 mAh; BgWifiScanPower = 0.0 mAh; FgWifiBatchScanPower = 0.0 mAh; BgWifiBatchScanPower = 0.0 mAh; FgWiFiTotalPower = 0.0 mAh; BgWiFiTotalPower = 0.0 mAh.
2024-01-04 18:43:55.456  3979-4724  Battery                 com.oplus.battery                    E  AppStats: Uid = 10401; pkgName = com.pc.cgodemo; FgGpsTime = 0 ms; BgGpsTime = 0 ms.
2024-01-04 18:43:55.456  3979-4724  Battery                 com.oplus.battery                    E  AppStats: Uid = 10401; pkgName = com.pc.cgodemo; FgGpsPower = 0.0 mAh; BgGpsPower = 0.0 mAh.
2024-01-04 18:43:55.456  3979-4724  Battery                 com.oplus.battery                    E  AppStats: Uid = 10401; pkgName = com.pc.cgodemo; FgSensorTime = 0 ms; BgSensorTime = 0 ms.
2024-01-04 18:43:55.456  3979-4724  Battery                 com.oplus.battery                    E  AppStats: Uid = 10401; pkgName = com.pc.cgodemo; FgSensorPower = 0.0 mAh; BgSensorPower = 0.0 mAh.
2024-01-04 18:43:55.456  3979-4724  Battery                 com.oplus.battery                    E  AppStats: Uid = 10401; pkgName = com.pc.cgodemo; FgCameraTime = 0 ms; BgCameraTime = 0 ms
2024-01-04 18:43:55.456  3979-4724  Battery                 com.oplus.battery                    E  AppStats: Uid = 10401; pkgName = com.pc.cgodemo; FgCameraPower = 0.0 mAh; BgCameraPower = 0.0 mAh
2024-01-04 18:43:55.456  3979-4724  Battery                 com.oplus.battery                    E  AppStats: Uid = 10401; pkgName = com.pc.cgodemo; FgFlashLightTime = 0 ms; BgFlashLightTime = 0 ms
2024-01-04 18:43:55.456  3979-4724  Battery                 com.oplus.battery                    E  AppStats: Uid = 10401; pkgName = com.pc.cgodemo; FgFlashLightPower = 0.0 mAh; BgFlashLightPower = 0.0 mAh
2024-01-04 18:43:57.066  1682-1780  OplusThermalStats       system_server                        E  Error getting package info: com.pc.cgodemo
2024-01-04 18:43:57.087 13855-13855 Compatibil...geReporter com.pc.cgodemo                       D  Compat change id reported: 78294732; UID 10401; state: DISABLED
2024-01-04 18:43:57.095 13855-13855 VRI[MainActivity]       com.pc.cgodemo                       D  onFocusEvent true
2024-01-04 18:43:57.202 13855-13855 OplusInput...erInternal com.pc.cgodemo                       D  get inputMethodManager extension: com.android.internal.view.IInputMethodManager$Stub$Proxy@a626123
2024-01-04 18:43:59.391 13855-13855 FinalizerDaemon         com.pc.cgodemo                       W  type=1400 audit(0.0:2254): avc: denied { getopt } for path="/dev/socket/usap_pool_primary" scontext=u:r:untrusted_app_29:s0:c145,c257,c512,c768 tcontext=u:r:zygote:s0 tclass=unix_stream_socket permissive=0 app=com.pc.cgodemo
2024-01-04 18:44:02.110 13855-13855 Quality                 com.pc.cgodemo                       I  Skipped: true 8 cost 94.60232 refreshRate 11111111 bit true processName com.pc.cgodemo
2024-01-04 18:44:23.301 13855-13855 JNITAG                  com.pc.cgodemo                       E  Java_com_pc_cgodemo_JniLibrary_GoSendText
2024-01-04 18:44:23.318 13855-18368 OpenGLRenderer          com.pc.cgodemo                       I  Davey! duration=5828ms; Flags=2, FrameTimelineVsyncId=2103197, IntendedVsync=15023443714819, Vsync=15023443714819, InputEventId=0, HandleInputStart=15023443714819, AnimationStart=15023443714819, PerformTraversalsStart=15023443714819, DrawStart=15023443714819, FrameDeadline=15022902182019, FrameInterval=0, FrameStartTime=11214656, SyncQueued=15023446223432, SyncStart=15023446224893, IssueDrawCommandsStart=15023446398509, SwapBuffers=15023448572586, FrameCompleted=15029272435125, DequeueBufferDuration=41307, QueueBufferDuration=1292538, GpuCompleted=15029268859971, SwapBuffersCompleted=15029272435125, DisplayPresentTime=0, CommandSubmissionCompleted=15023448572586, 
2024-01-04 18:44:23.352 13855-13855 JNITAG                  com.pc.cgodemo                       E  Java_com_pc_cgodemo_JniLibrary_GoSendText Finished.
2024-01-04 18:44:23.354 13855-13855 ANR_LOG                 com.pc.cgodemo                       E  >>> msg's executing time is too long
2024-01-04 18:44:23.354 13855-13855 ANR_LOG                 com.pc.cgodemo                       E  Blocked msg = { when=-6s535ms what=0 target=android.view.ViewRootImpl$ViewRootHandler callback=android.view.View$PerformClick } , cost  = 6528 ms
2024-01-04 18:44:23.354 13855-13855 ANR_LOG                 com.pc.cgodemo                       E  >>>Current msg List is:
2024-01-04 18:44:23.354 13855-13855 ANR_LOG                 com.pc.cgodemo                       E  Current msg <1> = { when=-6s535ms what=0 target=android.view.ViewRootImpl$ViewRootHandler callback=android.view.View$UnsetPressedState }
2024-01-04 18:44:23.355 13855-13855 ANR_LOG                 com.pc.cgodemo                       E  Current msg <2> = { when=-6s529ms what=0 target=android.view.ViewRootImpl$ViewRootHandler callback=android.graphics.HardwareRendererObserver$$ExternalSyntheticLambda0 }
2024-01-04 18:44:23.355 13855-13855 ANR_LOG                 com.pc.cgodemo                       E  Current msg <3> = { when=-6s518ms what=0 target=android.view.ViewRootImpl$ViewRootHandler callback=android.graphics.HardwareRendererObserver$$ExternalSyntheticLambda0 }
2024-01-04 18:44:23.355 13855-13855 ANR_LOG                 com.pc.cgodemo                       E  Current msg <4> = { when=-6s346ms what=3 target=android.view.GestureDetector$GestureHandler }
2024-01-04 18:44:23.356 13855-13855 ANR_LOG                 com.pc.cgodemo                       E  Current msg <5> = { when=-5s872ms what=0 target=android.view.ViewRootImpl$ViewRootHandler callback=android.graphics.HardwareRendererObserver$$ExternalSyntheticLambda0 }
2024-01-04 18:44:23.356 13855-13855 ANR_LOG                 com.pc.cgodemo                       E  Current msg <6> = { when=-5s871ms what=0 target=android.os.Handler callback=android.graphics.animation.RenderNodeAnimator$$ExternalSyntheticLambda0 }
2024-01-04 18:44:23.356 13855-13855 ANR_LOG                 com.pc.cgodemo                       E  >>>CURRENT MSG DUMP OVER<<<
2024-01-04 18:44:23.361 13855-18502 Quality                 com.pc.cgodemo                       I  Blocked msg = Package name: com.pc.cgodemo [ schedGroup: 5 schedPolicy: 0 ] process the message: { when=-6s538ms what=0 target=android.view.ViewRootImpl$ViewRootHandler callback=android.view.View$PerformClick } took 6531 ms
2024-01-04 18:44:23.365 13855-18554 Quality                 com.pc.cgodemo                       I  stackInfo :----- pid 13855 at 2024-01-04 18:44:23.305 -----;Cmd line: com.pc.cgodemo;"main" prio=5 tid=2 RUNNABLE sysTid=13855;  at com.pc.cgodemo.JniLibrary.TestCustomLogger(Native Method);  at com.pc.cgodemo.MainActivity$2.onClick(MainActivity.java:49);  at android.view.View.performClick(View.java:7558);  at android.view.View.performClickInternal(View.java:7534);  at android.view.View.-$$Nest$mperformClickInternal(Unknown Source:0);  at android.view.View$PerformClick.run(View.java:29661);  at android.os.Handler.handleCallback(Handler.java:942);  at android.os.Handler.dispatchMessage(Handler.java:99);  at android.os.Looper.loopOnce(Looper.java:240);  at android.os.Looper.loop(Looper.java:351);  at android.app.ActivityThread.main(ActivityThread.java:8377);  at java.lang.reflect.Method.invoke(Native Method);  at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:584);  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1013);
2024-01-04 18:44:23.376 13855-13855 Choreographer           com.pc.cgodemo                       I  Skipped 589 frames!  The application may be doing too much work on its main thread.
2024-01-04 18:44:23.377 13855-13855 Quality                 com.pc.cgodemo                       I  Skipped: false 589 cost 6547.73 refreshRate 11111111 bit true processName com.pc.cgodemo
2024-01-04 18:44:23.399 13855-13855 Quality                 com.pc.cgodemo                       I  Skipped: false 1 cost 14.628424 refreshRate 11111111 bit true processName com.pc.cgodemo
2024-01-04 18:45:41.512 13855-13855 JNITAG                  com.pc.cgodemo                       E  Java_com_pc_cgodemo_JniLibrary_GoSendText
2024-01-04 18:45:41.515 13855-13855 JNITAG                  com.pc.cgodemo                       E  Java_com_pc_cgodemo_JniLibrary_GoSendText Finished.
2024-01-04 18:45:41.520 13855-13855 Quality                 com.pc.cgodemo                       I  Skipped: false 1 cost 12.586275 refreshRate 11111111 bit true processName com.pc.cgodemo
2024-01-04 18:45:45.927 13855-13855 JNITAG                  com.pc.cgodemo                       E  Java_com_pc_cgodemo_JniLibrary_GoSendText
2024-01-04 18:45:45.930 13855-13855 JNITAG                  com.pc.cgodemo                       E  Java_com_pc_cgodemo_JniLibrary_GoSendText Finished.
2024-01-04 18:45:45.936 13855-13855 Quality                 com.pc.cgodemo                       I  Skipped: false 1 cost 11.881882 refreshRate 11111111 bit true processName com.pc.cgodemo
2024-01-04 18:45:56.040  3979-18740 Battery                 com.oplus.battery                    E  AppStats: Uid = 10401; pkgName = com.pc.cgodemo; CpuFgTime = 0 ms; CpuBgTime = 0 ms.
2024-01-04 18:45:56.040  3979-18740 Battery                 com.oplus.battery                    E  AppStats: Uid = 10401; pkgName = com.pc.cgodemo; CpuKernelFgTime = 0 ms; CpuKernelBgTime = 0 ms.
2024-01-04 18:45:56.040  3979-18740 Battery                 com.oplus.battery                    E  AppStats: Uid = 10401; pkgName = com.pc.cgodemo; CpuUserFgTime = 0 ms ; CpuUserBgTime = 0 ms.
2024-01-04 18:45:56.040  3979-18740 Battery                 com.oplus.battery                    E  AppStats: Uid = 10401; pkgName = com.pc.cgodemo; CpuFgPower = 0.0 mAh.; CpuBgPower = 0.0 mAh.
2024-01-04 18:45:56.040  3979-18740 Battery                 com.oplus.battery                    E  AppStats: Uid = 10401; pkgName = com.pc.cgodemo; AlarmFgWakeupCount = 0; AlarmBgWakeupCount = 0
2024-01-04 18:45:56.040  3979-18740 Battery                 com.oplus.battery                    E  AppStats: Uid = 10401; pkgName = com.pc.cgodemo; JobFgCount = 0; JobBgCount = 0; JobFgTime = 0; JobBgTime = 0
2024-01-04 18:45:56.041  3979-18740 Battery                 com.oplus.battery                    E  AppStats: Uid = 10401; pkgName = com.pc.cgodemo; SyncFgCount = 0; SyncBgCount = 0; SyncFgTime = 0; SyncBgTime = 0
2024-01-04 18:45:56.041  3979-18740 Battery                 com.oplus.battery                    E  AppStats: Uid = 10401; pkgName = com.pc.cgodemo; WakeLockFgTime = 0 ms; WakeLockFgPower = 0.0 mAh.; WakeLockBgTime = 0 ms; WakeLockBgPower = 0.0 mAh.
2024-01-04 18:45:56.041  3979-18740 Battery                 com.oplus.battery                    E  AppStats: Uid = 10401; pkgName = com.pc.cgodemo; FgWifiRxBytes = 0 Bytes; BgWifiRxBytes = 0 Bytes; FgWifiTxBytes = 0 Bytes; BgWifiTxBytes = 0 Bytes; FgWifiRxPackets = 0 ; BgWifiRxPackets = 0 ; FgWifiTxPackets = 0 ; BgWifiTxPackets = 0 ; FgWiFiScanTimeMs = 0 ; BgWiFiScanTimeMs = 0 ; FgWiFiBatchScanTimeMs = 0 ; BgWiFiBatchScanTimeMs = 0 
2024-01-04 18:45:56.041  3979-18740 Battery                 com.oplus.battery                    E  AppStats: Uid = 10401; pkgName = com.pc.cgodemo; FgWifiRxPacketsPower = 0.0 mAh; BgWifiRxPacketsPower = 0.0 mAh; FgWifiTxPacketsPower = 0.0 mAh; BgWifiTxPacketsPower = 0.0 mAh; FgWifiScanPower = 0.0 mAh; BgWifiScanPower = 0.0 mAh; FgWifiBatchScanPower = 0.0 mAh; BgWifiBatchScanPower = 0.0 mAh; FgWiFiTotalPower = 0.0 mAh; BgWiFiTotalPower = 0.0 mAh.
2024-01-04 18:45:56.041  3979-18740 Battery                 com.oplus.battery                    E  AppStats: Uid = 10401; pkgName = com.pc.cgodemo; FgGpsTime = 0 ms; BgGpsTime = 0 ms.
2024-01-04 18:45:56.041  3979-18740 Battery                 com.oplus.battery                    E  AppStats: Uid = 10401; pkgName = com.pc.cgodemo; FgGpsPower = 0.0 mAh; BgGpsPower = 0.0 mAh.
2024-01-04 18:45:56.041  3979-18740 Battery                 com.oplus.battery                    E  AppStats: Uid = 10401; pkgName = com.pc.cgodemo; FgSensorTime = 0 ms; BgSensorTime = 0 ms.
2024-01-04 18:45:56.041  3979-18740 Battery                 com.oplus.battery                    E  AppStats: Uid = 10401; pkgName = com.pc.cgodemo; FgSensorPower = 0.0 mAh; BgSensorPower = 0.0 mAh.
2024-01-04 18:45:56.041  3979-18740 Battery                 com.oplus.battery                    E  AppStats: Uid = 10401; pkgName = com.pc.cgodemo; FgCameraTime = 0 ms; BgCameraTime = 0 ms
2024-01-04 18:45:56.041  3979-18740 Battery                 com.oplus.battery                    E  AppStats: Uid = 10401; pkgName = com.pc.cgodemo; FgCameraPower = 0.0 mAh; BgCameraPower = 0.0 mAh
2024-01-04 18:45:56.041  3979-18740 Battery                 com.oplus.battery                    E  AppStats: Uid = 10401; pkgName = com.pc.cgodemo; FgFlashLightTime = 0 ms; BgFlashLightTime = 0 ms
2024-01-04 18:45:56.041  3979-18740 Battery                 com.oplus.battery                    E  AppStats: Uid = 10401; pkgName = com.pc.cgodemo; FgFlashLightPower = 0.0 mAh; BgFlashLightPower = 0.0 mAh
2024-01-04 18:45:56.065  3979-18740 Battery                 com.oplus.battery                    E  HighPowerHelper: ; pkgName = com.pc.cgodemo; mCpuTimeMsPerHourWhileScreenOn = 0 ms; mWakeLockTimeMsPerHourWhileScreenOn = 0 ms; mWakeLockTimeMsPerHourWhileScreenOff = 0 ms; mJobTimeMsPerHourWhileScreenOn = 0 ms; mJobTimeMsPerTwoHoursWhileScreenOn = 0 ms; mWiFiScanTimeMsPerHourWhileScreenOn = 0 ms; mCameraTimeMsPerHourWhileScreenOn = 0 ms; mFlashLightTimeMsPerHourWhileScreenOn = 0 ms; mGpsTimeMsPerHourWhileScreenOn = 0 ms; mAlarmCountPerHourWhileScreenOn = 0 ms

@itpan8067
Copy link

Would be awesome if you could try your module with this code instead:如果您可以尝试使用此代码的模块,那就太棒了:
https://github.com/pion/webrtc/blob/master/examples/custom-logger/main.go
This example did not work here after the mentioned compiler patch.在上述编译器补丁之后,此示例在这里不起作用。
TIA TIA系列

I simply wrote a demo, hope it will be helpful to you. https://github.com/itpan8067/customloggerdemo我只是写了一个演示,希望对你有所帮助。https://github.com/itpan8067/customloggerdemo

What is this app supposed to do?这个应用程序应该做什么?

I was running it on my OnePlus. Nothing happened so far. Just this as trace. Pressed START and SEND, not sure what shall happen. At least I see the same traces I saw w.r.t the avc denied issue我在我的 OnePlus 上运行它。到目前为止什么也没发生。只是作为跟踪。按下“开始”和“发送”,不确定会发生什么。至少我看到了与avc被拒绝问题相同的痕迹

https://github.com/itpan8067/customloggerdemo This project will write logs to the phone's SD card. There is a rtc.log file under the root directory of the SD card。File log = new File(Environment.getExternalStorageDirectory() + File.separator + "rtc.log");

@suutaku
Copy link

suutaku commented Jan 5, 2024

Where do you see the MDNS problem? In the GO module for outgoing MDNS candidates or for incoming candidates? Looks like for incoming, right?

offer side (Android):

W/Thread-7(28264): type=1400 audit(0.0:784367): avc: denied { bind } for scontext=u:r:untrusted_app_27:s0:c104,c257,c512,c768 tcontext=u:r:untrusted_app_27:s0:c104,c257,c512,c768 tclass=netlink_route_socket permissive=0 app=com..
I/GoLog   (28264): interface: dummy0 up|broadcast|running
I/GoLog   (28264): interface: rmnet_ims00 up|running
E/GoLog   (28264): time="2024-01-05T05:42:19Z" level=info msg="ListenUDP udp4 224.0.0.0:5353"
I/GoLog   (28264): doDialTCPProto
E/GoLog   (28264): time="2024-01-05T05:42:19Z" level=info msg="ListenUDP udp 192.168.11.172:0"
E/GoLog   (28264): time="2024-01-05T05:42:19Z" level=info msg="ListenUDP udp [2408:8568:ff10:5d00:17a7:4fe2:d03e:1b8b]:0"
5
E/GoLog   (28264): time="2024-01-05T05:42:19Z" level=info msg="ListenUDP udp4 :0"
E/GoLog   (28264): time="2024-01-05T05:42:19Z" level=info msg="write PR"
8
E/GoLog   (28264): time="2024-01-05T05:42:19Z" level=info msg="write a signal info"
E/GoLog   (28264): time="2024-01-05T05:42:30Z" level=info msg="handle a signal info"

Answer side (Chrome):

2
time="2024-01-05T13:42:30+08:00" level=info msg="handle a signal info"
time="2024-01-05T13:42:30+08:00" level=warning msg="candidate:2391061201 1 udp 2130706431 192.168.11.172 58903 typ host"
time="2024-01-05T13:42:30+08:00" level=info msg="handle a signal info"
time="2024-01-05T13:42:30+08:00" level=info msg="write a signal info"
time="2024-01-05T13:42:30+08:00" level=warning msg="candidate:3123749963 1 udp 2130706431 2408:8568:ff10:5d00:17a7:4fe2:d03e:1b8b 40170 typ host"
time="2024-01-05T13:42:30+08:00" level=info msg="handle a signal info"
time="2024-01-05T13:42:30+08:00" level=warning msg="candidate:2089005254 1 udp 1694498815 171.221.144.24 31629 typ srflx raddr 0.0.0.0 rport 50750"
time="2024-01-05T13:42:30+08:00" level=info msg="handle a signal info"
time="2024-01-05T13:42:30+08:00" level=warning msg="candidate:2089005254 1 udp 1694498815 171.221.144.24 29580 typ srflx raddr 0.0.0.0 rport 60344"
time="2024-01-05T13:42:30+08:00" level=info msg="handle a signal info"
time="2024-01-05T13:42:30+08:00" level=warning msg="candidate:2089005254 1 udp 1694498815 171.221.144.24 28684 typ srflx raddr 0.0.0.0 rport 49371"
time="2024-01-05T13:42:30+08:00" level=info msg="handle a signal info"
time="2024-01-05T13:42:30+08:00" level=warning msg="candidate:2089005254 1 udp 1694498815 171.221.144.24 31884 typ srflx raddr 0.0.0.0 rport 33885"
time="2024-01-05T13:42:30+08:00" level=info msg="handle a signal info"
2
time="2024-01-05T13:42:30+08:00" level=info msg="write a signal info"
time="2024-01-05T13:42:30+08:00" level=warning msg="candidate:2089005254 1 udp 1694498815 171.221.144.24 32269 typ srflx raddr 0.0.0.0 rport 34987"
3
time="2024-01-05T13:42:30+08:00" level=info msg="write a signal info"
time="2024-01-05T13:43:00+08:00" level=info msg="read signaling info error failed to read JSON message: failed to read: use of closed network connection"

connection can not create until timeout.
for offer side, sdp was created and send to answer side. answer side received sdp also send back a sdp which finally handled by offer side.
the difference between tow side it: answer side get many candidates but offer side not.
actually candidate is ok. total 8 (7 candidates + 1 SDP) . but just cannot create connection.

this only happed on my office and the network be like:

graph TD
router --> sub_router_1
router --> sub_router_2
sub_router_1 --> android
sub_router_2 --> chrome
Loading

BTW, change Chrome as offer side, Android as answer side, everything will be OK.

@neilyoung
Copy link
Author

neilyoung commented Jan 5, 2024

E/GoLog (28264): time="2024-01-05T05:42:19Z" level=info msg="ListenUDP udp4 224.0.0.0:5353"

This multicast address is nonsense IMHO...

Both parties exchange host candidates in the local network, that should work from the paper.

E/GoLog (28264): time="2024-01-05T05:42:19Z" level=info msg="ListenUDP udp 192.168.11.172:0"

time="2024-01-05T13:42:30+08:00" level=warning msg="candidate:2391061201 1 udp 2130706431 192.168.11.172 58903 typ host"

Strange too...

E/GoLog (28264): time="2024-01-05T05:42:19Z" level=info msg="ListenUDP udp4 :0"

How does that come?

Do you have a log of the SDP/ICE back and forth?

EDIT: The port of the offering local candidate looks ugly... Never seen 0 here...

@Sean-Der
Copy link
Member

This was fixed by pion/transport@3ba6182

@shynome
Copy link

shynome commented Nov 11, 2024

for the v4 version, first need call anet.SetAndroidVersion and my build command is gomobile bind -ldflags "-checklinkname=0" -androidapi 21 -v -o libvpn.aar -target=android .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working difficulty:easy
Development

No branches or pull requests

5 participants