Code Monkey home page Code Monkey logo

Comments (12)

ray0807 avatar ray0807 commented on August 20, 2024

1
2
3

fork()的pid 不等于0 所以一直都不会走到监听的逻辑中,这个是怎么回事呀?

from appuninstall.

venshine avatar venshine commented on August 20, 2024

确认fork后pid不等于0?提供一下系统版本和手机型号。
http://linux.die.net/man/2/fork

from appuninstall.

ray0807 avatar ray0807 commented on August 20, 2024

我试了很多次,没有一次等于0的,galaxy3 ,5.1.1版本(自己刷的rom,有影响么?)
子进程fork()后 pid应该=0 但是不知道是不是我的手机问题,pid一直都是大于0的

from appuninstall.

ray0807 avatar ray0807 commented on August 20, 2024

@venshine

from appuninstall.

venshine avatar venshine commented on August 20, 2024

写一个Demo,JNI调用C方法只fork进程并打印,看是否结果还是你说的那样。

from appuninstall.

ray0807 avatar ray0807 commented on August 20, 2024

@venshine 我测试过了 我如果使用fork()得到的pid每次都>0,如果使用getpid()是一个固定值
1
我已经凌乱了 我都怀疑我的手机是不是linux系统的
等下我再用虚拟机试试

from appuninstall.

venshine avatar venshine commented on August 20, 2024

@ray0807 你的问题很特别,虚拟机结果应该没问题,我看你的代码fork两次,你只fork一次打印一下看看结果是否还有问题。

from appuninstall.

happyKen avatar happyKen commented on August 20, 2024

小米系列好像不兼容吧?有解决方法吗?

from appuninstall.

venshine avatar venshine commented on August 20, 2024

@happyKen 参考Android进程保活

from appuninstall.

happyKen avatar happyKen commented on August 20, 2024

能否提供一下com.wx.android.common.util.AppUtils这个类?你的github上没有提供

from appuninstall.

happyKen avatar happyKen commented on August 20, 2024

还有这个com.wx.android.common.util.PackageUtils;?

from appuninstall.

venshine avatar venshine commented on August 20, 2024

@happyKen 参考https://github.com/venshine/AndroidCommon

from appuninstall.

Related Issues (8)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.